Determine the trigonometric Fourier series

528 Views Asked by At

Consider the function $$ f(x):=\begin{cases}x(\pi-x), & x\in [0,\pi]\\-x(\pi +x), & x\in [-\pi,0]\end{cases} $$ and calculate its trigonometric Fourier series.

Hello! So my task is to calculate $$ \frac{a_0}{2}+\sum_{k=1}^{\infty}(a_k\cos(kx)+b_k\sin(kx)). $$

I already calculated $a_0$ and $a_k$, I hope my results are correct, it was rather much calculation: $$ a_0=\frac{1}{\pi}\int_{-\pi}^{\pi}f(x)\, dx=\frac{\pi^2}{3} $$ and $$ a_k=\frac{1}{\pi}\int_{-\pi}^{\pi}f(x)\cos(kx)\, dx=\frac{2\pi(\cos(k\pi)-1)}{k^2}+\frac{4\sin(k\pi)}{k^3} $$

Before calculating $b_k$ and what is needed furthermore I would like to know if my recent results are correct.

Maybe anyone can say me?

2

There are 2 best solutions below

8
On BEST ANSWER

First of all, you should be able to reduce $a_k, b_k$ to an expression involving only $k$, not an expression in $\cos(k\pi)$, etc.

I get $a_0=\pi^2/3$ (like you) and $$a_k = \frac{\pi}{k^2}\left( (-1)^{k+1} -1 \right),$$ but my calculations may have an error of course.

You can simplify calculations a lot by noting $f$ is even. This also means that you don't have to calculate $b_k$. Every even function will have $b_k = 0$ for all $k$!

4
On

Your $a_0$ seems to be correct, but $a_k$ is not. As Eric Auld said because function is even $b_k$ is zero.

With this type of integral I like to substitute $\cos(kx) = \Re e^{i k x}$. You need to be careful with this type of substitution to make sure that real part can be taken outside of the integral, in this case it can be. Then $a_k$ is:

$$a_k = \frac{1}{\pi}\left(\Re \int_{-\pi}^0 (-x(\pi+x)e^{i k x}\, dx+\Re \int_{0}^\pi (x(\pi-x)e^{i k x}\, dx \right) = -\frac{2(1+(-1)^k)}{k^2}$$

Where I used $\cos(k\pi) = (-1)^k$.