# Proving that $\sum_{n=1}^{\infty}\frac{(-1)^{n+1}}{n^{2}}=\frac{\pi^{2}}{12}$

I want to prove that $$\sum_{n=1}^{\infty}\frac{(-1)^{n+1}}{n^{2}}=\frac{\pi^{2}}{12},$$ using the Fourier Series for the $$2\pi$$-periodic function $$f(\theta)=\theta^{2},\quad (-\pi<0<\pi)$$, that is,

$$\theta^{2}=\frac{\pi^{2}}{3}+4\sum_{n=1}^{\infty}\frac{(-1)^{n}\cos(n\theta)}{n^{2}}$$ So,

$$\sum_{n=1}^{\infty}\frac{(-1)^{n}\cos(n\theta)}{n^{2}}=\frac{\theta^{2}}{4}-\frac{\pi^{2}}{12}.$$

I'm looking for a $$\theta$$ such that $$(-1)^{n}\cos(n\theta)=(-1)^{n+1}\Rightarrow \cos(n\theta)=-1$$ for all $$n\in\mathbb{N}$$. How can I choose that $$\theta$$?

• Choosing $\theta$ such that $\cos(n\theta)=1$ for every $n$ is ok too Commented Sep 29, 2018 at 19:35
• Instead, you might want to "looki for a $\theta$ such that $(-1)^{n}\cos(n\theta)=(-1)^n$" for every $n$... which is direct.
– Did
Commented Sep 29, 2018 at 19:35
• I didn't saw how obvious it is. Thank you both, guys. Commented Sep 29, 2018 at 19:40

$$\sum_{n=1}^{\infty}\frac{(-1)^{n}\cos(n\theta)}{n^{2}}=\frac{\theta^{2}}{4}-\frac{\pi^{2}}{12}$$

Take $$\theta=0$$ so $$\cos n \theta = 1$$

$$\sum_{n=1}^{\infty}\frac{(-1)^{n}}{n^{2}}=-\frac{\pi^{2}}{12}\\ (-1)\sum_{n=1}^{\infty}\frac{(-1)^{n}}{n^{2}}=(-1)\cdot\left(-\frac{\pi^{2}}{12}\right)\\ \sum_{n=1}^{\infty}\frac{(-1)^{n+1}}{n^{2}}=\frac{\pi^{2}}{12}\\$$

Split it! $$\sum_{n=1}^{\infty}\frac{(-1)^{n+1}}{n^{2}}=\sum_{n ~\text{odd}}\frac{1}{n^{2}} - \sum_{n ~\text{even}}\frac{1}{n^{2}}.$$

Add and subtract the "even" part:

$$\sum_{n=1}^{\infty}\frac{(-1)^{n+1}}{n^{2}}=\left(\sum_{n ~\text{odd}}\frac{1}{n^{2}} + \sum_{n ~\text{even}}\frac{1}{n^{2}}\right) - \sum_{n ~\text{even}}\frac{1}{n^{2}} - \sum_{n ~\text{even}}\frac{1}{n^{2}} = \\ =\sum_{n=1}^{\infty}\frac{1}{n^2}-2\sum_{n ~\text{even}}\frac{1}{n^{2}} = \frac{\pi^2}{6} - 2\sum_{n ~\text{even}}\frac{1}{n^{2}}.$$

Now, notice that:

$$\sum_{n ~\text{even}}\frac{1}{n^{2}}=\sum_{i =1}^{\infty}\frac{1}{(2i)^{2}} = \frac{1}{4}\sum_{i =1}^{\infty}\frac{1}{i^{2}} = \frac{1}{4}\frac{\pi^2}{6}.$$

Therefore:

$$\sum_{n=1}^{\infty}\frac{(-1)^{n+1}}{n^{2}} = \frac{\pi^2}{6} - 2\frac{1}{4}\frac{\pi^2}{6} = \frac{\pi^2}{12}.$$