# Math Help - fourier series representation

1. ## fourier series representation

f(x) = cosax between pi and -pi and a is a constant

can find the an coefficent to be (sin(n+a)x)/(n+a) + (sin(n-a)x)/(n-a) but cant get any further.

2. Originally Posted by dannie
f(x) = cosax between pi and -pi and a is a constant

can find the an coefficent to be (sin(n+a)x)/(n+a) + (sin(n-a)x)/(n-a) but cant get any further.
This makes no sense. The coefficient can't be a function of x. Did you forget to evaluate at $\pi$ and $-\pi$?

cos(ax) is an even function- it will have no "sin(nx)" terms in it. The coefficient of cos(nx) will be
$\frac{1}{\pi}\int_{-\pi}^{\pi} cos(ax) cos(nx) dx=$ $\frac{1}{2\pi}\left(\int_{-\pi}^\pi cos((n+a)x)dx+ \int_{-\pi}^\pi cos(n- a)x dx\right)$
for n> 0.

The n= 0 term is $\frac{1}{2\pi}\int_{-pi}^{\pi} cos(ax)dx$.

As I said above, all coefficients of "sin(nx)" will be 0.

3. Originally Posted by HallsofIvy
This makes no sense. The coefficient can't be a function of x. Did you forget to evaluate at $\pi$ and $-\pi$?

cos(ax) is an even function- it will have no "sin(nx)" terms in it. The coefficient of cos(nx) will be
$\frac{1}{\pi}\int_{-\pi}^{\pi} cos(ax) cos(nx) dx=$ $\frac{1}{2\pi}\left(\int_{-\pi}^\pi cos((n+a)x)dx+ \int_{-\pi}^\pi cos(n- a)x dx\right)$
for n> 0.

The n= 0 term is $\frac{1}{2\pi}\int_{-pi}^{\pi} cos(ax)dx$.

As I said above, all coefficients of "sin(nx)" will be 0.
You can also use by-parts here.

$C_n= \frac{1}{\pi}\int_{-\pi}^{\pi} cos(ax) cos(nx) dx$

$U = cos(ax)$ and $dV = cos(nx)dx$

$du = -asin(ax)$ and $V= \frac{ sin(nx) }{n}$

$\frac{1}{\pi}\int_{-\pi}^{\pi} cos(ax) cos(nx) dx = \frac{a}{\pi} [ \frac{ sin(nx)cos(ax) }{n} + \frac{a}{n} \int_{-\pi}^{\pi} sin(ax)sin(nx) dx]$

$\frac{a^2}{n \pi} [ \int_{-\pi}^{\pi} sin(ax)sin(nx) dx]$

$U = sin(ax)$ and $dV = sin(nx) dx$

$du = acos(ax)$ and $V= - \frac{ cos(nx) }{n}$

$\frac{a^2}{n \pi} [ \int_{-\pi}^{\pi} sin(ax)sin(nx) dx] = \frac{a^2}{n \pi} [ -\frac{ cos(nx)sin(ax) }{n} + \frac{1}{n} \int_{-\pi}^{\pi} cos(ax)cos(nx)dx ]$

$
C_n = \frac{a^2}{n \pi} [ -( \frac{ (-1)^n sin(a \pi ) }{n} - \frac{ (-1)^n sin(- a \pi ) }{n} ) + \frac{ \pi }{n} C_n]$

$
C_n = \frac{a^2}{n^2 \pi} [ -2 (-1)^n sin(a \pi ) + \pi C_n]$

$C_n (1 - \frac{a^2}{n^2} ) = -2 (-1)^n sin(a \pi )$

$C_n = - \frac{ 2 (-1)^n sin(a \pi ) } { (1 - \frac{a^2}{n^2 } ) }$

I'm fairly certain I've missed something or forgot something major (spidy sense is tingling...).