Does $\sum_{k=0}^\infty \frac{16(2k+1)^2}{(4m^2 - (2k+1)^2)^2}=\pi^2$?

I think the following series has the value

$$\sum_{k=0}^\infty \frac{16(2k+1)^2}{(4m^2 - (2k+1)^2)^2}=\pi^2$$

for any positive integer $m$, but I am not sure how to go about computing it. Plugging the above sum into a computer for a few different values of $m$ seems to verify the result. I don't have much experience computing any infinite sums of the above form, so I am not sure where to begin. The context for computing this series is to show that $\cos(2mx)$ can be written as an infinite sum of the functions $\sin(kx)$. On a related note, I would also like to show that

$$\sum_{k=0}^\infty \frac{64m^2}{(4m^2-(2k+1)^2)^2} = \pi^2$$

where again, $m$ is a positive integer; this sum appears in showing the opposite relation, that $\sin(2mx)$ can be written as a sum of $\cos(kx)$. Again, I have verified on a computer that this is true for at least the first few values of $m$. This second sum would be reasonable to compute if it were an integral, but I'm not sure of a way I can immediately apply that idea (if we consider $f(x) = c^4/(c^2-x^2)^2$ then we could compute the integral of this function from $0$ to $\infty$ by substitution $x=c\tanh\theta$ fairly easily). I'm aware that there are easier ways to show these relations between sines and cosines, but I'm invested enough in this approach that I would like to find a way to compute these sums. Any tips would be appreciated.

Edit: I am actually not 100% sure that the first sum converges to $\pi^2$ for all $m$; in Wolfram Alpha, the sum comes out to be $\pi^2$ for $m=1,2$ but for any $m\geq 3$ it simply approximates the sum, and the approximated value is clearly less than $\pi^2$, so I may have made an error. The value of the second sum definitely seems to be $\pi^2$ though.


Let $$f(m) = \sum_{k=0}^\infty \frac{16(2k+1)^2}{(4m^2-(2k+1)^2)^2}, \\ g(m) = \sum_{k=0}^\infty \frac{64m^2}{(4m^2-(2k+1)^2)^2}.$$ Then $$f(m) = \pi^2 \sec^2 m\pi + \frac{\pi}{m} \tan m \pi, \\ g(m) = \pi^2 \sec^2 m \pi - \frac{\pi}{m} \tan m\pi, \\ \quad m \ne 0.$$ A proof of this might be possible using a suitable contour integral.


In a first step, let $x=(2k+1)$ and consider $$f(x)=\frac{16x^2}{( x^2-4m^2)^2}=\frac{16x^2}{(x-2m)^2(x+2m)^2}$$ and use partial fraction decomposition to obtain $$f(x)=\frac{2}{m (x-2 m)}-\frac{2}{m (x+2 m)}+\frac{4}{(x+2 m)^2}+\frac{4}{(x-2 m)^2}$$ Replace $x$ by $(2k+1)$ and compute the partial sums from $k=0$ to $p$.

You will get $$S_1=\frac{H_{p-m+\frac{1}{2}}-H_{-m-\frac{1}{2}}}{m}$$ $$S_2=\frac{H_{m+p+\frac{1}{2}}-H_{m-\frac{1}{2}}}{m}$$ $$S_3=\psi ^{(1)}\left(m+\frac{1}{2}\right)-\psi ^{(1)}\left(p+m+\frac{3}{2}\right)$$ $$S_4=\psi ^{(1)}\left(\frac{1}{2}-m\right)-\psi ^{(1)}\left(p-m+\frac{3}{2}\right)$$

Now, using the asymptotics of $(S_1-S_2+S_3+S_4)$ $$\Sigma_p=\sum_{k=0}^p \frac{16(2k+1)^2}{(4m^2 - (2k+1)^2)^2}$$ $$\Sigma_p=\frac{\pi }{m}\left(\tan (\pi m)+\pi m \sec ^2(\pi m)\right)-\frac{4}{p}+\frac{4}{p^2}-\frac{8 m^2+11}{3 p^3}+O\left(\frac{1}{p^4}\right)$$ $$\color{blue}{\Sigma_\infty=\frac{\pi }{m}\left(\tan (\pi m)+\pi m \sec ^2(\pi m)\right)}\tag 1$$

So, if $m$ is an integer $\neq 0$, $\Sigma_\infty=\pi^2$ as desidered (if $m=0$, the result is $2\pi^2$).

But you could use $(1)$ for any value of $m$ of your choice and $\Sigma_\infty $ will always be larger than $\pi^2$.