Calculate the sum $\sum_{n=1}^\infty {(-1)^n\over 1+n^2}$

If you know how to compute $\sum_{n\geq 1}\frac{1}{n^2+a^2}$ (for instance, through the Poisson summation formula) then you may just exploit $$ \sum_{n\geq 1}\frac{(-1)^n}{n^2+1}=-\sum_{n\geq 1}\frac{1}{n^2+1}+2\sum_{m\geq 1}\frac{1}{(2m)^2+1}=\frac{1}{2}\sum_{n\geq 1}\frac{1}{n^2+\left(\frac{1}{2}\right)^2}-\sum_{n\geq 1}\frac{1}{n^2+(1)^2}.$$ Since $\int_{0}^{+\infty}\frac{\sin(nx)}{n}e^{-ax}\,dx = \frac{1}{n^2+a^2}$ we also have $$ \sum_{n\geq 1}\frac{1}{n^2+a^2} = \int_{0}^{+\infty}W(x) e^{-ax}\,dx = \frac{1}{1-e^{-2\pi a}}\int_{0}^{2\pi}\frac{\pi -x}{2}e^{-ax}\,dx$$ where $W(x)$ is $2\pi$-periodic and piecewise-linear sawtooth wave, which equals $\frac{\pi-x}{2}$ over $(0,2\pi)$.
This immediately leads to $$ \sum_{n\geq 1}\frac{(-1)^n}{n^2+1} = \frac{\pi}{e^{\pi}-e^{-\pi}}-\frac{1}{2}.$$


$$\sum_{n=1}^\infty {(-1)^n\over 1+n^2}=\sum_{n=1}^\infty {1\over 1+(2n)^2}-\sum_{n=1}^\infty {1\over 1+(2n-1)^2}$$ we know that $$\frac{\pi x\coth(\pi x)-1}{2x^2}=\sum_{n=1}^{\infty}\frac{1}{x^2+n^2}=\frac{1}{x^2}\sum_{n=1}^{\infty}\frac{1}{1+(\frac{n}{x})^2}$$ $$\frac{\pi x\coth(\pi x)-1}{2}=\sum_{n=1}^{\infty}\frac{1}{1+(\frac{n}{x})^2}$$

let$x=\frac{1}{2}$ $$\frac{\frac{\pi}{2}\coth(\frac{\pi}{2})-1}{2}=\sum_{n=1}^{\infty}\frac{1}{1+(2n)^2}\tag1$$ and we have $$\frac{\pi \tanh(\pi x/2)}{4x}=\sum_{n=1}^{\infty}\frac{1}{x^2+(2n-1)^2}$$ let $x=1$ $$\frac{\pi \tanh(\pi /2)}{4}=\sum_{n=1}^{\infty}\frac{1}{1+(2n-1)^2}\tag2$$ so $$\sum_{n=1}^\infty {(-1)^n\over 1+n^2}=\frac{\frac{\pi}{2}\coth(\frac{\pi}{2})-1}{2}-\frac{\pi \tanh(\pi /2)}{4}$$