# Solving $f''+f=\sin x$ with Fourier series

Does there exist a twice differentiable periodic function $f$ such that $f''(x) + f(x) =\sin(x)$ for all $x \in [-\pi, \pi]$?

How to solve this differential equation using Fourier series? I know only basics of Fourier analysis. I don`t know any inversion formula for Fourier series.

-
I guess it is more appropriate to use the Laplace Transform here, rather than Fourier's. –  Pedro Tamaroff Apr 17 '12 at 0:48

The solution would be:

$$f(x) = -\frac{1}{2}x \cos(x) + C_1\sin(x) + C_2\cos(x)$$

Where the $C_1\sin(x) + C_2\cos(x)$ part is the solution to the homogeneous equation. Using Fourier Series naively, one runs into problems due to the $n = 1$ term having no solution.

-
This shows in particular that there is no periodic solution. It would be nice to have an a priori proof of this fact. –  Christian Blatter Apr 12 '12 at 11:35
@ChristianBlatter, This is common for forced oscillator problems. In fact, some authors (page 87) explicitly tell you to use a Fourier series multiplied by x in cases like these. –  nbubis Apr 12 '12 at 15:52

I'm lazy and don't feel like giving you the complete answer, but here is an approach you can take.

Take the Fourier transform of both sides: $F'' + F' = T[\sin(x)]$

Fourier transforms differentiate easily:

$$F' = ik\cdot F$$ and $$F'' = -k^2\cdot F$$

So, then solve for $F$: $$F = \frac{T[\sin(x)]} {ik-k^2}$$

Then, take the inverse transform:

$$f = T^{-1}\left[\frac{T[\sin(x)]}{ik-k^2}\right]$$

You can solve the right-hand side either by looking up the transforms, or using integration by parts.

-
The equation is $f''(x)+f(x)=\sin(x)$, not $f''(x)+f'(x)=\sin(x)$. I would at least try this before posting on it. The Fourier coefficients for $\sin(x)$ are non-zero exactly when $1-k^2=0$. This makes this approach problematic, at best. –  robjohn Apr 12 '12 at 19:52

nbubis mentions that Fourier Series might not be the best method.

Suppose that $f$ has a Fourier Series: $$f(x)=\sum_{k=-\infty}^\infty a_ke^{ikx}\tag{1}$$ Then $$f''(x)+f(x)=\sin(x)\tag{2}$$ implies $$\sum_{k=-\infty}^\infty a_k(1-k^2)e^{ikx}=\sin(x)=\frac{1}{2i}\left(e^{ix}-e^{-ix}\right)\tag{3}$$ However, integrating $(3)$ against $\frac{1}{2\pi}e^{-ikx}$ to get $a_k$, gives $a_k=0$ except for $k\in\{-1,1\}$. Equation $(3)$ says that $a_{-1}\cdot0=-\frac{1}{2i}$ and $a_1\cdot0=\frac{1}{2i}$. This leads one to conclude that there is no solution to $(2)$ which has a Fourier series.

-
Actually, the solution does have a Fourier series, you just can't arrive at it using your method. The series is: $$\frac{1}{4}\sin(x) + \sum_{n = 2 }^{\infty}{\frac{(-1)^{n+1}}{n^2-1}\sin(nx)}$$ –  nbubis Apr 13 '12 at 0:35
@nbubis: I think you meant $$\frac{1}{4}\sin(x)+\sum_{n=2}^{\infty}{\frac{(-1)^{n+1}n}{n^2-1}\sin(nx)}$$ In any case, that is the Fourier series of the solution to $$f''(x)+f(x)=\sin(x)\tag{2}$$ on $\mathbb{R}$, restricted to $(-\pi,\pi)$. The resulting periodic function is not continuous (much less differentiable) at odd multiples of $\pi$, so it does not satisfy $(2)$ at odd multiples of $\pi$. –  robjohn Apr 13 '12 at 1:31