# Homework Help: Fourier Series

1. Feb 18, 2010

### tomeatworld

1. The problem statement, all variables and given/known data
f(x) = sin(x) for 0$$\leq$$x<$$\pi$$. Extend f(x) as an even function . Obtain a cosine Fourier series for f.

2. Relevant equations
$$a_{0}$$/2 + $$\sum$$ $$a_{n}$$cos(nx)

3. The attempt at a solution
So as far as I know, to extend sin(x) as an even function you have to make f(x)=-sin(x) for $$-\pi\leq$$x<0 and then just use that to integrate for an but this gives a series without an a0 term which the question points to it having. What have I done wrong?

2. Feb 18, 2010

### elibj123

Have you integrated correctly?

Did you remember that the integral over [-pi,pi] breaks to [-pi,0] where it's -sin(x) and [0,pi] where it's sin(x) (or alternatively, the integral over [-pi,pi] is double the integral over [0,pi])

3. Feb 18, 2010

### tomeatworld

sure.
As you've said, I've just used:
$$\frac{2}{\pi}$$$$\int^{\pi}_{0}$$sin(x) dx
so integration gets
[-cos(x)$$]^{\pi}_{0}$$.
expanding gives [1 - 1] so I lose the $$a_{0}$$ term. Is that correct?

Oops, i see what I did. Forgot the - - so it should actually be 4/pi. Is that correct?

4. Feb 18, 2010

### vela

Staff Emeritus
Yeah, that's right.