How to prove $(1-2x)^2=1/3+4/\pi^2\sum_1^\infty \cos(2n x \pi)/n^2$ for $x \in [0,1)$? I tried to prove that
$$(1-2x)^2=1/3+4/\pi^2\sum_1^\infty \cos(2n x \pi)/n^2$$ for $x \in [0,1)$ with Fourier analysis, but I just found a Fourier series which defines the function. I also found the fourier series of $\cos(2n x \pi)$.
I don't think these results are helpful.
Any suggestions on how to prove this equation?
 A: Consider the equivalent problem using $y=x-\frac12$ on the interval $[-\frac12,\frac12]$: Prove that
$$
4y^2=\frac13+\frac{4}{\pi^2}\sum_{n=1}^\infty(-1)^n\frac{\cos(2\pi ny)}{n^2}\tag{1}
$$
Since $\pi\csc(\pi z)$ has residue $(-1)^n$ at each integer, let's consider $f_y(z)=\pi\csc(\pi z)\frac{\cos(2\pi zy)}{z^2}$.
Let $\gamma_N$ be the rectangular path
$$
(N{+}\!\tfrac12)-iN\to(N{+}\!\tfrac12)+iN\to-(N{+}\!\tfrac12)+iN\to-(N{+}\!\tfrac12)-iN\to(N{+}\!\tfrac12)-iN
$$
It is not hard to see that for $|y|<\frac12$,
$$
\lim_{N\to\infty}\;\;\oint_{\gamma_N}f_y(z)\;\mathrm{d}z=0\tag{2}
$$
Equation $(2)$ relates the residue of $f_y$ at $0$ with the sum in $(1)$:
$$
\operatorname{Res}(f_y,0)+ 2\sum_{n=1}^\infty(-1)^n\frac{\cos(2n\pi y)}{n^2}=0\tag{3}
$$
Let's look at the Laurent series for $f_y$:
$$
\begin{align}
\pi\csc(\pi z)\frac{\cos(2\pi zy)}{z^2}
&=\left(\frac1z+\frac{\pi^2}{6}z+\dots\right)\left(\frac{1}{z^2}-2\pi^2y^2+\dots\right)\\
&=\frac{1}{z^3}+\left(\frac{\pi^2}{6}-2\pi^2y^2\right)\frac{1}{z}+\dots\tag{4}
\end{align}
$$
Equation $(4)$ says that $\operatorname{Res}(f_y,0)=\frac{\pi^2}{6}-2\pi^2y^2$. Combining this with $(3)$ yields
$$
\sum_{n=1}^\infty(-1)^n\frac{\cos(2n\pi y)}{n^2}=\pi^2\left(y^2-\frac{1}{12}\right)\tag{5}
$$
which immediately verfies $(1)$.
A: Hint/Problems
(Changed since the previous was wrong -- the function is not even in it self..)


*

*Note first that $x\mapsto e(x)=(1-2x)^2$ is even on $[0,1]$ in the sense $e(x)= e(1-x)$ (either visualise it or by computation $(1-2(1-x))^2 = (1-2+2x)^2 = (-1+2x)^2)$).

*Now, let us look at the function $s$ on $I=[-1,1]$, which is the even extension of the function $x\mapsto (1-2x)^2$ on $[0,1]$ (so the graph looks a bit like $\omega$). 

*Note that the sine Fourier coefficients are 0, while the cosine Fourier coefficients are given by $$a_n = 2\int_0^1s(x)\cos(n\pi x)dx.$$

*Next $a_n=0$ for odd $n$, this follows from 1 (try to see why without a calculation) or a simple calculation, and for even $n\ne0$ we have 
$$a_n= \frac{16}{n^2\pi^2}$$
while $a_0=2/3$.

*Why is $s$ equal to the Fourier series on $[-1,1]$? 

*What is $s$ equal to in $[0,1]$?

Last edit
For even $n$ we have $n=2k$ for some $k$ and that $a_0$ should be divided by 2 in the expansion.
A: The series on the right hand has terms of the form $a_n\cos(2\pi n x)$ with $a_n\ne0$ for all $n$. This indicates a fundamental period of length $L=1$. When the sum of such a series is claimed to be equal to the function $f\!: x\mapsto (1-2x)^2$ on the interval $[0,1]$ then it has to be the Fourier series of the function $\tilde f$ obtained from $f$ by periodic extension with period $1$. As $\tilde f$ is even (check it!) its Fourier series contains only $\cos$-terms $a_n\cos(2\pi n x)$ to begin with. The $a_n$ are given by the formula
$$ a_n={2\over L}\int_0^L(1-2x)^2\ \cos(2\pi n x)\ dx = 2\int_0^1(1-2x)^2\ \cos(2\pi n x)\ dx\ .$$
For $n\geq 1$ the integral can be evaluated by partial integration (2 times); the case $n=0$ is immediate. Doing the calculations you will see that you get exactly the $a_n$ in the title.
So we know now that the formal Fourier series of $\tilde f$ is actually the series in the title. In order to finish the case we have to invoke a fundamental theorem about such series: When $\tilde f$ is an $L$-periodic continuous function of bounded variation per period then its formal Fourier series converges uniformly on ${\mathbb R}$ to $\tilde f(x)$. Since the assumptions of the theorem are obviously satisfied in our case, the claim follows.
