TITLE: How do I calculate the value of this series?
QUESTION [11 upvotes]: I want to find the value to which this series converges $$\sum_{n=0}^\infty \frac{(-1)^n}{n^2+1}$$
I tried looking at the sequence of partial sums $$S_k = \sum_{n=0}^k \frac{(-1)^n}{n^2+1}$$ and I noticed that $$\frac{-1}{n^2+1} \leq \frac{(-1)^n}{n^2+1} \leq \frac{1}{n^2 +1}$$ and so I think that by the squeeze rule I can see ( I could have just noticed it by logic, but okay) that the terms converge to zero. How do I find the value of the original series though? I could only show that it converged

REPLY [13 votes]: You may notice that:
$$ \frac{1}{n^2+1} = \int_{0}^{+\infty}\sin(x)e^{-nx}\,dx\tag{1}$$
from which$^{(*)}$:
$$ S=\sum_{n\geq 0}\frac{(-1)^n}{n^2+1}=1+\int_{0}^{+\infty}\sin(x)\sum_{n\geq 1}(-1)^n e^{-nx}\,dx \tag{2}$$
and:
$$ S = 1-\int_{0}^{+\infty}\frac{\sin(x)}{e^x+1}\,dx =\color{red}{\frac{1}{2}\left(1+\frac{\pi}{\sinh\pi}\right)}\tag{3}$$
where the last equality follows from integration by parts and the residue theorem. The same can be proved by considering the Fourier cosine series of $\cosh(x)$ over the interval $(-\pi,\pi)$.

Yet another (Eulerian) approach. It is clearly enough to compute $\sum_{n\geq 1}\frac{1}{n^2+1}$ and $\sum_{n\geq 1}\frac{1}{4n^2+1}$.
From the Weierstrass product for the $\sinh$ function we have
$$ \frac{\sinh(\pi z)}{\pi z}=\prod_{n\geq 1}\left(1+\frac{z^2}{n^2}\right)\tag{4}$$
and by applying $\frac{d}{dz}\log(\cdot)$ to both sides:
$$ -\frac{1}{z}+\pi\coth(\pi z) = \sum_{n\geq 1}\frac{2z}{z^2+n^2}\tag{5}$$
At last we just need to evaluate the LHS of $(5)$ at $z=1$ and $z=\frac{1}{2}$.

$(*)$ The exchange of $\sum$ and $\int$ is allowed by the absolute convergence of the series $\sum_{n\geq 0}\frac{(-1)^n}{n^2+1}$, the trivial inequality $\left|\sin(x)\right|\leq x$ and the dominated convergence theorem. For any $x>0$ we have
$$ \sum_{n=1}^{N} e^{-nx}\leq \frac{1}{e^x-1} $$
and $\frac{x}{e^x-1}$ is a function belonging to $\mathcal{L}^1(\mathbb{R}^+)$, whose integral over $\mathbb{R}^+$ equals $\zeta(2)=\frac{\pi^2}{6}$.