<s>[INST] calculating the sum of a series I was wondering if there is a way to use complex-analysis to solve the sum of the following series? (just like you can use it to solve integrals of some kinds (using fourier's transform for integrals).

$$\sum^{\infty}_{n=0}\frac{1}{n^2+25}$$

and

$$\sum^{\infty}_{n=0}\frac{(-1)^n}{n^2+25}$$

And if not, how to solve them otherwise?
thanks in advance!
 [/INST] We can evaluate the two sums using following expansions of trigonometry functions
which can be proved using Mittag Leffler's theorem:
$$
\frac{\cos x}{\sin x} = \lim_{N\to\infty}\sum_{n=-N}^N \frac{1}{x+n\pi}
\quad\text{ and }\quad
\frac{1}{\sin x} = \lim_{N\to\infty}\sum_{n=-N}^N \frac{(-1)^n}{x+n\pi}
$$
Let's look at the expansion at the left first. Substitute $x$ by $\pi y i$, move the term for $n = 0$ and group the terms for $+n$ and $-n$ togather, we get
$$\frac{\cos(\pi y i)}{\sin(\pi y i)} - \frac{1}{\pi y i} = \frac{1}{\pi}\sum_{n=1}^\infty \left(\frac{1}{y i + n} + \frac{1}{yi - n}\right)
= \frac{2 y}{\pi i}\sum_{n=1}^\infty\frac{1}{y^2+n^2}$$
This leads to
$$\sum_{n=0}^\infty \frac{1}{y^2+n^2} = \frac{1}{y^2} + \frac{\pi}{2y}\left( \frac{\cosh(\pi y)}{\sinh(\pi y)} - \frac{1}{\pi y}\right)
= \frac{1}{2y^2} + \frac{\pi}{2y}\frac{\cosh(\pi y)}{\sinh(\pi y)}
$$
The evaluation of the second sum is pretty similar, you get something like
$$
\sum_{n=0}^\infty \frac{(-1)^n}{y^2+n^2} = \frac{1}{2y^2} + \frac{\pi}{2y} \frac{1}{\sinh(\pi y)}
$$
As a result, one get
$$
\sum_{n=0}^\infty \frac{1}{25+n^2} = \frac{1}{50} + \frac{\pi}{10}\frac{\cosh(5\pi)}{\sinh(5\pi)}
\quad\text{ and }\quad
\sum_{n=0}^\infty \frac{(-1)^n}{25+n^2} = \frac{1}{50} + \frac{\pi}{10}\frac{1}{\sinh(5\pi)}$$
</s>