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?
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$!