# Calculating Fourier Coefficients

1. Nov 3, 2009

### Flat

1. The problem statement, all variables and given/known data
Determine the fourier coefficients of the 3-periodic function and determine how many terms needed to keep 3 digit accuracy.

f(t) = 1/2(1-Cos[Pi t]), for 0<t<1
f(t) = 1, for 1<t<2
f(t) = 1/2(1-Cos[Pi(t-3)]), for 2<t<3

2. Relevant equations
For the cos coefficient:
ak = $$\frac{2}{3}\int Cos(\frac{2 \pi k t}{3}) * f(t)$$

I used the identity: 2 Cos[a] Cos= Cos[a+b] +Cos[a-b]

3. The attempt at a solution

The problem is, when I work out the integrals I get an expression similar to:
$$\frac{a k +b}{c k}Sin()$$

I used the identity above and got a lot of cos integrals that were easy to solve
ak = $$\frac{-4 k}{\pi(9-4 k^{3}}Sin(\frac{2 \pi k}{3})$$