Computing $\sum_{n=0}^\infty \frac{(-1)^n}{2n+1} $

We can write $1-\sin{x}=2\cos^2{(x/2+\pi/4)}$, and I think we can now see the problem: all the roots have to be double roots. They'll be at $(4n + 1)\pi/2$ and $-(4n+3)\pi/2$, as you suggest, but all the factors have to be squared: $$ 1-\sin{x} = A \prod_{n=0}^{\infty} \left(1-\frac{2x}{(4n+1)\pi}\right)^2 \left(1+\frac{2x}{(4n+3)\pi}\right)^2, $$ and we have to worry about the value of $A$ to make sure we have the right scaling, about which the zeros tell us nothing. Of course, we actually know that $A=1$ by putting $x=0$.


Okay, so $$ 1-\sin{x} = \prod_{n=0}^{\infty} \left(1-\frac{2x}{(4n+1)\pi}\right)^2 \left(1+\frac{2x}{(4n+3)\pi}\right)^2 = \prod_{k=0}^{\infty} \left(1-(-1)^k\frac{2x}{(2k+1)\pi}\right)^2. $$ Now let's get to the series. The easiest way to differentiate a product is to differentiate the logarithm, since this turns it into a sum: $$ \log{(1-\sin{x})} = 2\sum_{k=0}^{\infty} \log{\left(1-(-1)^k\frac{2x}{(2k+1)\pi}\right)}. $$ Now differentiate: $$ -\frac{\cos{x}}{1-\sin{x}} = -\frac{4}{\pi}\sum_{k=0}^{\infty} \frac{(-1)^{k}}{4k+1} \frac{1}{1-(-1)^{k}2x/((2k+1)\pi)} $$ Putting $x=0$ and multiplying everything by $-1$ gives $$ 1 = \frac{4}{\pi} \sum_{k=0} \frac{(-1)^k}{4k+1}, $$ as required.


While $f(x) = 1 - \sin x$ is indeed an entire function, the roots at $x = \frac{(4n+1)\pi}{2}$ and $\frac{-(4n+3)\pi}{2}$ are in fact double roots, which you can check since they are also roots of $f'(x)$. So, the factorisation you give isn't valid.


I thought it might be instructive to present an approach that relies on elementary analysis only . To that end, we now proceed.

First, note that $\int_0^1 x^{2n}\,dx=\frac{1}{2n+1}$. Therefore, we can write

$$\begin{align} \sum_{n=0}^N \frac{(-1)^n}{2n+1}&=\sum_{n=0}^N(-1)^n\int_0^1x^{2n}\,dx\\\\ &=\int_0^1 \sum_{n=0}^\infty (-x^2)^n\,dx\\\\ &=\int_0^1 \frac{1-(-x^2)^{N+1}}{1+x^2}\,dx\\\\ &=\frac{\pi}{4}+(-1)^N \int_0^1 \frac{x^{2N+2}}{1+x^2}\,dx\tag 1 \end{align}$$

Noting that by integrating by parts the integral on the right-hand side of $(1)$, with $u=\frac{1}{1+x^2}$ and $v=\frac{x^{2N+3}}{2N+3}$, we see that

$$\begin{align} \left| \int_0^1 \frac{x^{2N+2}}{1+x^2}\,dx\right|&=\left|\frac{1}{2(2N+3)}+\frac{1}{2N+3}\int_0^1 \frac{2x}{(1+x^2)^2}x^{2N+3}\,dx\right|\\\\ &\le \frac{5/2}{2N+3}\\\\ &\to 0\,\,\text{as}\,\,N\to \infty\tag 2 \end{align}$$

Using the result from $(2)$, we see that

$$\lim_{N\to \infty}\sum_{n=0}^N \frac{(-1)^n}{2n+1}=\frac{\pi}{4}+\lim_{N\to \infty}\left((-1)^N \int_0^1 \frac{x^{2N+2}}{1+x^2}\,dx\right)=\frac{\pi}{4}$$

and hence we arrive at the coveted result

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

as expected.


Alternatively, we can appeal to the Dominated Convergence Theorem. Since $-1\le -x^2\le 0$, we see that $\left|\frac{1-(-x^2)^{N+1}}{1+x^2}\right|\le \frac{2}{1+x^2}$. Since $\int_0^1 \frac{2}{1+x^2}\,dx<\infty$, then the Dominated Convergence Theorem guarantees that

$$\begin{align} \lim_{N\to \infty}\int_0^1 \frac{1-(-x^2)^{N+1}}{1+x^2}\,dx &=\int_0^1\lim_{N\to \infty}\left( \frac{1-(-x^2)^{N+1}}{1+x^2}\right)\,dx\\\\ &=\int_0^1\frac{1}{1+x^2}\,dx\\\\ &=\frac{\pi}{4} \end{align}$$

as was to be shown!