Actually, as the corresponding integral $\frac{\ln(\cos x)}{1x}$ 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)?

3$\begingroup$ Yes. We may interpret $f(n)$ as a residue of function $f(x)\cot (\pi x)$ in a point $n$. Then note that sum of residues of this function equals to 0 as integral over appropriate large circuit tends to 0. $\endgroup$– Fedor PetrovNov 30, 2015 at 15:13

2$\begingroup$ There is no relation between existence of closed form for $\int f(x)\;dx$ and closed form for $\sum f(n)$. $\endgroup$– Gerald EdgarNov 30, 2015 at 15:15

3$\begingroup$ Integral not of f(x), but of $f(x)\cot \pi x$ $\endgroup$– Fedor PetrovNov 30, 2015 at 15:30
3 Answers
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)}{pq} $$ 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\pi2\pi\sqrt{3}18\log 3 . $$
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.

$\begingroup$ Mmm ; sorry, but Wolfram (and Maple) gives the sum equals to 2.07417717505..., while (π coth π+1)/2 is 2.07667404... $\endgroup$ Nov 30, 2015 at 21:05

4$\begingroup$ @FeldmannDenis this anser 2.0766704 is correct, and when I ask Wolframalpha it confirms this wolframalpha.com/input/… $\endgroup$ Nov 30, 2015 at 22:02
Alternatively, you may use expansion of cotangent $$ \pi\cot \pi x=\frac1x+\sum_{n=1}^{\infty}\frac{2x}{x^2n^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=i2i(S1)$, $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_kz)$, for each summand we have $$ \sum_{j=n}^n\frac1{z_kj}=\frac1{z_k}+\sum_{k=1}^n\frac{2z_k}{z_k^2j^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.

$\begingroup$ Yes, but he asked to sum $f(n)$ with a more general class of functions $f$. $\endgroup$ Dec 1, 2015 at 0:14

$\begingroup$ Indeed, but this works for all rational functions. $\endgroup$ Dec 1, 2015 at 5:59

2$\begingroup$ Just to complete the picture, the expansion of the cotangent can be obtained by logarithmic differentiation from the infinite product for $\sin(\pi x)$, and the infinite product for $\sin(\pi x)$ can be obtained as dominated limit on the (easily computed) complete factorization of the polynomials $(1+iz/n)^n(1iz/n)^n$, that converge to $e^{iz}e^{iz}=2i\sin(z)$ (Is this Herglotz' proof?) $\endgroup$ Dec 1, 2015 at 11:24

$\begingroup$ (no: I've just found Herglotz trick on line) $\endgroup$ Dec 1, 2015 at 11:32

$\begingroup$ oh, I did not know this trick with polynomial $\endgroup$ Dec 1, 2015 at 12:07