Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is it true that for $x\in[0,2\pi]$ we have $$\sum_{n=1}^{\infty}\frac{\cos(nx)}{n^2}=\frac{x^2}{4}-\frac{\pi x}{2}+\frac{\pi^2}{6}$$ How can I prove it? For other intervals what is the value of above series if is convergent?

share|cite|improve this question
For convergence, note that $|\cos(x)|\le 1$. – Argon Nov 5 '13 at 22:02
This is a special case of a prominent infinite sum. For more on this see this link (the link only brings you to page 300 - skip to 307,308,309). It's in german but the formulas are still enjoyable. – Peter Sheldrick Nov 5 '13 at 22:07
Show that the left side is the Fourier series of the right side on an appropriate interval. – GEdgar Nov 5 '13 at 22:34
How can a sum of even functions not be even? – Igor Rivin Jul 2 at 20:19
up vote 5 down vote accepted

The sum term $$T(x) = \sum_{n\ge 1}\frac{\cos(nx)}{n^2} = x^2 \sum_{n\ge 1}\frac{\cos(nx)}{(xn)^2}$$ is harmonic and may be evaluated by inverting it's Mellin transform. Put $$S(x) = \sum_{n\ge 1}\frac{\cos(nx)}{(xn)^2}$$ and recall the harmonic sum identity $$\mathfrak{M}\left(\sum_{k\ge 1} \lambda_k g(\mu_k x);s\right) = \left(\sum_{k\ge 1} \frac{\lambda_k}{\mu_k^s} \right) g^*(s)$$ where $g^*(s)$ is the Mellin transform of $g(x).$

In the present case we have $$\lambda_k = 1, \quad \mu_k = k \quad \text{and} \quad g(x) = \frac{\cos x}{x^2}.$$ We need the Mellin transform $g^*(s)$ of $g(x)$ which is $$\int_0^\infty \frac{\cos x}{x^2} x^{s-1} dx = \int_0^\infty \cos x \times x^{(s-2)-1} dx.$$ Now the Mellin transform of $\cos(x)$ was computed at this MSE link and found to be $$\Gamma(s) \cos(\pi s/2)$$ and therefore $$g^*(s) = \Gamma(s-2) \cos(\pi (s-2)/2) = \Gamma(s-2) \cos(\pi s/2 - \pi) = -\Gamma(s-2) \cos(\pi s/2).$$ Therefore the Mellin transform $Q(s)$ of $S(x)$ is given by $$ Q(s) = -\Gamma(s-2) \cos(\pi s/2) \zeta(s) \quad\text{because}\quad \sum_{k\ge 1} \frac{\lambda_k}{\mu_k^s} = \zeta(s).$$ Therefore the Mellin inversion integral for an expansion about zero is $$\frac{1}{2\pi i} \int_{5/2-i\infty}^{5/2+i\infty} Q(s)/x^s ds$$ which we evaluate in the left half-plane $\Re(s)<5/2.$ The cosine term cancels the poles of the gamma function term at odd negative integers and the zeta function term the poles at even negative integers. We are left with just three poles. $$\begin{align} \mathrm{Res}(Q(s)/x^s; x=2) & = \frac{\pi^2}{6x^2} \\ \mathrm{Res}(Q(s)/x^s; x=1) & = -\frac{\pi}{2x} \quad\text{and}\\ \mathrm{Res}(Q(s)/x^s; x=0) & = \frac{1}{4}. \end{align}$$ Hence in a neighborhood of zero, $$S(x) = \frac{\pi^2}{6x^2} -\frac{\pi}{2x} +\frac{1}{4}.$$ Using $T(x) = x^2 S(x)$ this finally yields in a neigborhood of zero that $$T(x) = \frac{\pi^2}{6} -x\frac{\pi}{2} +x^2\frac{1}{4}.$$ Since $T(x)$ is periodic with period $2\pi$ the interval this approximation is good in $(0,2\pi).$

There is a theorem hiding here, namely that certain Fourier series can be evaluated by inverting their Mellin transforms which is not terribly surprising and which the reader is invited to state and prove.

share|cite|improve this answer

See the results posted here, where I show that

$$\sum_{n=-\infty}^{\infty} \frac{\sin^2{a n}}{n^2} = \pi a$$

when $a \in (0,\pi)$. Now, use the fact that

$$\sum_{n=1}^{\infty} \frac{1}{n^2} = \frac{\pi^2}{6}$$

and let $S$ be the sum in question. Then

$$\frac{\pi^2}{6} - S = \sum_{n=1}^{\infty} \frac{1-\cos{n x}}{n^2} = 2 \sum_{n=1}^{\infty} \frac{\sin^2{n x/2}}{n^2}$$

Rewrite the last sum as

$$2 \sum_{n=1}^{\infty} \frac{\sin^2{n x/2}}{n^2} = \sum_{n=-\infty}^{\infty} \frac{\sin^2{n x/2}}{n^2} - \left ( \frac{x}{2} \right )^2 = \pi \frac{x}{2} - \frac{x^2}{4}$$


$$\frac{\pi^2}{6} - S = \pi \frac{x}{2} - \frac{x^2}{4} \implies S = \frac{x^2}{4} - \pi \frac{x}{2} + \frac{\pi^2}{6}$$

as was to be shown.

share|cite|improve this answer
That's pretty cool. As for the part that asked about extending it to other intervals, you just extend by periodicity. And convergence is easy to verify even without knowing the formula, as you can use comparison test with $\sum 1/n^2$. – zibadawa timmy Nov 5 '13 at 7:27
@zibadawatimmy: right on all counts (although I'll leave the judgment about it being cool to you and others). – Ron Gordon Nov 5 '13 at 7:28

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.