# Fourier Series

1. Apr 13, 2010

### roam

I once wanted to find the nth order Fourier approximation for $$f(x)=x$$. Since this function is odd, the projections on all cosines will be zero, hence it will be expressed through the sines only. So I just needed to find the sine coefficients.

The problem is that I checked the answer to this problem in two different textbooks, each one giving a different answer from the other.

• The first book calculates the coefficients like this:
$$b_k= \frac{1}{\pi} \int^{2 \pi}_{0} f(x)sin(kx)= \frac{1}{\pi} \int^{2 \pi}_0 xsin(kx) dx =- \frac{2}{k}$$

• The second book calculates the coefficients this way:
$$b_k = (f(x),sin (k \pi x))= \int^1_{-1} x sin (k \pi x) dx= -x\frac{cos (k \pi x)}{k \pi} \right]^1_{-1} + \int^1_{-1} \frac{cos (k \pi x)}{k \pi}dx$$$$= -2 \frac{cos k \pi}{k \pi}=-(-1)^k \frac{2}{k \pi}$$

So which one is correct? I mean, they both are probably correct but I don't understand why each of these books use different methods and end up with different answers. Any explanation is very much appreciated.

2. Apr 13, 2010

### LCKurtz

Those two expressions are for the series of different functions. One is the periodic extension of f(x) = x on (-1,1) and the other the periodic extension of f(x) = x on (-π,π). One is a sawtooth of period 2π and the other a sawtooth of period 2. They happen to agree on (-1,1).