# Develop $x\sin(x)$ into a specific series

I have to find a series that in $0\leq x\leq \pi$: $$x\sin(x) = \sum_{n=0}^{\infty} a_n\sin(2nx)$$ It seems to be impossible because on $x=\pi/2$ we get $\pi/2 = 0$. However I tried to do it (as part of another exercise which apparentelly I'm on the wrong path), just as we do in classical Fourier:

$$\int_{0}^{\pi} x\sin(x)\cdot\sin(2mx) dx = \sum_{n=0}^{\infty}a_n\int_{0}^{\pi} \sin(2nx)\cdot\sin(2mx) dx$$

I could solve it and find that $$a_n = \dfrac{-16n}{\pi(2n-1)^2 (2n+1)^2}$$ which is of course a wrong solution.

At what stage I was wrong? Is it somehow possible to develop a series (even without $\pi/2$)?

• Note that the convergence of the fourier series is only guaranteed with respect to the L2-norm, it does not have to be pointwise convergent. – user159517 Dec 25 '15 at 14:05
• This is not possible as stated, note that $\sin(2n(\pi-x)) = -\sin(2nx)$, so the sum above is odd when reflected in $\pi/2$ and this is not true for $x\sin(x)$ – mlu Dec 25 '15 at 15:20

Hint:

As I said in the comments already, it is important to realize that fourier theory does not give you pointwise convergence of the series, only L2-convergence. Therefore it is not a contradction that the fourier series at $x = \pi/2$ does not agree with the function. Note that the functions $\sin(2nx)$, $n \in \mathbb{N}$ are not an orthonormal basis of $L^{2}(0,\pi)$, wich means that

$$\int_{0}^{\pi} x\sin(x)\cdot\sin(2mx) dx = \sum_{n=0}^{\infty}a_n\int_{0}^{\pi} \sin(2nx)\cdot\sin(2mx) dx$$

does not imply

$$a_{n} = \int_{0}^{\pi} x\sin(x)\sin(2nx)\; dx.$$

Now, to solve the problem: Use classical fourier theory to find coeffcients $a_{n}, n\in\mathbb{Z}$ such that $$\frac{x}{2}\sin\left(\frac{x}{2}\right) = \sum_{n\in\mathbb{Z}} \hat a_{n} \sin(nx)\quad \text{in} \; L^2(0,2\pi).$$ You can then easily find coefficients $a_{n}$ for $n\in \mathbb{N}$ such that $$\frac{x}{2}\sin\left(\frac{x}{2}\right) = \sum_{n=0}^{\infty} a_{n} \sin(nx), \quad \text{in}\; L^{2}(0,2\pi)$$ holds.

Now, for $N \in \mathbb{N}$ we can substitute $u = x/2$ to obtain

$$\int_{0}^{2\pi}\left|\frac{x}{2}\sin\left(\frac{x}{2}\right) - \sum_{n=0}^{N} a_{n} \sin(nx) \right|^2\;dx = 2\int_{0}^{\pi} \left|u\sin\left(u\right) - \sum_{n=0}^{N} a_{n} \sin(2nu) \right|^2\;du$$

For $N \to \infty$, the left hand side goes to $0$, so the right hand side must go to $0$ as well and we see that the coefficents $a_{n}$ solve the problem.

Let us first find Fourier series with complex coefficients. If $$f(x) = \sum_{\nu = -\infty}^{\infty} \alpha_\nu e^{i\nu x}$$ then $$\alpha_\nu = \frac{1}{2\pi}\int_{-\pi}^\pi f(x)e^{-i\nu x}dx$$ For $f(x) = x\sin x$, $$\alpha_\nu = \frac{1}{4\pi i}\left(\int_{-\pi}^\pi xe^{i(1 - \nu)x}dx - \int_{-\pi}^\pi xe^{-i(1 + \nu)x}dx\right)$$ If $\nu = \pm 1$, $\alpha_\nu = 0$. For $\nu \ne \pm 1$, $$\alpha_\nu = \frac{i\nu\cos(\pi\nu)}{\nu^2 - 1}$$ If $f$ is expanded as $$f(x) = \frac{a_0}{2} + \sum_{\nu = 1}\left(a_\nu\cos(\nu x) + b_\nu\sin(\nu x)\right)$$ Then $2a_\nu = \alpha_\nu + \alpha_{-\nu}$ and $2b_\nu = i(\alpha_\nu + \alpha_{-\nu})$. Thus $a_\nu = 0$ and $$b_\nu = -\frac{2\nu}{\nu^2 - 1}\cos(\pi\nu) \text{ if } \nu > 1$$ Additionally, $b_0, b_1 = 0$. Therefore, $$x\sin x = -\sum_{\nu = 2}^\infty \frac{2\nu}{\nu^2 - 1}\cos(\pi\nu)\sin(\nu x)$$

• LHS is real and RHS is purely imaginary. – mlu Dec 25 '15 at 15:40
• Thansks @mlu, corrected the calculations. – Amey Joshi Dec 25 '15 at 15:48

We can develop $x \sin(x)$ into a series for $0 \leq x \leq \pi$

$$x \sin(x) = 1-\sum_{n=1}^{\infty} \frac{2 }{4n^2-1}\cos \left( 2n x \right)-\sum_{n=1}^{\infty}\frac{16\ n}{\pi \left( 16n^4-8n^2+1 \right)}\sin \left(2nx\right)$$