# 4.5: Applications of Fourier series


## Periodically Forced Oscillation

Let us return to the forced oscillations. Consider a mass-spring system as before, where we have a mass $$m$$ on a spring with spring constant $$k$$, with damping $$c$$, and a force $$F(t)$$ applied to the mass. Suppose the forcing function $$F(t)$$ is $$2L$$-periodic for some $$L>0$$. We have already seen this problem in chapter 2 with a simple $$F(t)$$.

The equation that governs this particular setup is

$\label{eq:1} mx''(t)+cx'(t)+kx(t)=F(t).$

The general solution consists of $$\eqref{eq:1}$$ consists of the complementary solution $$x_c$$, which solves the associated homogeneous equation $$mx''+cx'+kx=0$$, and a particular solution of Equation $$\eqref{eq:1}$$ we call $$x_p$$. For $$c>0$$, the complementary solution $$x_c$$ will decay as time goes by. Therefore, we are mostly interested in a particular solution $$x_p$$ that does not decay and is periodic with the same period as $$F(t)$$. We call this particular solution the steady periodic solution and we write it as $$x_{sp}$$ as before. What will be new in this section is that we consider an arbitrary forcing function $$F(t)$$ instead of a simple cosine.

For simplicity, let us suppose that $$c=0$$. The problem with $$c>0$$ is very similar. The equation

$mx''+kx=0 \nonumber$

has the general solution

$x(t)= A \cos(\omega_0 t)+ B \sin(\omega_0 t), \nonumber$

where $$\omega_0= \sqrt{\dfrac{k}{m}}$$. Any solution to $$mx''(t)+kx(t)=F(t)$$ is of the form $$A \cos(\omega_0 t)+ B \sin(\omega_0 t)+x_{sp}$$. The steady periodic solution $$x_{sp}$$ has the same period as $$F(t)$$.

In the spirit of the last section and the idea of undetermined coefficients we first write

$F(t)= \dfrac{c_0}{2}+ \sum^{\infty}_{n=1} c_n \cos \left(\dfrac{n \pi}{L}t \right)+ d_n \sin \left(\dfrac{n \pi}{L}t \right). \nonumber$

Then we write a proposed steady periodic solution $$x$$ as

$x(t)= \dfrac{a_0}{2}+ \sum^{\infty}_{n=1} a_n \cos \left(\dfrac{n \pi}{L}t \right)+ b_n \sin \left(\dfrac{n \pi}{L}t \right), \nonumber$

where $$a_n$$ and $$b_n$$ are unknowns. We plug $$x$$ into the differential equation and solve for $$a_n$$ and $$b_n$$ in terms of $$c_n$$ and $$d_n$$. This process is perhaps best understood by example.

##### Example $$\PageIndex{1}$$

Suppose that $$k=2$$, and $$m=1$$. The units are again the mks units (meters-kilograms-seconds). There is a jetpack strapped to the mass, which fires with a force of 1 newton for 1 second and then is off for 1 second, and so on. We want to find the steady periodic solution.

Solution

The equation is, therefore,

$x''+2x=F(t), \nonumber$

where $$F(t)$$ is the step function

$F(t)= \left\{ \begin{array}{ccc} 0 & {\rm{if}} & -1<t<0, \\ 1 & {\rm{if}} & 0<t<1, \end{array} \right. \nonumber$

extended periodically. We write

$F(t)= \dfrac{c_0}{2}+ \sum^{\infty}_{n=1} c_n \cos(n \pi t)+ d_n \sin(n \pi t). \nonumber$

We compute

\begin{align}\begin{aligned} c_n &= \int^1_{-1} F(t) \cos(n \pi t)dt= \int^1_{0} \cos(n \pi t)dt= 0 ~~~~~ {\rm{for}}~ n \geq 1, \\ c_0 &= \int^1_{-1} F(t) dt= \int^1_{0} dt=1, \\ d_n &= \int^1_{-1} F(t) \sin(n \pi t)dt \\ &= \int^1_{0} \sin(n \pi t)dt \\ &= \left[ \dfrac{- \cos(n \pi t)}{n \pi}\right]^1_{t=0} \\ &= \dfrac{1-(-1)^n}{\pi n}= \left\{ \begin{array}{ccc} \dfrac{2}{\pi n} & {\rm{if~}} n {\rm{~odd}}, \\ 0 & {\rm{if~}} n {\rm{~even}}. \end{array} \right.\end{aligned}\end{align} \nonumber

So

$F(t)= \dfrac{1}{2}+ \sum^{\infty}_{ \underset{n ~\rm{odd}}{n=1} }\dfrac{2}{\pi n} \sin(n \pi t). \nonumber$

We want to try

$x(t)= \dfrac{a_0}{2}+ \sum_{n=1}^{\infty} a_n \cos(n \pi t)+ b_n \sin(n \pi t). \nonumber$

Once we plug into the differential equation $$x'' + 2x = F(t)$$, it is clear that $$a_n=0$$ for $$n \geq 1$$ as there are no corresponding terms in the series for $$F(t)$$. Similarly $$b_n=0$$ for $$n$$ even. Hence we try

$x(t)= \dfrac{a_0}{2}+ \sum_{\underset{n ~\rm{odd}}{n=1}}^{\infty} b_n \sin(n \pi t). \nonumber$

We plug into the differential equation and obtain

\begin{align}\begin{aligned} x''+2x &= \sum_{\underset{n ~\rm{odd}}{n=1}}^{\infty} \left[ -b_n n^2 \pi^2 \sin(n \pi t) \right] +a_0+2 \sum_{\underset{n ~\rm{odd}}{n=1}}^{\infty} \left[ b_n \sin(n \pi t) \right] \\ &= a_0+ \sum_{\underset{n ~\rm{odd}}{n=1}}^{\infty} b_n(2-n^2 \pi^2) \sin(n \pi t) \\ &= F(t)= \dfrac{1}{2}+ \sum_{\underset{n ~\rm{odd}}{n=1}}^{\infty} \dfrac{2}{\pi n} \sin(n \pi t).\end{aligned}\end{align} \nonumber

So $$a_0= \dfrac{1}{2}$$, $$b_n= 0$$ for even $$n$$, and for odd $$n$$ we get

$b_n= \dfrac{2}{\pi n(2-n^2 \pi^2)}. \nonumber$

The steady periodic solution has the Fourier series

$x_{sp}(t)= \dfrac{1}{4}+ \sum_{\underset{n ~\rm{odd}}{n=1}}^{\infty} \dfrac{2}{\pi n(2-n^2 \pi^2)} \sin(n \pi t). \nonumber$

We know this is the steady periodic solution as it contains no terms of the complementary solution and it is periodic with the same period as $$F(t)$$ itself. See Figure $$\PageIndex{1}$$ for the plot of this solution.

### Resonance

Just like when the forcing function was a simple cosine, resonance could still happen. Let us assume $$c=0$$ and we will discuss only pure resonance. Again, take the equation

$mx''(t)+kx(t)=F(t). \nonumber$

When we expand $$F(t)$$ and find that some of its terms coincide with the complementary solution to $$mx''+kx=0$$, we cannot use those terms in the guess. Just like before, they will disappear when we plug into the left hand side and we will get a contradictory equation (such as $$0=1$$). That is, suppose

$x_c=A \cos(\omega_0 t)+B \sin(\omega_0 t), \nonumber$

where $$\omega_0= \dfrac{N \pi}{L}$$ for some positive integer $$N$$. In this case we have to modify our guess and try

$x(t)= \dfrac{a_0}{2}+t \left( a_N \cos \left( \dfrac{N \pi}{L}t \right)+ b_N \sin \left( \dfrac{N \pi}{L}t \right) \right) + \sum_{\underset{n \neq N}{n=1}}^{\infty} a_n \cos \left( \dfrac{n \pi}{L}t \right)+ b_n \sin \left( \dfrac{n \pi}{L}t \right). \nonumber$

In other words, we multiply the offending term by $$t$$. From then on, we proceed as before.

Of course, the solution will not be a Fourier series (it will not even be periodic) since it contains these terms multiplied by $$t$$. Further, the terms $$t \left( a_N \cos \left( \dfrac{N \pi}{L}t \right)+ b_N \sin \left( \dfrac{N \pi}{L}t \right) \right)$$ will eventually dominate and lead to wild oscillations. As before, this behavior is called pure resonance or just resonance.

Note that there now may be infinitely many resonance frequencies to hit. That is, as we change the frequency of $$F$$ (we change $$L$$), different terms from the Fourier series of $$F$$ may interfere with the complementary solution and will cause resonance. However, we should note that since everything is an approximation and in particular $$c$$ is never actually zero but something very close to zero, only the first few resonance frequencies will matter.

##### Example $$\PageIndex{2}$$

Find the steady periodic solution to the equation

$\label{eq:19} 2x''+18 \pi^2 x=F(t),$

where

$F(t)= \left\{ \begin{array}{ccc} -1 & {\rm{if}} & -1<t<0, \\ 1 & {\rm{if}} & 0<t<1, \end{array} \right. \nonumber$

extended periodically. We note that

$F(t)= \sum^{\infty}_{ \underset{n ~\rm{odd}}{n=1} } \dfrac{4}{\pi n} \sin(n \pi t). \nonumber$

##### Exercise $$\PageIndex{1}$$

Compute the Fourier series of $$F$$ to verify the above equation.

As $$\sqrt{\frac{k}{m}}=\sqrt{\frac{18\pi ^{2}}{2}}=3\pi$$, the solution to $$\eqref{eq:19}$$ is

$x(t)= c_1 \cos(3 \pi t)+ c_2 \sin(3 \pi t)+x_p(t) \nonumber$

for some particular solution $$x_p$$.

If we just try an $$x_{p}$$ given as a Fourier series with $$\sin (n\pi t)$$ as usual, the complementary equation, $$2x''+18\pi^{2}x=0$$, eats our $$3^{\text{rd}}$$ harmonic. That is, the term with $$\sin (3\pi t)$$ is already in in our complementary solution. Therefore, we pull that term out and multiply it by $$t$$. We also add a cosine term to get everything right. That is, we try

$x_p(t)= a_3 t \cos(3 \pi t) + b_3 t \sin(3 \pi t) + \sum^{\infty}_{ \underset{\underset{n \neq 3}{n ~\rm{odd}}}{n=1} } b_n \sin(n \pi t). \nonumber$

Let us compute the second derivative.

$x_p''(t)= -6a_3 \pi \sin(3 \pi t) -9 \pi^2 a_3 t \cos(3 \pi t) + 6b_3 \pi \cos(3 \pi t) -9 \pi^2 b_3 t \sin(3 \pi t) +\sum^{\infty}_{ \underset{\underset{n \neq 3}{n ~\rm{odd}}}{n=1} } (-n^2 \pi^2 b_n) \sin(n \pi t). \nonumber$

We now plug into the left hand side of the differential equation.

\begin{align}\begin{aligned} 2x_p'' + 18\pi^2 x_p = & - 12 a_3 \pi \sin (3 \pi t) - 18\pi^2 a_3 t \cos (3 \pi t) + 12 b_3 \pi \cos (3 \pi t) - 18\pi^2 b_3 t \sin (3 \pi t) \\ & \phantom{\, - 12 a_3 \pi \sin (3 \pi t)} ~ {} + 18 \pi^2 a_3 t \cos (3 \pi t) \phantom{\, + 12 b_3 \pi \cos (3 \pi t)} ~ {} + 18 \pi^2 b_3 t \sin (3 \pi t) \\ & {} + \sum_{\substack{n=1 \\ n~\text{odd} \\ n\not= 3}}^\infty (-2n^2 \pi^2 b_n + 18\pi^2 b_n) \, \sin (n \pi t) . \end{aligned}\end{align} \nonumber

If we simplify we obtain

$2x_p'' +18 \pi^2 x= -12a_3 \pi \sin(3 \pi t)+ 12b_3 \pi \cos(3 \pi t) +\sum^{\infty}_{ \underset{\underset{n \neq 3}{n ~\rm{odd}}}{n=1} } (-2n^2 \pi^2 b_n+ 18 \pi^2 b_n) \sin(n \pi t.) \nonumber$

This series has to equal to the series for $$F(t)$$. We equate the coefficients and solve for $$a_3$$ and $$b_n$$.

\begin{align}\begin{aligned} a_3 &= \frac{4/(3 \pi)}{-12 \pi}= \frac{-1}{9 \pi^2}, \\ b_3 &= 0, \\ b_n &= \frac{4}{n \pi(18 \pi^2 -2n^2 \pi^2)}=\frac{2}{\pi^3 n(9-n^2 )} ~~~~~~ {\rm{for~}} n {\rm{~odd~and~}} n \neq 3.\end{aligned}\end{align} \nonumber

That is,

$x_p(t)= \frac{-1}{9 \pi^2}t \cos(3 \pi t)+ \sum^{\infty}_{ \underset{\underset{n \neq 3}{n ~\rm{odd}}}{n=1} } \frac{2}{\pi^3 n(9-n^2)} \sin(n \pi t.) \nonumber$

When $$c>0$$, you will not have to worry about pure resonance. That is, there will never be any conflicts and you do not need to multiply any terms by $$t$$. There is a corresponding concept of practical resonance and it is very similar to the ideas we already explored in Chapter 2. Basically what happens in practical resonance is that one of the coefficients in the series for $$x_{sp}$$ can get very big. We will not go into details here.