Fourier serie property for $\sum_{n=1}^\infty \frac{1}{n^2}=\frac{\pi^2}{6}$ If $$f(x) \sim \frac{1}{2} a_0 + \sum_{n=1}^\infty (a_n\cos nx+b_n \sin nx)$$
For $x\in[0,2\pi)$, how can I show that:
$$ \sum_{n=1}^\infty \frac{b_{n}}{n} = \frac{1}{2\pi}\int_{0}^{2\pi}(\pi -x) f(x)\,dx$$
Find the Fourier coefficients of $f(x)=\pi -x$, $x\in[0,2\pi)$ and deduce that (using the first part of this problem):
$$\sum_{n=1}^\infty \frac{1}{n^2}=\frac{\pi^2}{6}$$
I do not know how to prove this, I tried computing the coefficients of the series but I am really mess with this proof. Please if you can, help me.
I tried this but I do not know if it is correct...
And for the other part I tried this:

 A: As Mattos said, You need to calculate:
$\frac{1}{2\pi}\int_{0}^{2\pi}(\pi -x) f(x)\,dx$, by substituting into this integral,
$f(x) =\frac{1}{2} a_0 + \sum_{n=1}^\infty (a_n\cos nx+b_n \sin nx)$
Use integration by parts for the xcosnx and xsinnx terms.
You should get $\sum_{n=1}^\infty \frac{b_{n}}{n}$ as a result (everything else will cancel).
Then for the second part, after you get the fourier terms of $f(x)=\pi-x$, substitute $f(x)=\pi-x$ and the $b_n$ formula into
$\sum_{n=1}^\infty \frac{b_{n}}{n} = \frac{1}{2\pi}\int_{0}^{2\pi}(\pi -x) f(x)\,dx$
Evaluate the integral on the right hand side, and do a little simplification and you should get:
$\sum_{n=1}^\infty \frac{1}{n^2}=\frac{\pi^2}{6}$
EDIT, here's the integral for the first part:
I'll calculate the integral in pieces. First the $a_0$ term:
$\frac{1}{2\pi}\int_{0}^{2\pi}(\pi -x)(\frac{1}{2}a_0)\,dx$
$=\frac{a_0}{4\pi}\int_{0}^{2\pi}(\pi -x)dx$
$=\frac{a_0}{4\pi}(\pi x -0.5x^2)$ (from 0 to 2$\pi$)
$=0$
Now the $a_n$ part:
$\frac{1}{2\pi}\int_{0}^{2\pi}(\pi -x)a_ncos(nx)\,dx$
$=\frac{a_n}{2\pi}\int_{0}^{2\pi}(\pi -x)cos(nx)\,dx$
$=\frac{a_n}{2\pi}\int_{0}^{2\pi}\pi cos(nx)\,dx-\frac{a_n}{2\pi}\int_{0}^{2\pi}x cos(nx)\,dx$
The first integral goes to 0. So we have:
$=-\frac{a_n}{2\pi}\int_{0}^{2\pi}x cos(nx)\,dx$
Use integration by parts
$u = x$
$dv = cos(nx)dx$
this gives $v = \frac{1}{n}sin(nx)$
So using $\int udv = uv - \int vdu$
We have:
$\int_{0}^{2\pi}x cos(nx)\,dx = \frac{x}{n}sin(nx)$ (from 0 to $2\pi$) - $\int_{0}^{2\pi}\frac{1}{n}sin(nx)\,dx$
this comes out to 0.
Now the $b_n$ part:
$\frac{1}{2\pi}\int_{0}^{2\pi}(\pi -x)b_nsin(nx)\,dx$
$=\frac{b_n}{2\pi}\int_{0}^{2\pi}(\pi -x)sin(nx)\,dx$
$=\frac{b_n}{2\pi}\int_{0}^{2\pi}\pi sin(nx)\,dx-\frac{b_n}{2\pi}\int_{0}^{2\pi}x sin(nx)\,dx$
The first integral goes to 0. So we have:
$=-\frac{b_n}{2\pi}\int_{0}^{2\pi}x sin(nx)\,dx$
Use integration by parts
$u = x$
$dv = sin(nx)dx$
this gives $v = -\frac{1}{n}cos(nx)$
So using $\int udv = uv - \int vdu$
We have:
$\int_{0}^{2\pi}x sin(nx)\,dx = -\frac{x}{n}cos(nx)$ (from 0 to $2\pi$) + $\int_{0}^{2\pi}\frac{1}{n}cos(nx)\,dx$
this comes out to $-\frac{2\pi}{n}$.
So:
$-\frac{b_n}{2\pi}\int_{0}^{2\pi}x sin(nx)\,dx = (-\frac{b_n}{2\pi})(-\frac{2\pi}{n}) = \frac{b_n}{n}$
Now just add the summation sign.
EDIT For the second part, calculate
$\frac{1}{2\pi}\int_{0}^{2\pi}(\pi -x)^2\,dx$
$\frac{1}{2\pi}(\frac{x^3}{3}-\pi x^2+\pi^2x)$ evaluated between $2\pi$ and 0.
This comes out to:
$\frac{1}{2\pi} (\frac{8\pi^3}{3}-4\pi^3+2\pi^3)$
$=\frac{\pi^2}{3}$
$f(x) = \pi-x$, calculate fourier components
$a_0 = \frac{1}{\pi}\int_{-\pi}^{\pi}(\pi-x)dx$
$a_0 = 2\pi$
$a_n = \frac{1}{\pi}\int_{-\pi}^{\pi}(\pi-x)cos(nx)dx$
$a_n = 0$
$b_n = \frac{1}{\pi}\int_{-\pi}^{\pi}(\pi-x)sin(nx)dx$
$b_n = -\frac{sin(nx)+n(\pi-x)\cos(nx)}{\pi n^2}$ (evaluation at $\pi$ minus evaluation at -$\pi$)
$b_n = \frac{2}{n}$
So finally, substituting into:
$\sum_{n=1}^\infty \frac{b_{n}}{n} = \frac{1}{2\pi}\int_{0}^{2\pi}(\pi -x) f(x)\,dx$
we have
$\sum_{n=1}^\infty \frac{2}{n^2} = \frac{\pi^2}{3}$
divide both sides by 2
$\sum_{n=1}^\infty \frac{1}{n^2} = \frac{\pi^2}{6}$
