15

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?

7 Answers7

15

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}$$

Then

$$\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.

Ron Gordon
  • 138,521
  • 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 05 '13 at 07:27
  • 1
    @zibadawatimmy: right on all counts (although I'll leave the judgment about it being cool to you and others). – Ron Gordon Nov 05 '13 at 07:28
11

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 its 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.

Marko Riedel
  • 61,317
  • Interesting. But, in the contour integral, the term $\cos(\pi s/2)$ diverges exponentially for large imaginary part. – senator Apr 11 '19 at 05:14
7

From here we have

$$\sum_{n=1}^{\infty}\frac{\sin nx}{n}=\frac{\pi-x}{2}\quad (0<x<2\pi)$$

Integrate both sides with respect to $x$

$$-\sum_{n=1}^{\infty}\frac{\cos nx}{n^2}=\frac{\pi x}{2}-\frac{x^2}{4}+C$$

Set $x=0\Longrightarrow C=-\zeta(2)=-\frac{\large \pi^2}{6}$

Giving us

$$\sum_{n=1}^{\infty}\frac{\cos(nx)}{n^2}=\frac{x^2}{4}-\frac{\pi x}{2}+\frac{\pi^2}{6}$$

Ali Shadhar
  • 25,498
5

$\newcommand{\bbx}[1]{\,\bbox[8px,border:1px groove navy]{\displaystyle{#1}}\,} \newcommand{\braces}[1]{\left\lbrace\,{#1}\,\right\rbrace} \newcommand{\bracks}[1]{\left\lbrack\,{#1}\,\right\rbrack} \newcommand{\dd}{\mathrm{d}} \newcommand{\ds}[1]{\displaystyle{#1}} \newcommand{\expo}[1]{\,\mathrm{e}^{#1}\,} \newcommand{\ic}{\mathrm{i}} \newcommand{\mc}[1]{\mathcal{#1}} \newcommand{\mrm}[1]{\mathrm{#1}} \newcommand{\pars}[1]{\left(\,{#1}\,\right)} \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}} \newcommand{\root}[2][]{\,\sqrt[#1]{\,{#2}\,}\,} \newcommand{\totald}[3][]{\frac{\mathrm{d}^{#1} #2}{\mathrm{d} #3^{#1}}} \newcommand{\verts}[1]{\left\vert\,{#1}\,\right\vert}$ \begin{align} \sum_{n = 1}^{\infty}{\cos\pars{nx} \over n^{2}} & = \Re\sum_{n = 1}^{\infty}{\pars{\expo{\ic x}}^{n} \over n^{2}} = \Re\,\mrm{Li}_{2}\pars{\exp\pars{2\pi\ic\,{x \over 2\pi}}} \\[5mm] & = -\,{1 \over 2}\,{\pars{2\pi\ic}^{2} \over 2!}\,\mrm{B}_{2}\pars{x \over 2\pi} \label{1}\tag{1} \end{align} where we used Jonquiere Inversion Formula. $\ds{\,\mrm{B}_{n}\pars{x}}$ is a Bernoulli Polynomial. $\ds{\,\mrm{B}_{2}\pars{x} = x^{2} - x + {1 \over 6}}$


\eqref{1} becomes: $$ \bbx{\ds{% \sum_{n = 1}^{\infty}{\cos\pars{nx} \over n^{2}} = {x^{2} \over 4} - {\pi x \over 2} + {\pi^{2} \over 6}}}\,,\quad \left\{\begin{array}{rcl} \ds{x \in \left[0,2\pi\right)} & \mbox{if} & \ds{\Im\pars{x} \geq 0} \\[2mm] \ds{x \in \left(0,2\pi\right]} & \mbox{if} & \ds{\Im\pars{x} < 0}\\ & \end{array}\right. $$
Felix Marin
  • 89,464
2

Here there is a way using Fourier series. Consider the orthonormal basis of $L^{2}([0,2\pi])$, given by the functions $$ e_{n}(x) = \frac{1}{\sqrt{2\pi}} e^{-i n x}, \quad n \in \mathbb{Z}. $$

Since for $x \in [0,2\pi]$ the indicator function $\mathbf{1}_{[0,x]}$ is in $L^{2}([0,2\pi])$, it can be expressed in its development in the basis $(e_{n})_{n}$. If we denote $(f,g)$ the dot-product of two functions $f,g$ in $L^{2}([0,2\pi])$, that is $$(f,g) = \int_{[0,2\pi]}f(x)\overline{g(x)}dx,$$ then we have $$ x = (\mathbf{1}_{[0,x]} , \mathbf{1}_{[0,x]} ) = \sum_{n \in \mathbb{Z}} ( \mathbf{1}_{[0,x]} , e_{n} ) ( e_{n} , \mathbf{1}_{[0,x]}) = \sum_{n \in \mathbb{Z}} |( \mathbf{1}_{[0,x]} , e_{n} )|^{2}. $$ The rest is just computing integrals and separating absolutely convergence series. We have $$(\mathbf{1}_{[0,x]} , e_{n} ) = \frac{1}{\sqrt{2\pi}}\int_{0}^{x}e^{iny}dy = \begin{cases} \frac{e^{inx} - 1}{\sqrt{2\pi} ni} & n \neq 0, \\ \frac{x}{\sqrt{2\pi}} & n = 0. \end{cases} $$ Hence, $$ x = \frac{x^{2}}{2\pi} + \frac{1}{2\pi}\sum_{\substack{n \in \mathbb{Z} \\ n \neq 0}} \frac{2-2\cos(nx)}{n^2}. $$ Using symetric arguments ($ \frac{2-2\cos(nx)}{n^2} = \frac{2-2\cos(-nx)}{(-n)^2}$), we obtain $$ x = \frac{x^{2}}{2\pi} + \frac{2}{\pi}\sum_{n=1}^{\infty} \frac{1}{n^{2}} - \frac{2}{\pi}\sum_{n=1}^{\infty}\frac{\cos(nx)}{n^{2}} = \frac{x^{2}}{2\pi} + \frac{\pi}{3} - \frac{2}{\pi}\sum_{n=1}^{\infty}\frac{\cos(nx)}{n^{2}}, $$ from where we finally obtain $$ \sum_{n=1}^{\infty}\frac{\cos(nx)}{n^{2}} = \frac{x^{2}}{4} - \frac{\pi x}{2} + \frac{\pi^{2}}{6}. $$

Outside the interval, just use the periodicity of $\cos$.

CarrizoV
  • 150
2

Here's one solution without Fourier series.

Let's first evaluate

$$f(t)=\sum_{n=1}^\infty \frac{e^{-nt}\cos(nx)}{n} = \frac{1}{2}\sum_{n=1}^\infty \frac{e^{n(-t+ix)}+e^{n(-t-ix)}}{n}=-\frac{1}{2}\left[\ln(1-e^{-x+i\theta})+\ln(1-e^{-x-i\theta})\right],$$ where we used $\cos x = \frac{e^{ix}+e^{-ix}}{2}$ and $\ln(1-x) = -\sum_{n=1}^\infty \frac{x^n}{n}$. Multiplying the arguments of the logarithms, we obtain

$$f(t) = -\frac{1}{2}\ln\left(1-2\cos x e^{-t}+e^{-2t}\right).$$

Now we integrate both sides from $0$ to $\infty$:

$$\int_0^\infty f(t)dt = \sum_{n=1}^\infty\frac{\cos(nx)}{n^2} = -\frac{1}{2}\int_0^\infty \ln\left(1-2\cos x e^{-t}+e^{-2t}\right)dt .$$

The integral can be evaluated using differentiation under the integral sign. It's easiest to consider:

$$I(\alpha) = \int_0^\infty \ln(1+\alpha e^{-x}+e^{-2x})dx.$$

This can be evaluated by first calculating $\frac{dI}{d\alpha}$, and determining the integration constant with $I(2)=4I(0)$. Details can be found here. The answer is

$$ I(\alpha) = -\frac{1}{2}\arccos\left(\frac{\alpha}{2}\right)^2+\frac{\pi^2}{6}.$$

In our case, we have $\alpha=-2\cos x=2\cos(\pi-x)$, so we may write

$$ \sum_{n=1}^\infty \frac{\cos(nx)}{n^2} = \frac{(\pi-x)^2}{4}-\frac{\pi^2}{12}= \frac{x^2}{4}-\frac{\pi x}{2}+\frac{\pi^2}{6}.$$

Gary
  • 31,845
0

Another way to solve this is by finding the fourier series of x^2, then solving for (x+pi)^2 with the cosine addition formula.

Satin
  • 1