# Fourier cosine series of cos(x) from x=0 to Pi

1. May 16, 2009

### alias99

1. The problem statement, all variables and given/known data
Find the Fourier cosine series for f(x) = cos x, 0 < x < Pi

EDIT: I believe we are talking about a half-range extension..

2. Relevant equations
Fourier cosine series:
f(x) = a0/2 + Sum(n = 1 to infinity) (an * cos (nx))

where a0 = 2/L * integral (x = 0, x = L) (f(x) dx)

and an = 2/L * integral (x = 0, x = L) (f(x) * cos (n*Pi*x/L) dx)

Sorry if thats hard to understand...

3. The attempt at a solution

I graphed the function and extended the period to - Pi, i.e. -Pi < x < Pi

I found a0 = 2/Pi * integral (x = 0, x = L) (cos x dx) = 0
an = 2/Pi * integral (x = 0, x = L) (cos x * cos (nx) dx)
and evaluated the integral using IBP...

an = 2/Pi * (ncos(x)*sin (nx) - sin(x)cos(nx))*1/(n2-1)| x = 0, x = Pi
which gives me an = 0!

So the Fourier cosine series would be:
f(x) = 0

I would really appreciate any clarification as getting 0 for the series doesnt sound right..

Last edited: May 17, 2009
2. May 17, 2009

### tiny-tim

Hi alias99!
Nooo … no need for IBP here (and it doesn't help anyway ) …

cosx cos(nx) = … ?

Last edited by a moderator: Apr 24, 2017
3. May 17, 2009

### alias99

Hi tiny-tim! (reminds me of the Nudie juices..hmm)

You're right, I do need to learn my identities :tongue:

I can now evaluate the integral much easier (Lol... funny thing is I did manage to get a result by IBP.. it looked like it would have continued indefinetely but I got the original integral on the RHS, took it over to the LHS and made it the subject)

so now..

cosx cos(nx) = 1/2 (cos (x-nx) + cos (x+nx)) which can be integrated fairly easily

I still get 0! hehe.. I guess it is 0 after all. probably has something to do with cos(x) having an area under the curve of 0 between x = -Pi and x = Pi (or even x = 0 to Pi)

I'm probably going to state that the Fourier cosine series of cos (x) with a period of Pi is cos(x) .. or is it 0.. lol :tongue:

I'd appreciate just a word of confirmation, if you dont mind :)

4. May 18, 2009

### tiny-tim

Hi alias99!
Well, it seemed a strange question …
… if f is 2π-periodic, then yes obviously the only term in its Fourier cosine series is the first one, cosx.

5. May 18, 2009

### alias99

Great! Thanks alot tiny-tim

6. Jan 15, 2011

### wk1989

I also just tried to do this and it looks like this is pretty trivial if you try to get the exponential Fourier series instead? Because cosx can be written as e^jwt+e^-jwt