# Thread: diff eqns help plz!

1. ## diff eqns help plz!

Find the Fourier series on the interval [-pi, pi] of the EVEN function:

f(x) = { -x for x < 0
{ 0 for x = 0
{ x for x > 0

So we are given the hint, that its an even function... which I believe means we only have to solve for the a sub n's..

However, we just went over this in class on friday... can you show me how to proceed? Thanks in advance!

Note that the function $f(x)=x\,{\rm{sgn}}(x)$, where $
{\rm{sgn}}(x)=\begin{cases}
-1, & x < 0 \\
0, & x = 0 \\
1, & x > 0
\end{cases}$
.

You are correct to note that for an even function, you only need to solve for $a_n$ since $b_n$ is 0 for every $n$.

Now, $
a_n=\frac1L \int_{-L}^L f(x) \cos(\frac{n \pi x}L)\,dx\\
=\frac1\pi \int_{-\pi}^\pi x\,{\rm{sgn}}(x) \cos(n x)\,dx\\
=\frac2\pi \int_0^\pi x\,\cos(n x)\,dx\\
$
.

Finally, after solving the integral above (note that the $\sin(n \pi)$ term always is 0 and $\cos(n \pi)=(-1)^n$) you'll get the fourier series given by $f(x)=\frac{a_0}2+\sum_{n=1}^\infty a_n\, \cos(nx)$.

3. fantastic explanation, thank you very much!

4. ## diff. eqns.

Hi Guys,
I posted this once before, and cyph gave me a nice answer, but my professor told me to take it back home and give it another look...

Find the Fourier series on the interval [-pi, pi] of the EVEN function:

f(x) =
{ -x for x < 0
{ 0 for x = 0
{ x for x > 0

Here's my work:

Assuming all the above is correct (which it probably isn't) this is where I am stuck, can you help me finish the problem? Thanks very much in advance!

5. Originally Posted by boousaf
Hi Guys,
I posted this once before, and cyph gave me a nice answer, but my professor told me to take it back home and give it another look...

Find the Fourier series on the interval [-pi, pi] of the EVEN function:

f(x) =
{ -x for x < 0
{ 0 for x = 0
{ x for x > 0

Here's my work:

Assuming all the above is correct (which it probably isn't) this is where I am stuck, can you help me finish the problem? Thanks very much in advance!

You are trying to find the fourier series of

$f(x)=|x|, x\in [-\pi,\pi]$

$a_0=\frac{1}{\pi}\int_{-\pi}^{\pi}|x|dx=2\int_{0}^{\pi}xdx=\pi$

$a_n=\frac{1}{\pi}\int_{-\pi}^{\pi}|x|\cos(nx)dx=\frac{2}{\pi}\int_{0}^{\pi }x\cos(nx)dx=\frac{2}{\pi}\left( \frac{\cos(\pi n)+n\sin(\pi n)-1}{n^2}\right)=$
$\frac{2}{\pi}\left( \frac{(-1)^n-1}{n^2} \right)$

$b_n=\frac{1}{\pi}\int_{-\pi}^{\pi}|x|\sin(nx)dx=0, \forall n$

$|x|=f(x)=\frac{\pi}{2}+\frac{2}{\pi}\sum_{n=1}^{\i nfty}\left( \frac{(-1)^n-1}{n^2} \right)\cos(nx)$

we can further simplify this becuase whenever n is even the term will be zero so

$f(x)=\frac{\pi}{2}-\frac{4}{\pi}\sum_{n=1}^{\infty}\frac{1}{(2n-1)^2}\cos([2n-1]x)$