# On the evalution of an infinite sum

I wish to show that $$\sum_{n = 0}^\infty (-1)^n \left [\frac{2n + 1/2}{(2n + 1/2)^2 + 1} + \frac{2n + 3/2}{(2n + 3/2)^2 + 1} \right] = \frac{\pi}{\sqrt{2}} \frac{\cosh \left (\frac{\pi}{2} \right )}{\cosh (\pi)}.$$

The reason I wish to find such a sum is as follows. The question here called for the evaluation (I have added its value) of $$\int_0^\infty \frac{\sqrt{x} \cos (\ln x)}{x^2 + 1} \, dx = \frac{\pi}{\sqrt{2}} \frac{\cosh \left (\frac{\pi}{2} \right )}{\cosh (\pi)}.$$

As one of the comments, the OP remarked that they would like to see different approaches to the evaluation of the integral so I thought I would try my hand at one that does not rely on contour integration and the residue theorem. My approach was as follows: \begin{align} \int_0^\infty \frac{\sqrt{x} \cos (\ln x)}{x^2 + 1} \, dx &= \int_0^1 \frac{\sqrt{x} \cos (\ln x)}{x^2 + 1} \, dx + \int_1^\infty \frac{\sqrt{x} \cos (\ln x)}{x^2 + 1} \, dx\\ &= \int_0^1 \frac{\cos (\ln x) (x + 1)}{\sqrt{x} (1 + x^2)} \, dx, \end{align} after a substitution of $$x \mapsto 1/x$$ has been enforced in the second of the integrals. Now if we enforce a substitution of $$x \mapsto e^{-x}$$ one arrives at $$\int_0^\infty \frac{\sqrt{x} \cos (\ln x)}{x^2 + 1} \, dx = \int_0^\infty \frac{\cos x \cosh (x/2)}{\cosh x} \, dx.$$ Writing the hyperbolic functions in terms of exponentials we have \begin{align} \int_0^\infty \frac{\sqrt{x} \cos (\ln x)}{x^2 + 1} \, dx &= \int_0^\infty \frac{\cos x (e^{-x/2} + e^{-3x/2})}{1 + e^{-2x}} \, dx\\ &= \text{Re} \sum_{n = 0}^\infty (-1)^n \int_0^\infty \left [e^{-(2n + 1/2 - i) x} + e^{-(2n + 3/2 - i)x} \right ] \, dx\\ &= \text{Re} \sum_{n = 0}^\infty (-1)^n \left [\frac{1}{2n + 1/2 - i} + \frac{1}{2n + 3/2 - i} \right ] \tag1\\ &= \sum_{n = 0}^\infty (-1)^n \left [\frac{2n + 1/2}{(2n + 1/2)^2 + 1} + \frac{2n + 3/2}{(2n + 3/2)^2 + 1} \right], \end{align} which brings me to my sum.

Some thoughts on finding this sum

Rewriting the sum $$S$$ in (1) as follows: \begin{align} S &= \text{Re} \cdot \frac{1}{4} \sum_{n = 0}^\infty \left [\frac{1}{n + 1/8 - i/4} + \frac{1}{n + 3/8 - i/4} - \frac{1}{n + 5/8 - i/4} - \frac{1}{n + 7/8 - i/4} \right ]\\ &= \text{Re} \cdot \frac{1}{4} \sum_{n = 0}^\infty \left (\frac{1}{n + 1} - \frac{1}{n + 7/8 - i/4} \right ) + \frac{1}{4} \sum_{n = 0}^\infty \left (\frac{1}{n + 1} - \frac{1}{n + 5/8 - i/4} \right )\\ & \qquad - \frac{1}{4} \sum_{n = 0}^\infty \left (\frac{1}{n + 1} - \frac{1}{n + 3/8 - i/4} \right ) - \frac{1}{4} \sum_{n = 0}^\infty \left (\frac{1}{n + 1} - \frac{1}{n + 1/8 - i/4} \right )\\ &= \frac{1}{4} \text{Re} \left [\psi \left (\frac{7}{8} - \frac{i}{4} \right ) + \psi \left (\frac{5}{8} - \frac{i}{4} \right ) - \psi \left (\frac{3}{8} - \frac{i}{4} \right ) - \psi \left (\frac{1}{8} - \frac{i}{4} \right ) \right ]. \end{align} Here $$\psi (z)$$ is the digamma function. I was rather hoping to use the reflexion formula for the digamma function, but alas it does not seem to take me any closer to a final real solution.

Final thought

While it would be nice to see how to evaluate this sum, perhaps my approach was not the best so alternative methods to evaluate the integral that avoid this sum and do not rely on contour integration would also be welcome.

• This isn't unclear in the sense that I don't know what you are asking. The final paragraph is asking for how to avoid counter integration and do what you did nicer but could you explain a bit more on that? The first 90% of the question is just statements. No question at all. I feel like that entire portion of mathematical could be removed with no effect on what you are asking. What was the purpose of that? You could just summarize that you attempted that and wish to know if a clean solution exists. – The Great Duck Jan 26 at 17:44
• @TheGreatDuck I think it's clear enough. There's something called context and motivation which is always great to have in a question. – TheSimpliFire Jan 26 at 18:46

\begin{align}\newcommand{\Re}{\operatorname{Re}} &\sum_{n=0}^\infty(-1)^n\left[\frac{2n+1/2}{(2n+1/2)^2+1}+\frac{2n+3/2}{(2n+3/2)^2+1}\right]\tag1\\ &=\frac12\sum_{n\in\mathbb{Z}}(-1)^n\left[\frac{2n+1/2}{(2n+1/2)^2+1}+\frac{2n+3/2}{(2n+3/2)^2+1}\right]\tag2\\ &=\frac14\sum_{n\in\mathbb{Z}}(-1)^n\left[\frac{n+\frac14}{\left(n+\frac14\right)^2+\frac14}+\frac{n+\frac34}{\left(n+\frac34\right)^2+\frac14}\right]\tag3\\ &=\frac18\sum_{n\in\mathbb{Z}}(-1)^n\left[\frac1{n+\frac14-\frac i2}+\frac1{n+\frac14+\frac i2}+\frac1{n+\frac34-\frac i2}+\frac1{n+\frac34+\frac i2}\right]\tag4\\ &=\frac18\left[\frac\pi{\sin\left(\pi\!\left(\frac14-\frac i2\right)\right)}+\frac\pi{\sin\left(\pi\!\left(\frac14+\frac i2\right)\right)}+\frac\pi{\sin\left(\pi\!\left(\frac34-\frac i2\right)\right)}+\frac\pi{\sin\left(\pi\!\left(\frac34+\frac i2\right)\right)}\right]\tag5\\ &=\frac{\pi\sqrt2}8\left[ \frac{\cosh\left(\frac\pi2\right)+i\sinh\left(\frac\pi2\right)}{\cosh(\pi)}+ \frac{\cosh\left(\frac\pi2\right)-i\sinh\left(\frac\pi2\right)}{\cosh(\pi)}+ \frac{\cosh\left(\frac\pi2\right)-i\sinh\left(\frac\pi2\right)}{\cosh(\pi)}\right.\\ &\left.\phantom{=\frac{\pi\sqrt2}8}+ \frac{\cosh\left(\frac\pi2\right)+i\sinh\left(\frac\pi2\right)}{\cosh(\pi)}\right]\tag6\\ &=\frac\pi{\sqrt2}\frac{\cosh(\pi/2)}{\cosh(\pi)}\tag7 \end{align} Explanation:
$$(2)$$: use symmetry
$$(3)$$: pull factor of $$\frac12$$ out front
$$(4)$$: partial fractions
$$(5)$$: use $$(3)$$ from this answer
$$(6)$$: evaluate the sine of a complex number
$$(7)$$: simplify