TITLE: Proving $\sum_{n =1,3,5..}^{\infty }\frac{4k \ \sin^2\left(\frac{n}{k}\right)}{n^2}=\pi$
QUESTION [7 upvotes]: Proving 

$$\sum_{n =1,3,5..}^{\infty }\frac{4k  \sin^2\left(\frac{n}{k}\right)}{n^2}=\pi$$
  Where $k$ any number greater than $0$ 

I tried to prove it by using the Fourier series  but I couldnt find any form likes the above formula . Any helps. Thanks

REPLY [7 votes]: It  seems to have  escaped attention  that this  sum may  be evaluated
using  harmonic  summation  techniques  which can  be  an  instructive
exercise and usually succeeds on Fourier series.
Suppose we seek to show that
$$\sum_{n=1,3,5,\ldots} \frac{\sin^2(n/q)}{n^2} = \frac{\pi}{4q}.$$
As suggested we use
$$\sin^2 t = \frac{1-\cos(2t)}{2}$$
to get
$$\sum_{n=1,3,5,\ldots} \frac{1}{n^2}
\frac{1-\cos(2n/q)}{2}$$
which is
$$\frac{1}{2} \sum_{n=1,3,5,\ldots} \frac{1}{n^2}
-\frac{1}{2} \sum_{n=1,3,5,\ldots} \frac{1}{n^2} \cos(2n/q).$$
We will be using
$$\sum_{n=1,3,5,\ldots} \frac{1}{n^s}
= \left(1-\frac{1}{2^s}\right) \zeta(s)$$
which gives for the sum
$$\frac{1}{2} \left(1-\frac{1}{2^2}\right) \zeta(2)
-\frac{1}{2} \sum_{n=1,3,5,\ldots} \frac{1}{n^2} \cos(2n/q)$$
or
$$\frac{\pi^2}{16}
-\frac{1}{2} \sum_{n=1,3,5,\ldots} \frac{1}{n^2} \cos(2n/q).$$
Introduce $S(x)%$ given by
$$S(x) = \sum_{n=1,3,5,\ldots} \frac{1}{n^2}\cos(nx)
= \sum_{k=1}^\infty \frac{1}{(2k-1)^2}\cos((2k-1)x) $$
so that we are interested in $S(2/q).$

The sum term is harmonic and  may be evaluated by inverting its Mellin
transform.
Recall the harmonic sum identity
$$\mathfrak{M}\left(\sum_{k\ge 1} \lambda_k g(\mu_k x);s\right) =
\left(\sum_{k\ge 1} \frac{\lambda_k}{\mu_k^s} \right) g^*(s)$$
where $g^*(s)$ is the Mellin transform of $g(x).$
In the present case we have
$$\lambda_k = \frac{1}{(2k-1)^2}, \quad \mu_k = (2k-1) 
\quad \text{and} \quad
g(x) = \cos(x).$$
We need the Mellin transform $g^*(s)$ of $g(x)$.

Now  the Mellin  transform  of  $\cos(x)$ was  computed  at this MSE link
and found to be $$\Gamma(s) \cos(\pi s/2)$$
It follows that the Mellin transform $Q(s)$ of the harmonic sum 
$S(x)$ is given by
$$Q(s) = \Gamma(s)\cos(\pi s/2) 
\left(1-\frac{1}{2^{s+2}}\right) \zeta(s+2)
\\\text{because}\quad
\sum_{k\ge 1} \frac{\lambda_k}{\mu_k^s} = 
\sum_{k\ge 1} \frac{1}{(2k-1)^2} \frac{1}{(2k-1)^s}
= \left(1-\frac{1}{2^{s+2}}\right) \zeta(s+2)$$
for $\Re(s) > -1.$
The   Mellin   inversion   integral   here   is   $$\frac{1}{2\pi   i}
\int_{1/2-i\infty}^{1/2+i\infty}  Q(s)/x^s ds$$  which we  evaluate by
shifting  it to the  left for  an expansion  about zero  (the abscissa
$\Re(s) =  1/2$ is in  the intersection of  $\langle -1,\infty\rangle$
and $\langle 0,1\rangle$ from the cosine transform).

The zeros of  the cosine term at the negative  odd integers cancel the
poles of the gamma function at those values. Additional cancelation is
gained from the  trivial zeros of the zeta  function term $\zeta(s+2)$
at the even negative integers $p$ with $p\le -4.$

This leaves just two poles at $s=0$ and $s=1$ and we have
$$\mathrm{Res}_{s=0} Q(s)/x^s = \frac{\pi^2}{8}
\quad\text{and}\quad
\mathrm{Res}_{s=-1} Q(s)/x^s = - \frac{\pi}{4} x$$
and therefore
$$S(x) \sim \frac{\pi^2}{8} - \frac{\pi}{4} x.$$
We will see that this is exact for $x\in[0,\pi).$

With $q\ge 1$  we have $2/q\le 2$  and we get for the  initial sum the
form
$$\frac{\pi^2}{16} - \frac{1}{2}\frac{\pi^2}{8}
+ \frac{1}{2} \frac{\pi}{4} \frac{2}{q}
= \frac{\pi}{4q}$$
which is the claim we were trying to prove.

We  still  need  to  prove  exactness on  $[0,\pi)$  to  complete  the
argument.

Put  $s= \sigma + it$ with $\sigma \le -3/2$
where we seek to evaluate
$$\frac{1}{2\pi i} \int_{-3/2-i\infty}^{-3/2+i\infty} Q(s)/x^s ds$$
by shifting it to the left.
Recall that with $\sigma > 1$  and for $|t|\to\infty$ we have
$$|\zeta(\sigma+it)| \in \mathcal{O}(1).$$

Furthermore recall the functional equation 
of the Riemann Zeta function
$$\zeta(1-s) = \frac{2}{2^s\pi^s} 
\cos\left(\frac{\pi s}{2}\right) \Gamma(s) \zeta(s)$$
which we re-parameterize like so
$$\zeta(s+2) = 2\times (2\pi)^{s+1}
\cos\left(-\frac{\pi (s+1)}{2}\right) \Gamma(-s-1) \zeta(-s-1)$$
which is
$$\zeta(s+2) = -2\times (2\pi)^{s+1}
\sin(\pi s/2) \frac{\Gamma(1-s)}{s(s+1)} \zeta(-s-1).$$
Substitute this into $Q(s)$ to obtain
$$\Gamma(s) \cos(\pi s/2) \left(1-\frac{1}{2^{s+2}}\right) \times
-2 \times (2\pi)^{s+1} \sin(\pi s/2) 
\frac{\Gamma(1-s)}{s(s+1)} \zeta(-s-1).$$
Use the reflection formula for the Gamma function to obtain
$$\cos(\pi s/2) \left(1-\frac{1}{2^{s+2}}\right) \times
-2 \times (2\pi)^{s+1} \sin(\pi s/2) \times
\frac{\pi}{\sin(\pi s)}
\frac{1}{s(s+1)} \zeta(-s-1),$$
in other words we have
$$Q(s) = -\pi(2\pi)^{s+1} 
\left(1-\frac{1}{2^{s+2}}\right)
\frac{\zeta(-s-1)}{s(s+1)}.$$
There are two components here, call them $Q_1(s)$ and $Q_2(s),$
which are
$$-\pi(2\pi)^{s+1} 
\frac{\zeta(-s-1)}{s(s+1)}
\quad\text{and}\quad
\pi(2\pi)^{s+1} 
\frac{1}{2^{s+2}}
\frac{\zeta(-s-1)}{s(s+1)}.$$
We evaluate these with $\sigma < -5/2.$ For the first component
this implies (with $\sigma = -5/2$ we have $\Re(-s-1) = 3/2$)
$$|Q_1(s)/x^s|\sim
2\pi^2 (2\pi)^{\sigma} x^{-\sigma} |t|^{-2}.$$
or 
$$|Q_1(s)/x^s|\sim
2\pi^2 (x/2/\pi)^{-\sigma} |t|^{-2}.$$
We see from the term in $|t|$ that the integral obviously converges.
(This much we knew already.)
Moreover, when $x\in(0,2\pi)$ we have $(x/2/\pi)^{-\sigma}\to 0$ as 
$\sigma\to -\infty.$ 
The term  in $x$ does not depend  on the variable $t$  of the integral
and may be brought to the front.
This means that the contribution from the left side of the rectangular
contour that we employ as we  shift to the left vanishes in the limit.

For the second component we get
$$|Q_2(s)/x^s|\sim
\frac{\pi^2}{2} (\pi)^{\sigma} x^{-\sigma} |t|^{-2}.$$
or 
$$|Q_2(s)/x^s|\sim
\frac{\pi^2}{2} (x/\pi)^{-\sigma} |t|^{-2}.$$
This is the same as the first only now we have convergence in $(0,\pi).$

Joining  the bounds  for  $Q_1(s)$  and $Q_2(s)$  we  have proved  the
exactness of the formula for $S(x)$ in the interval $(0,\pi)$ obtained
earlier.

As I have  mentioned elsewhere there is a  theorem hiding here, namely
that certain Fourier series can be evaluated by inverting their Mellin
transforms which  is not terribly  surprising and which the  reader is
invited to state and prove.