Exact formula for $\sum_{n=0}^{+\infty}\frac1{n^2+1}$ Actually, as the corresponding integral $\frac{\ln(\cos x)}{1-x}$ or something like that) cannot be expressed in closed form by Liouville theorem, this shouldn't exist, but I believe I have seen it shown somewhere using Fourier series. By the way, the result :
$$\sum_{n=0}^{\infty}\frac{1}{n^2+1}= \frac{1+ \pi\coth\pi}{2}$$
is known by WolframAlpha. But my question is : does there exist a general theory of similar results (something like  exact formulas for $\sum_{n=0}^{+\infty}\frac{1}{an^2+bn+c}$, at least when $a$, $b$ and $c$ are integers)?
 A: Alternatively, you may use expansion of cotangent
$$
\pi\cot \pi x=\frac1x+\sum_{n=1}^{\infty}\frac{2x}{x^2-n^2}
$$
as a blackbox (after all, complex residues are not the only way to obtain this formula: say, there is Herglotz trick, explained, for instance, in Proofs from the Book).
Just substitute $x=i$, for the sum $S=\sum_{n=0}^{\infty} \frac1{n^2+1}$ we get $\pi \cot \pi i=-i-2i(S-1)$, $2iS=i-\pi \cot \pi i=i(1+\pi\coth \pi)$, $S=(1+\pi \coth \pi)/2$.
For arbitrary rational function $f(z)$, we may find on this way the principal value of $\sum_{n\in \mathbb{Z}} f(n)$. If $f(z)=\sum_k c_k/(z_k-z)$, for each summand we have
$$
\sum_{j=-n}^n\frac1{z_k-j}=\frac1{z_k}+\sum_{k=1}^n\frac{2z_k}{z_k^2-j^2}\rightarrow \frac{\pi\cot \pi z_k}2,
$$
thus principal value of $\sum_{n\in \mathbb{Z}} f(n)$ equals
$$
\sum_k c_k \frac{\pi\cot \pi z_k}2.
$$
This works whenever $f$ has only simple poles and $f(z)=O(1/z)$ for large $z$. If additionally $f(z)=O(1/z^2)$, principal value is the same as ordinary sum. If $f$ has multiple poles, we may perturbate $f$ a bit and take a limit. Yes, this is one of approaches to residues.
If you need a sum not over integers, but over positive integers (it looks like it is the case), you instead of cotangent use the digamma $\psi$-function
$$
\psi(z)=-\gamma+\sum_{n=0}^{\infty} \left(\frac1{n+1}-\frac1{n+z}\right).
$$
This is the essence of Gerald Edgard's answer.
A: To do $\sum\frac{1}{an^2+bn+c}$, factor the denominator and get a digamma answer.
$$
\sum_{n=0}^\infty \frac{1}{(x+p)(x+q)} = \frac{\psi(p)-\psi(q)}{p-q}
$$
And note that digamma of a rational can be evaluated in terms of logarithms and trig functions (Gauss's digamma theorem).
$$
\sum_{n=0}^\infty\frac{1}{(n+\frac{1}{4})(n+\frac{1}{3})} =
36\log 2+6\pi-2\pi\sqrt{3}-18\log 3 .
$$
A: This is a standard exercise on residue theory. If $f$ is a rational function
with zero of order $\geq 2$ at infinity and no poles at integers, then
$$\sum_{-\infty}^\infty f(n)=-\sum{\mathrm{res}}_af(z)\pi\cot\pi z,$$
where the summation is over all poles of $f$. For $f(z)=1/(1+z^2)$ we obtain
$$\sum_0^\infty\frac{1}{1+n^2}=1+\sum_{1}^\infty\frac{1}{1+n^2}=(\pi\coth\pi+1)/2,$$
so you copied the result from Wolfram incorrectly.
