Prove that $\sum_{n=1}^{\infty }\left ( \frac {\sin((2n-1)x)}{(2n-1)x)}\right )^k \frac{(-1)^{n-1}}{2n-1}=\frac π 4$ for $0\lt x\lt \frac \pi {2k} $ Question :- Prove that
$$
\sum_{ n =1}^{\infty }
\left\{\frac{\sin\left(\left[2n - 1\right]x\right)}
{\left(2n - 1\right)x}\right\}^{k}\
\frac{\left(-1\right)^{n - 1}}{2n - 1} = \frac{π}{4}
\qquad\mbox{for}\quad 0\lt x\lt \frac{\pi}{2k}
$$
While reading some papers , I came across this series.Unfortunately I do not have any link to the website since I took screenshot of It few months back .

*

*The Author claims that the above series is true for
$0\lt x\lt \pi/\left(2k\right)$ . However he does not provide any mathematical proof instead he calculates the sum for different $x$ and $k$ like for $k = 100$ and $x = \pi/200$ the above sum up to $50$ terms is
$$
0.78539 81633 97448 30961 55824
$$
which is very close to $\pi/4$.


*I verified It myself for $k = 1$.


*Actually the author is working on various variations of the
Gregory-Leibniz series and series of form
$$
\frac{\sin\left(\mathrm{f}\left(x\right)\right)}
{\mathrm{g}\left(x\right)}
\quad\mbox{and}\quad 
\frac{\cos\left(\mathrm{f}\left(x\right)\right)}{\mathrm{g}\left(x\right)}
$$


*${\tt Mathematica}$ evaluates the series in terms of Lerch transcendent $\Phi$ function. I couldn't find any way to prove the  given series.
Thank you for your help !!.
 A: We can prove this result by integrating the complex function $$f(z) = \left(\frac{\sin\left(\left[2z - 1\right]x\right)}
{\left(2z - 1\right)x}\right)^{k} \, \frac{\pi \csc (\pi z)}{2z-1} $$ around a square contour with vertices at $ \pm \left(N+ \frac{1}{2}\right)+ i \left(N+ \frac{1}{2} \right)$, where $N$ is some positive integer.
(I'm exploiting the fact that the function  $\pi \csc (\pi z)$ has simple poles at the integers with residues that alternate between $1$ and $-1$.)
The condition  $0 < x \le \frac{\pi}{2k}$ ensures that the integral vanishes as $N \to \infty$ through the positive integers.
Basically what's happening is that the exponential growth of $\sin^{k}\left((2z-1)x\right)$ as $\Im(z) \to \pm \infty$ is being neutralized by the exponential decay of $\csc (\pi z)$ as $\Im(z) \to \pm \infty$.
More specifically, the magnitude of $\sin^{k}\left((2z-1)x\right)$ grows like a constant time $e^{\pm 2kx\Im(z)}$ as $\Im(z) \to \pm \infty$, while the magnitude of  $\csc(\pi z)$ decays like a constant times $e^{\mp \pi \Im(z)}$ as $\Im(z) \to \pm \infty$.
So if we integrate around the contour and then let $N \to \infty$, we get $$ \begin{align} \lim_{N \to \infty} \oint f(z) = 0 &= 2 \pi i \left( \sum_{n=-\infty}^{\infty}\operatorname{Res}\left[f(z), n \right] + \operatorname{Res}\left[f(z), \frac{1}{2} \right] \right) \\ &=  \small2 \pi i \left(\sum_{n=-\infty}^{\infty}\left(\frac{\sin\left(\left[2n - 1\right]x\right)}
{\left(2n - 1\right)x}\right)^{k} \frac{(-1)^n}{2n-1} + \frac{\pi}{2}\lim_{z \to \frac{1}{2}} \left(\frac{\sin\left(\left[2z - 1\right]x\right)}
{\left(2z - 1\right)x}\right)^{k} \csc(\pi z)  \right) \\ &=2 \pi i \left( \sum_{n=-\infty}^{\infty}\left(\frac{\sin\left(\left[2n - 1\right]x\right)}
{\left(2n - 1\right)x}\right)^{k} \frac{(-1)^n}{2n-1} + \frac{\pi}{2} (1)(1) \right) \\ &=2 \pi i \left(\sum_{n=-\infty}^{\infty} \left(\frac{\sin\left(\left[2n - 1\right]x\right)}
{\left(2n - 1\right)x}\right)^{k} \frac{(-1)^n}{2n-1} + \frac{\pi}{2} \right) . \end{align}$$
Therefore, $$\sum_{n=-\infty}^{\infty}\left(\frac{\sin\left(\left[2n - 1\right]x\right)}
{\left(2n - 1\right)x}\right)^{k} \frac{(-1)^{n-1}}{2n-1} = \frac{\pi}{2}.  $$
But notice that $$  \sum_{n=-\infty}^{0} \left(\frac{\sin\left(\left[2n - 1\right]x\right)}
{\left(2n - 1\right)x}\right)^{k} \frac{(-1)^{n-1}}{2n-1}= \sum_{n=1}^{\infty}\left(\frac{\sin\left(\left[2n - 1\right]x\right)}
{\left(2n - 1\right)x}\right)^{k} \frac{(-1)^{n-1}}{2n-1}.$$
The result then follows.
