# Expand $\cos(x)$ in odd Fourier series.

Expand $$\cos(x)$$ in sinus-series in the interval $$(0,\pi/2)$$ and use the result to calculate $$\sum_{n=1}^{\infty}\frac{n^2}{(4n^2-1)^2}.$$

Since we only need the odd terms in the Fourier expansion, we know that $$a_n=0$$, so we only need $$b_n$$ in order to find the sine expansion.

In my book, there is a chapter on "Fourier series on intervals", and there they state that:

If $$f$$ is a piecewise smooth function on $$[0,l]$$, then the Fourier sine expansion is given by

$$f(x)=\sum_{n=1}^{\infty}b_n\sin\left(\frac{\pi n x}{l}\right),\tag{1}$$

where

$$b_n=\frac{2}{l}\int\limits_{0}^{l}f(x)\sin\left(\frac{\pi n x}{l}\right).\tag{2}$$

So we should be able to use only $$(1)$$ and $$(2)$$ with $$l=\pi/2$$ to solve this problem. So

\begin{align} b_n=\frac{4}{\pi}\int\limits_{0}^{\pi/2}\cos(x)\sin(2nx)dx = \frac{4(\sin(\pi n)-2n)}{\pi(1-4n^2)}\tag{3}. \end{align}

This gives

$$\cos(x)=\frac{8}{\pi}\sum_{n=1}^{\infty}\frac{n}{4n^2-1}\sin(2nx), \quad \forall \ n\in\mathbb{N}\tag{4}$$

2 questions remain:

1. I used wolfram alpha to calculate the integral in $$(3)$$. What methods do I use to do this? Repeated integration by parts and solve for the integral?
2. How do I calculate the desired sum?
• The function to expand is probably not the regular $\cos$. Instead, consider the function that coincides with $\cos$ on $(0, \frac \pi 2)$, that is odd and is $\pi$ periodic. – Stefan Lafon Jan 25 at 16:30
• But they explicitly state that I'm to expand $\cos(x)$. So I am pretty convinced that $\cos(x)$ is the regular cos that is to be expanded. I might have misunderstood your comment. – Parseval Jan 25 at 17:30

As posted by the OP, two steps remain:

1. Perform the integral:

$$b_n=\frac{4}{\pi}\int\limits_{0}^{\pi/2}\cos(x)\sin(2nx)dx \\ = \frac{1}{i \pi}\int\limits_{0}^{\pi/2}e^{ix(1+2n)}- e^{ix(1-2n)}+e^{-ix(1-2n)}-e^{-ix(1+2n)}dx \\ = \frac{1}{i \pi} \left(\frac{e^{ix(1+2n)}}{i(1+2n)}|_{0}^{\pi/2} - \frac{e^{ix(1-2n)}}{i(1-2n)}|_{0}^{\pi/2} + \frac{e^{-ix(1-2n)}}{-i(1-2n)}|_{0}^{\pi/2} -\frac{e^{-ix(1+2n)}}{-i(1+2n)}|_{0}^{\pi/2} \right)\\ = \frac{1}{i \pi} \left(\frac{i(-1)^n - 1}{i(1+2n)} - \frac{i(-1)^n - 1}{i(1-2n)} + \frac{-i(-1)^n - 1}{-i(1-2n)} - \frac{-i(-1)^n - 1}{-i(1+2n)} \right)\\ = \frac{1}{- \pi (1 - 4 n^2)} \left( -4n(i(-1)^n - 1) - 4n (-i(-1)^n - 1) \right)\\ = \frac{-8n}{\pi(1-4n^2)} \\ = \frac{4(\sin(\pi n)-2n)}{\pi(1-4n^2)}$$ where the last step only indicates the "desired" solution by WolframAlpha, where anyway $$\sin(\pi n) = 0$$ .

2 Calculating the desired sum.

From OP's last result, $$\cos(x)=\frac{8}{\pi}\sum_{n=1}^{\infty}\frac{n}{4n^2-1}\sin(2nx),$$ multiply this formula with $$\cos(x)$$ and integrate, using the integral which was just derived:

$$\frac{\pi}{4} = \int\limits_{0}^{\pi/2}\cos^2(x) dx = \frac{8}{\pi} \sum_{n=1}^\infty \frac{n}{4n^2 -1} \int\limits_{0}^{\pi/2}\cos(x)\cdot\sin(2nx) dx = \\ \frac{8}{\pi} \sum_{n=1}^\infty \frac{n}{4n^2 -1} \cdot \frac{2 n}{4n^2 -1}\\ = \frac{16}{\pi} \sum_{n=1}^\infty \frac{n^2}{(4n^2 -1)^2}$$ so finally

$$\sum_{n=1}^\infty \frac{n^2}{(4n^2 -1)^2} = \frac{\pi^2}{64}$$

• Wonderful, thanks a lot! – Parseval Jan 28 at 12:46

Consider the function $$f(x) = \cos(x) \cdot {\rm{sign}}(x)$$ in the interval $$(-\pi, \pi)$$. This function is identical to $$\cos(x)$$ in the interval $$(0, \pi/2)$$ so the expansion will be correct in that interval.

You want $$f(x) = \sum_{m=1}^\infty b_m \sin(mx)$$.

Integrating with $$\sin(nx)$$ gives

$$\int\limits_{-\pi}^{\pi}\sin( n x)\sin(nx)dx = \pi$$ $$\int\limits_{-\pi}^{\pi}\sin( m x)\sin(nx)dx = 0 \quad (m\ne n)$$ and

$$\int\limits_{-\pi}^{\pi}\cos(x)\cdot {\rm{sign}}(x) \cdot \sin(nx)dx = 2 \int\limits_{0}^{\pi}\cos(x)\cdot \sin(nx)dx = 2 \frac{n (1+\cos(\pi n))}{n^2 - 1} \tag{*}$$

So you have $$\cos(x) = \frac{2}{\pi} \sum_{n=1}^\infty \frac{n (1+\cos(\pi n))}{n^2 - 1} \sin(nx)$$ where the coefficients are nonzero for even n.

Substituting $$n$$ with $$2 m$$ gives $$\cos(x) = \frac{8}{\pi} \sum_{m=1}^\infty \frac{m}{4m^2 -1} \sin(2 m x)$$

No use the integral in (*) again: multiply the last formula with $$\cos(x)$$ and integrate:

$$\frac{\pi}{2} = \int\limits_{0}^{\pi}\cos^2(x) dx = \frac{8}{\pi} \sum_{m=1}^\infty \frac{m}{4m^2 -1} \int\limits_{0}^{\pi}\cos(x)\cdot\sin(2mx) dx = \frac{32}{\pi} \sum_{m=1}^\infty \frac{m^2}{(4m^2 -1)^2}$$ so finally

$$\sum_{m=1}^\infty \frac{m^2}{(4m^2 -1)^2} = \frac{\pi^2}{64}$$

• Thanks for a nice solution and I'll give you an upvote. However this answer fails to provide an answer that aids in helping me to understand my mistake. I'd rather learn where I went wrong in my own attempt then see a customized soluton that would only work for this particular problem. For example, I've never had to deal with the $sgn(x)$ function and there is not a single example in the book where they use a method like this to solve a similar problem. This problem is solveable using standard given formulae and I want to know why it did not work this time. – Parseval Jan 25 at 19:29
• If you want it without that symmetry condition, you would have to set $\cos(x) = \sum_{m=1}^\infty b_m \sin(2mx)$ which we know (in hindsight) from the solution above. It is not clear to me a priori that the odd terms $\sin((2m+1)x)$ should not be present in the series at all - do you have an argument? Then, you can integrate $\int_0^{\pi/2} \sin(2mx) \sin(2nx) dx = 0$ for $m \ne n$ and everything works as above. (continued) – Andreas Jan 25 at 19:59
• (continued) The point is that in general, $\int_0^{\pi/2} \sin(mx) \sin(nx) dx$ is not zero and therefore the calculation of the coefficients does not work straightforward if you cannot exclude the odd values of m right from the start. – Andreas Jan 25 at 19:59
• I've been working on this problem a bit further now, I'll edit the answer and show you what I mean by applying the formulas straight on. Stand by. – Parseval Jan 25 at 20:52
• Please see my edit now Andreas. Thanks for the time and effort you put in, I apreciate it. Oh and the answer $\pi^2/64$ is indeed correct. – Parseval Jan 25 at 21:13