So yeah, these "compute sum by using the Fourier expansion" questions are starting to piss me off somewhat. I feel like If I have 50 of these questions in a row, I can never use the technique learned in one of them to solve the other, so I have to learn 50 new tricks.

My question concerns the same Fourier expansion as this but I should now compute two different sums using it, namely

$$\sum_{n\in\mathbb{N}}\frac{1}{n^2},\tag1$$ $$\sum_{n\in\mathbb{N}}\frac{(-1)^{n+1}}{n^2}.\tag2$$

The Fourier series expansion is as earlier:


My first instinct was to do as suggested in the linked thread, but I reached a dead end quite fast because I could not go from $n^3$ to $n^2$ in the denominator.

My second thought was that maybe I need to apply termwise integration on $(3)$, but that did not work either since it became really messy.

Any further tricks and tips I need here?

  • 1
    $\begingroup$ fourier series for this function $f(x)=x^2$ $\endgroup$ Feb 11, 2019 at 20:48
  • $\begingroup$ What do you mean? $\endgroup$
    – Parseval
    Feb 11, 2019 at 20:53
  • 1
    $\begingroup$ What would happen if you take the derivative with respect to $x$? You would get $n\cos(nx)$ on the right hand side. $\endgroup$
    – Andrei
    Feb 11, 2019 at 20:58
  • $\begingroup$ Where do you even get $f(x)=x^2$ from? The function of concern is $f(x)=x(\pi-|x|).$ $\endgroup$
    – Parseval
    Feb 11, 2019 at 20:58
  • $\begingroup$ This is more fun betterexplained.com/articles/… $\endgroup$ Feb 11, 2019 at 21:02

1 Answer 1


As pointed out by Andrei above we may assume $x>0$ so that our function $f(x)=x(\pi-|x|)$ reduces to $f(x)=x\pi-x^2$. Now differentiate w.r.t. $x,$ which yields

\begin{align*} \frac{\mathrm d}{\mathrm dx}[x\pi-x^2]&=\frac{\mathrm d}{\mathrm dx}\left[\frac4\pi\sum_{n=1}^{\infty}\frac{(-1)^{n+1}+1}{n^3}\sin(nx)\right]\\ \pi-2x&=\frac4\pi\sum_{n=1}^{\infty}\frac{(-1)^{n+1}+1}{n^2}\cos(nx) \end{align*}

Now choose $x=\pi$ to obtain

\begin{align*} \pi-2\pi&=\frac4\pi\sum_{n=1}^{\infty}\frac{(-1)^{n+1}+1}{n^2}\cos(n\pi)\\ -\pi&=\frac4\pi\sum_{n=1}^{\infty}\frac{(-1)^{n+1}+1}{n^2}(-1)^n\\ -\pi&=\frac4\pi\sum_{n=1}^{\infty}\left[\frac{(-1)^n}{n^2}-\frac1{n^2}\right]\\ \pi&=\frac4\pi\sum_{n=1}^{\infty}\left[\frac{(-1)^{n+1}}{n^2}+\frac1{n^2}\right] \end{align*}

Note that the RHS is the sum of the two sums you are asked to find. However, they are related in another way. Therefore observe the following:

$$\sum_{n=1}^\infty \frac{(-1)^{n+1}}{n^2}=\sum_{n=1}^\infty\frac1{n^2}-2\sum_{n=1}^\infty\frac1{(2n)^2}=\frac12\sum_{n=1}^\infty\frac1{n^2}.$$

Using this relation we can rewrite the latter sum from above as


which completes to

$$\pi=\frac4\pi\left[\frac32\sum_{n=1}^{\infty}\frac1{n^2}\right]\implies \sum_{n=1}^{\infty}\frac1{n^2}=\frac{\pi^2}6.$$

Congratulations, you just resolved the famous Basel Problem. However, by using the deduced relation between the two sums we can fairly easy conclude the value of the second one.

$$\therefore~\sum_{n=1}^{\infty}\frac1{n^2}~=~\frac{\pi^2}6\text{ and }\sum_{n=1}^\infty \frac{(-1)^{n+1}}{n^2}~=~\frac{\pi^2}{12}$$

This time we dealt with the Riemann Zeta Function $\zeta(s)$ and the Dirichlet Eta Function $\eta(s)$, showed that $\eta(2)=\frac12\zeta(2)$ as well as $\zeta(2)=\pi^2/6$ and $\eta(2)=\pi^2/12$.

First of all we may write out both sums

\begin{align*} \sum_{n=1}^\infty \frac1{n^2}&=1+\frac1{2^2}+\frac1{3^2}+\frac1{4^2}+\cdots\\ \sum_{n=1}^\infty \frac{(-1)^{n+1}}{n^2}&=1-\frac1{2^2}+\frac1{3^2}-\frac1{4^2}+\cdots \end{align*}

So we obtain the latter sum from the first one by subtracting all even terms not once but twice $($keep the case where we only substract them once in mind, I will come back to this in a minute$)$. However, the even terms are given by $1/(2n)^2$. Therefore we can also write this relation as

$$\sum_{n=1}^\infty \frac{(-1)^{n+1}}{n^2}=\sum_{n=1}^\infty \frac1{n^2}-\color{red}2\sum_{n=1}^\infty \frac1{(2n)^2}$$

What is left now are simple algebraic manipulations. Hence we get that

$$\sum_{n=1}^\infty \frac{(-1)^{n+1}}{n^2}=\sum_{n=1}^\infty \frac1{n^2}-2\sum_{n=1}^\infty \frac1{2^2n^2}=\sum_{n=1}^\infty \frac1{n^2}-\frac24\sum_{n=1}^\infty \frac1{n^2}=\sum_{n=1}^\infty \frac1{n^2}-\frac12\sum_{n=1}^\infty \frac1{n^2}$$

And so we can finally conclude that

$$\sum_{n=1}^\infty \frac{(-1)^{n+1}}{n^2}=\frac12\sum_{n=1}^\infty \frac1{n^2}$$

Now lets take a look at the odd terms alone

\begin{align*} \sum_{n=1}^\infty \frac1{n^2}&=1+\frac1{2^2}+\frac1{3^2}+\frac1{4^2}+\cdots\\ \sum_{n=0}^\infty \frac1{(2n+1)^2}&=1+0+\frac1{3^2}+0+\cdots \end{align*}

Note that is what we get by only substracting the even terms once. This can be written as

$$\sum_{n=0}^\infty \frac1{(2n+1)^2}=\sum_{n=1}^\infty\frac1{n^2}-\color{red}1\sum_{n=1}^\infty \frac1{(2n)^2}$$

Again this can be further simplied which eventually gives us

$$\sum_{n=0}^\infty \frac1{(2n+1)^2}=\sum_{n=1}^\infty \frac1{n^2}-1\sum_{n=1}^\infty \frac1{2^2n^2}=\sum_{n=1}^\infty \frac1{n^2}-\frac14\sum_{n=1}^\infty \frac1{n^2}$$


$$\sum_{n=0}^\infty \frac1{(2n+1)^2}=\frac34\sum_{n=1}^\infty \frac1{n^2}$$ The latter sums is known as Dirichlet Lambda Function $\lambda(s)$ and we just showed the relation $\lambda(2)=\frac34\zeta(2)$. However, the second example is only here to illustrate how one can argue in order to produce such relation betweens different series.

Moreover note that the results from above can generalised as

\begin{align*} \eta(s)&=(1-2^{1-s})\zeta(s)\\ \lambda(s)&=(1-2^{-s})\zeta(s) \end{align*}

I would recommend to you to actually prove these relations by using the series representations to get used to these kinds of manipulations. Additionally the Riemann Zeta Function, and its relatives, are yet alone worth being studied. Hopefully now everthing is clear; if not: feel free to ask.

  • $\begingroup$ I don't understand what you did to split upp the sum $$\sum_{n=1}^{\infty}\frac{(-1)^{n+1}}{n^2}.$$ Did you first assume that $n$ is odd and then $n$ is even and combined them? $\endgroup$
    – Parseval
    Feb 12, 2019 at 12:29
  • 1
    $\begingroup$ @Parseval More or less. I will edit my answer to elaborate on this issue. $\endgroup$
    – mrtaurho
    Feb 12, 2019 at 12:32
  • $\begingroup$ @Parseval Hopefully the additional details can clear your doubts. $\endgroup$
    – mrtaurho
    Feb 12, 2019 at 13:29
  • 1
    $\begingroup$ My humble personage bows before your grandeur. Thank you. $\endgroup$
    – Parseval
    Feb 12, 2019 at 13:59
  • 2
    $\begingroup$ @Parseval I am glad that I could help thee ^^ $\endgroup$
    – mrtaurho
    Feb 12, 2019 at 14:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .