Evaluating $\int_0^{\infty} {y^2 \cos^2(\frac{\pi y}{2}) \over (y^2-1)^2} dy$ I´m having trouble with the following integral
$$
\int_0^{\infty} {y^2 \cos^2(\frac{\pi y}{2}) \over (y^2-1)^2} dy
$$
I have tried lots of approaches and nothing works. Mathematica says it does not converge but that is not true. It appears in a Physical problem (it is the energy of a system) and the answer should be (by conservation of energy): $\frac{\pi^2}{8}$ but I cannot show it. 

\begin{align*}
I
&=
{1 \over 2}\int_{-\infty}^{\infty}
{y^2 \cos^{2}\left(\pi y/2\right)
 \over
 \left(y^{2} - 1\right)^{2}}\,{\rm d}y
=
{1 \over 8}\int_{-\infty}^{\infty}y\cos^{2}\left(\pi y/2\right)\left\lbrack%
{1 \over \left(y - 1\right)^{2}}
-
{1 \over \left(y + 1\right)^{2}}
\right\rbrack
\,{\rm d}y
\\[5mm]&=
{1 \over 8}\int_{-\infty}^{\infty}y\cos^{2}\left(\pi y/2\right)\left\lbrack%
{1 \over \left(y - 1\right)^{2}}
+
{1 \over \left(y - 1\right)^{2}}
\right\rbrack
\,{\rm d}y
=
{1 \over 4}\int_{-\infty}^{\infty}{y\cos^{2}\left(\pi y/2\right) \over \left(y - 1\right)^{2}}
\,{\rm d}y
\\[5mm]&=
{1 \over 4}\int_{-\infty}^{\infty}{\sin^{2}\left(\pi y/2\right) \over y^{2}}
\,{\rm d}y
=
{1 \over 4}\int_{0}^{\pi}{\rm d}\pi'\,{1 \over 2}\int_{-\infty}^{\infty}
{\sin\left(\pi' y\right) \over y}
\,{\rm d}y
=
{\pi \over 8}\int_{-\infty}^{\infty}{\sin\left(y\right) \over y}\,{\rm d}y
\\[5mm]&=
{\pi \over 8}\int_{-\infty}^{\infty}\,{\rm d}y\,
{1 \over 2}\int_{-1}^{1}\,{\rm d}k\,{\rm e}^{{\rm i}ky}
=
{\pi^{2} \over 8}\int_{-1}^{1}\,{\rm d}k\,
\int_{-\infty}^{\infty}\,{{\rm d}y \over 2\pi}\,{\rm e}^{{\rm i}ky}
=
{\pi^{2} \over 8}\int_{-1}^{1}\,{\rm d}k\,\delta\left(k\right)
=
{\Large{\pi^{2} \over 8}}
\end{align*}
