# Infinite Sum of 1/n^2 Variant

An advanced problem one of my friends gave me which I think would be interesting to discuss: $\text {Compute } \displaystyle\sum_{n=1}^{\infty} \dfrac {1}{n^2+1}.$

Note by Ahaan Rungta
4 years, 11 months ago

MarkdownAppears as
*italics* or _italics_ italics
**bold** or __bold__ bold
- bulleted- list
• bulleted
• list
1. numbered2. list
1. numbered
2. list
Note: you must add a full line of space before and after lists for them to show up correctly
paragraph 1paragraph 2

paragraph 1

paragraph 2

[example link](https://brilliant.org)example link
> This is a quote
This is a quote
    # I indented these lines
# 4 spaces, and now they show
# up as a code block.

print "hello world"
# I indented these lines
# 4 spaces, and now they show
# up as a code block.

print "hello world"
MathAppears as
Remember to wrap math in $$...$$ or $...$ to ensure proper formatting.
2 \times 3 $$2 \times 3$$
2^{34} $$2^{34}$$
a_{i-1} $$a_{i-1}$$
\frac{2}{3} $$\frac{2}{3}$$
\sqrt{2} $$\sqrt{2}$$
\sum_{i=1}^3 $$\sum_{i=1}^3$$
\sin \theta $$\sin \theta$$
\boxed{123} $$\boxed{123}$$

Sort by:

Let $$f(x) = \cosh x$$, and let's try to find the Fourier Series of $$f(x)$$ on $$[-\pi,\pi]$$.

$$c_n = \dfrac{1}{2\pi}\displaystyle\int_{-\pi}^{\pi}e^{-inx}\cosh x\,dx$$ $$= \dfrac{1}{4\pi}\displaystyle\int_{-\pi}^{\pi}e^{-inx}(e^x+e^{-x})\,dx$$ $$= \dfrac{1}{4\pi}\displaystyle\int_{-\pi}^{\pi}(e^{(1-in)x}+e^{(-1-in)x})\,dx$$

$$= \dfrac{1}{4\pi}\left[\dfrac{e^{(1-in)x}}{1-in} + \dfrac{e^{(-1-in)x}}{-1-in}\right]_{-\pi}^{\pi}$$ $$= \dfrac{1}{4\pi}\left[\dfrac{e^{(1-in)\pi} - e^{-(1-in)\pi}}{1-in} + \dfrac{e^{(-1-in)\pi} - e^{-(-1-in)\pi}}{-1-in}\right]$$

$$= \dfrac{(-1)^n}{4\pi}\left[\dfrac{e^{\pi} - e^{-\pi}}{1-in} + \dfrac{e^{-\pi} - e^{\pi}}{-1-in}\right]$$ $$= \dfrac{(-1)^n\sinh \pi}{2\pi}\left[\dfrac{1}{1-in} - \dfrac{1}{1+in}\right]$$ $$= \dfrac{(-1)^n\sinh \pi}{\pi(n^2+1)}$$.

Therefore, $$f(x) = \cosh x = \displaystyle\sum_{n = -\infty}^{\infty}\dfrac{(-1)^n\sinh \pi}{\pi(n^2+1)}e^{inx}$$.

Thus, $$f(\pi) = \cosh \pi = \displaystyle\sum_{n = -\infty}^{\infty}\dfrac{\sinh \pi}{\pi(n^2+1)}$$, and so, $$\displaystyle\sum_{n = -\infty}^{\infty}\dfrac{1}{n^2+1} = \dfrac{\pi \cosh \pi}{\sinh \pi}$$.

Subtracting the $$n = 0$$ term and dividing by $$2$$ gives: $$\displaystyle\sum_{n = 1}^{\infty}\dfrac{1}{n^2+1} = \dfrac{\pi \cosh \pi}{2\sinh \pi} - \dfrac{1}{2} = \dfrac{\pi}{2}\coth \pi - \dfrac{1}{2}$$.

EDIT: This is essentially what C L. did, except with complex Fourier coefficients instead.

- 4 years, 11 months ago

We both posted the exact same solution at the same time. :D

- 4 years, 11 months ago

Bob's right: the answer reminded me of some Fourier transform computations I did some years back.

Let $$f(x) = \cosh(x)$$ on the interval $$(-\pi, +\pi]$$ and repeated periodically through the real line via $$f(x+2\pi) = f(x)$$. It's continuous and nice enough that its Fourier series converges pointwise.

Convergence of Fourier Transform

Specifically, at the point $$x = \pi$$, the one-sided derivatives exist:

$\lim_{x \to \pi^-} \frac{f(x) - \cosh\pi} {x - \pi} = \sinh\pi, \quad \lim_{x\to \pi^+} \frac{f(x) - \cosh\pi} {x - \pi} = \sinh(-\pi) = -\sinh \pi$

where the second equality follows from $$f(x) = \cosh(x - 2\pi)$$ when x is slightly more than $$2 \pi$$. Furthermore, the one-sided derivatives of $$f(x)$$ have only discrete discontinuities. One can then apply Dini criterion to show that the Fourier series converges.

Computing the Fourier Transform

Omitting the details, the Fourier coefficients of $$f(x)$$ are given by:

\begin{align*} a_n &= \frac 1 \pi \int_{-\pi}^{\pi} f(x)\cos nx dx = \frac 1 \pi \int_{-\pi}^\pi \cosh x \cos nx dx = 2(-1)^n \frac{\sinh \pi}{\pi},\\ b_n &= \frac 1 \pi \int_{-\pi}^{\pi} f(x)\sin nx dx = \frac 1 \pi \int_{-\pi}^\pi \cosh x \sin nx dx = 0.\end{align*}

Thus, the Fourier expansion gives:

\begin{align*} f(x) &= \frac 1 2 a_0 + \sum_{n=1}^\infty (a_n \cos nx + b_n \sin nx). \\ &= \frac{\sinh \pi}\pi \left( 1 + 2\sum_{n=1}^\infty (-1)^n \frac {\cos nx} {n^2 + 1}\right) \end{align*}

Substituting $$x = \pi$$ then gives:

$\cosh \pi = \frac{\sinh \pi}\pi \left( 1 + 2\sum_{n=1}^\infty \frac 1 {n^2 + 1}\right)$

- 4 years, 11 months ago

Here's a shorter way.

Note that $$\cot( x)=\frac{1}{x}+ \sum_{k=1}^{\infty} \frac{2x}{x^2-k^2 \pi^2}$$ (Proof: use infinite product for sine, take natural logs, differentiate, rearrange). Thus,

$$\large \frac{1}{\pi^2} \sum_{k=1}^{\infty} \frac{2x}{\frac{x^2}{\pi^2}-k^2 }=\cot( x)-\frac{1}{x}$$

$$\large \sum_{k=1}^{\infty} \frac{x}{k^2-\frac{x^2}{\pi^2} }=\frac{-\pi^2}{2} \left(\cot( x)-\frac{1}{x}\right)$$

Let $$x=i\pi$$,

$$\large \sum_{k=1}^{\infty} \frac{i \pi}{k^2+1 }=\frac{-\pi^2}{2} \left(\cot( i \pi)-\frac{1}{i \pi}\right)$$

$$\large \sum_{k=1}^{\infty} \frac{1}{k^2+1 }=\frac{i\pi}{2} \left(\cot( i \pi)-\frac{1}{i \pi}\right)$$

$$\large \sum_{k=1}^{\infty} \frac{1}{k^2+1 }=\frac{i\pi}{2} \frac{\cos(i \pi)}{\sin(i \pi)}-\frac{1}{2}$$

$$\large \sum_{k=1}^{\infty} \frac{1}{k^2+1 }=\frac{i\pi}{2} \frac{\cosh( \pi)}{i\sinh( \pi)}-\frac{1}{2}$$

$$\large \sum_{k=1}^{\infty} \frac{1}{k^2+1 }=\frac{\pi}{2} \frac{\cosh( \pi)}{\sinh( \pi)}-\frac{1}{2}$$

- 4 years, 11 months ago

Mathematica gave $$\frac{-1}{2} + \frac{\pi}{2}\coth \pi$$. I know this isn't exactly the point, but sometimes the answer is the best place to start a question like this.

- 4 years, 11 months ago

Is there a systematic way to approach these questions? I've seen Fourier Series solutions before, but they always struck me as most likely discovered by accident. For a simpler example, why would you immediately think to consider the Fourier Series of $$f(x) = |x|$$ if you wanted to find $$\zeta(2)$$?

- 4 years, 11 months ago

The second answer here http://math.stackexchange.com/questions/8337/different-methods-to-compute-sum-limits-n-1-infty-frac1n2 makes the choice much more obvious (albeit it uses the function $$x^2$$, not $$|x|$$, although of course these choices would yield identical results, just square at the end).

- 4 years, 11 months ago

Excellent work, everybody!

- 4 years, 11 months ago