What is the sum of
$\sum_{k=0}^\infty \frac{(-1)^{k+1}}{2k+1}$? What is the sum of the following expression:
$$\sum_{k=0}^\infty \frac{(-1)^{k+1}}{2k+1}$$
I know it is convergent but I cannot evaluate its sum.
 A: Consider adding $x^{2k+1}$ to the summand:
$$f(x)=\sum_{k=0}^\infty\frac{(-1)^kx^{2k+1}}{2k+1}$$
Then...
$$f'(x)=\sum_{k=0}^\infty(-1)^kx^{2k}=\frac1{1+x^2}$$
Thus,
$$f(x)=\arctan(x)$$
And

$$\sum_{k=0}^\infty\frac{(-1)^k}{2k+1}=f(1)=\arctan(1)=\frac\pi4$$

This is Leibniz's formula for $\pi$.
A: $\newcommand{\bbx}[1]{\,\bbox[8px,border:1px groove navy]{\displaystyle{#1}}\,}
 \newcommand{\braces}[1]{\left\lbrace\,{#1}\,\right\rbrace}
 \newcommand{\bracks}[1]{\left\lbrack\,{#1}\,\right\rbrack}
 \newcommand{\dd}{\mathrm{d}}
 \newcommand{\ds}[1]{\displaystyle{#1}}
 \newcommand{\expo}[1]{\,\mathrm{e}^{#1}\,}
 \newcommand{\ic}{\mathrm{i}}
 \newcommand{\mc}[1]{\mathcal{#1}}
 \newcommand{\mrm}[1]{\mathrm{#1}}
 \newcommand{\pars}[1]{\left(\,{#1}\,\right)}
 \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}}
 \newcommand{\root}[2][]{\,\sqrt[#1]{\,{#2}\,}\,}
 \newcommand{\totald}[3][]{\frac{\mathrm{d}^{#1} #2}{\mathrm{d} #3^{#1}}}
 \newcommand{\verts}[1]{\left\vert\,{#1}\,\right\vert}$
\begin{align}
\sum_{k = 0}^{\infty}{\pars{-1}^{k + 1} \over 2k + 1} & =
\sum_{k = 0}^{\infty}{\ic^{\pars{2k + 1} + 1} \over 2k + 1} =
\sum_{k = 1}^{\infty}{\ic^{k + 1} \over k}\,{1 - \pars{-1}^{k} \over 2} =
{1 \over 2}\,\ic\sum_{k = 1}^{\infty}{\ic^{k} \over k} -
{1 \over 2}\,\ic\sum_{k = 1}^{\infty}{\pars{-\ic}^{k} \over k}
\\[5mm] & =
-\,\Im\sum_{k = 1}^{\infty}{\ic^{k} \over k} =
\Im\ln\pars{1 - \ic} = \arctan\pars{-1\phantom{-} \over 1} =
\bbx{-\,{\pi \over 4}}
\end{align}
A: We use the fact that, for $x\in(-1,1)$
$$
\sum_{k=0}^\infty \frac{(-1)^kx^{2k+1}}{2k+1}=\int_0^x \left(\sum_{k=0}^\infty (-1)^kt^{2k}\,dx\right) =\int_0^x\frac{dt}{1+t^2}=\arctan x.
$$
So it remains to show the last equality of the following
$$
\frac{\pi}{4}=\arctan(1)=\lim_{x\nearrow 1}\arctan x=\lim_{x\nearrow 1}\sum_{k=0}^\infty \frac{(-1)^kx^{2k+1}}{2k+1}=\sum_{k=0}^\infty \frac{(-1)^k}{2k+1}
$$
which is a bit tricky.
A: hint
use the fact that
$$\frac {x^k}{2k+1}=\frac {1}{\sqrt {-x}}\frac {(\sqrt{-x})^{2k+1}}{2k+1} $$
for $x<0$
