# How I can calculate $\sum_{n = 0}^{\infty}\frac{(-1)^n(2n + 1)}{n^2 + 1}$

I turned a series into the integral $$\int_{0}^{1}\frac{\cos(\log x)}{x^2 + 1}dx$$ using partial fractions and other techniques, but I don't know what to do next. I did a search on the site but found nothing similar. Thus, $$\sum_{n = 0}^{\infty}\frac{(-1)^n(2n + 1)}{n^2 + 1} = \int_{0}^{1}\frac{\cos(\log x)}{x^2 + 1}dx = ?$$

• My initial guess would be that complex analysis on the function $f(z) = \csc(\pi z) \frac{2z+1}{z^2+1}$ should relate the sum to the residues at $z = \pm i$. – Daniel Schepler Jul 24 at 20:13
• @Mathsource: the numerical value of the series is $\approx 0.0967935$ while $\frac{\pi}{4\cosh(\pi/2)}\approx 0.313$ (this is the value of the integral. The integral does not equal the series.) – Jack D'Aurizio Jul 24 at 20:33
• It's easy to see that $\int_{0}^{1}\frac{\cos(\log x)}{x^2 + 1}dx=\frac12 \int_{0}^{\infty}\frac{\cos(\log x)}{x^2 + 1}dx$, afterwards the integral becomes a duplicate of this: math.stackexchange.com/questions/2136232/… – カカロット Jul 24 at 20:36
• Since the integral is not equal to the series, which of them do you want to find? I think, since the integral is already given in the link provided by Zacky, you might be interested in the series instead? – Yuriy S Jul 24 at 21:11
• Using generating functions, the series can be represented as $$f(x) =\frac i 2·\left(x^{-i}·∫{\frac{x^{-1 + i}·(x + 1)}{(x - 1)^2} dx} - x^i·∫{\frac{x^{-1 - i}·(x + 1)}{(x - 1)^2}dx}\right)$$ at $x=-1$ – Sudix Jul 24 at 21:22