<s>[INST] Find the half range cosine fourier series expansion for $f(x)=(x-1)^2,\quad 0Find the half range cosine fourier series expansion for
$$f(x)=(x-1)^2,\quad 0<x<1$$
and hence deduce that
$$\pi^2=8\left(\frac 1 {1^2}+\frac 1 {3^2}+\frac 1 {5^2}+\ldots\right)\tag{1}$$
My work
I have derived that the expansion is
$$f(x)=\frac 1 3+\sum\limits_{n=1}^\infty \frac 4 {n^2\pi^2} \cos n\pi x$$
But I could not deduce that $(1)$.
 [/INST] Define $f$ as a periodic function of $1$ on $\mathbb{R}$ as
$$
f(x)=(x−1)^2, \hspace{5 mm} 0\le x<1
$$
Set $x=0$, then
$$
f(0)=1=\frac 1 3+\sum\limits_{n=1}^\infty \frac 4 {n^2\pi^2}
$$
So we have
$$
\dfrac{2}{3}=\sum\limits_{n=1}^\infty \frac 4 {n^2\pi^2} \hspace{4 mm} \text{and} \hspace{4 mm} \dfrac{\pi^2}{6}=\sum\limits_{n=1}^\infty \dfrac1{n^2}
$$
And set $x\to1^{-}$, then
$$
\lim\limits_{x\to1^{-}}f(x)=0=\frac 1 3+\sum\limits_{n=1}^\infty \frac 4 {n^2\pi^2} \cos n\pi
$$
Thus
\begin{align}
\dfrac{\pi^2}{12}&=\sum\limits_{n=1}^\infty \dfrac1 {(2n-1)^2}-\sum\limits_{n=1}^\infty \dfrac1 {(2n)^2}
\\
&=\sum\limits_{n=1}^\infty \dfrac1 {(2n-1)^2}-\frac1{4}\sum\limits_{n=1}^\infty \dfrac1 {n^2}
\\
&=\sum\limits_{n=1}^\infty\dfrac1 {(2n-1)^2}-\dfrac{\pi^2}{24}
\end{align}
So
$$
\sum\limits_{n=1}^\infty\dfrac1 {(2n-1)^2}=\dfrac{\pi^2}{8}
$$
</s>