Prove that $\sum_{n=0}^\infty \frac{1}{(2n+1)^2}=\frac{\pi^2}{8}$ I am asked to prove that $$\sum_{n=0}^\infty \frac{1}{(2n+1)^2}=\frac{\pi^2}{8}.$$
However, I am asked to prove it using the fact that
$$\frac{\pi}{2}\tan\left(\frac{\pi}{2}z\right)=\sum_{m \text{ odd}}\left(\frac{1}{m-z}-\frac{1}{m+z}\right),$$
where $z\in \mathbb{C}$, which is something I proved in a previous exercise.
My first thought was using the fact that
$$\frac{1}{m-z}-\frac{1}{m-z}=\frac{2z}{m^2-z^2}$$
and therefore
$$\sum_{m \text{ odd}}\left(\frac{1}{m-z}-\frac{1}{m+z}\right)=\sum_{m \text{ odd}}\frac{2z}{m^2-z^2}=\sum_{n=0}^\infty \frac{2z}{(2n+1)^2-z^2}.$$
This last series is similar to the one I am aiming at, but I don't know how to transform it into the one that I want. Can someone help me?

Following the comment of @RaymondManzoni, we obtain continuing OP's approach
\begin{align*}
\frac{\pi}{4z}\tan\left(\frac{\pi}{2}z\right)=\sum_{n=0}^\infty\frac{1}{(2n+1)^2-z^2}\tag{1}
\end{align*}

We can evaluate the right-hand side of (1) at $z=0$. Since $\tan\left(\frac{\pi}{2}z\right)$ has a series expansion for $|z|<1$ we obtain by taking the limit as $z\to 0$ and the tangent  series expansion:
\begin{align*}
\color{blue}{\sum_{n=0}^\infty\frac{1}{(2n+1)^2}}&
=\lim_{z\to 0}\frac{\pi}{4z}\tan\left(\frac{\pi}{2}z\right)\\
&=\lim_{z\to 0}\frac{\pi}{4z}\left(\frac{\pi}{2}z+O(z^3)\right)\\
&\,\,\color{blue}{=\frac{\pi^2}{8}}
\end{align*}

