I just asked this but I guess I'll try to be clearer this time. I need help finding the Fourier series for the following function:
$$f(x) = \begin{cases}0 & -\pi \le x < 0 \\ x^2 & 0\le x\le\pi\end{cases}$$
Afterwards, I need to use the answer to prove the following:
$$\frac{\pi^2}6 = \frac1{1^2} + \frac1{2^2} + \frac1{3^2} + \frac1{4^2} + \cdots$$
I need help because I solved the problem and got this as an answer:
$$f(x) = \frac{\pi^2}6 + \sum_{n=1}^\infty \frac{2(-1)^n}{n^2} \cos(nx) + \left[\frac{\pi(-1)^n}n + \frac{2\left((-1)^n-1\right)}{n^3\pi} \right] \sin(nx)$$
But the answer adds an extra two for the $\sin(nx)$ term as seen here:
$$f(x) = \frac{\pi^2}6 + \sum_{n=1}^\infty \frac{2(-1)^n}{n^2} \cos(nx) + \left[\color{red}{\frac{2(-1)^{n+1}\pi}n} + \frac{2\left((-1)^n-1\right)}{n^3\pi} \right] \sin(nx)$$
And I don’t really know if it’s a typo my professor made or if I’ve got something wrong. I’ve looked over my steps and nothing seems out of place, but it’s driving me crazy. Also, the answers say that for the proof I have to take $x = \pi$, but I can’t seem to understand why they’ve chosen that value to begin with. Is there a way to know what value to take for $x$ if I want to prove something like this? I hope I've been clear enough. If needed I can edit this and add how I got my answer. Thank you in advance!