Differential Equations for EngineersXYZ Homework Edition

⇩ Download ▾

2.6 Forced Oscillations and Resonance

Let us consider to the example of a mass on a spring. We now examine the case of forced oscillations, which we did not yet handle. That is, we consider the equation

m x + c x + k x = F ( t ) mx'' + cx' + kx = F(t) \nonumber

for some nonzero F(t)F(t). The setup is again: mm is mass, cc is friction, kk is the spring constant, and F(t)F(t) is an external force acting on the mass.

Interactive figureThe apparatus itself: mass, spring, damper, driving forceDrag the Time t and Forcing frequency ω (natural = 1) sliders.
A schematic of a block on a spring against a wall, drawn as a live figure rather than a picture: a hatch-free vertical wall on the left, a zigzag spring running from it to a square block sitting on a floor line, a dashed vertical line marking where the block rests when nothing drives it, and a horizontal arrow on the block's right showing the driving force. Dragging Time slides the block left and right of the dashed line while the spring stretches and compresses to follow it, and the arrow grows, shrinks and reverses. Dragging the forcing frequency changes how far the block travels: small near the ends of the range, and far wider than the arrow's own length when the frequency is near the middle. The block's motion also shifts relative to the arrow as the frequency rises, from moving with it, to lagging a quarter cycle, to moving opposite to it. Adjustable parameters: Time t (s) = 0 s, Forcing frequency ω (natural = 1) (w) = 0.9 rad/s. Viewing window: x from -0.24 to 6.54, y from -1.35 to 2.85.
XYZ Graph · viewer build 5edf91b
Figure 1's setup, made to move. The section's own m = k = 1 with damping c = 0.4, driven by F₀cos(ωt). Drag Time and the block travels; drag the forcing frequency and the travel changes size. Near ω = 1, which is this system's natural frequency, the block swings far wider than the driving arrow ever gets — that is resonance, on the apparatus rather than on a graph. Away from 1 in either direction it barely moves. Watch the arrow against the block: at low frequency they go the same way together, at ω = 1 the block is a quarter period behind, and above 1 the block is moving left while the force pushes right. The dashed line is the equilibrium position the block would rest at with no forcing.
Diagram of a horizontal mass-spring system: a hatched wall, spring k, block m, an arrow F of t driving it to the right, and damping c labelled beneath.
Figure 1\PageIndex{1}

What we are interested in is periodic forcing, such as noncentered rotating parts, or perhaps loud sounds, or other sources of periodic force. Once we learn about Fourier series in Chapter 4, we will see that we cover all periodic functions by simply considering F(t)=F0cos(ωt)F(t) = F_0 \cos (\omega t) (or sine instead of cosine, the calculations are essentially the same).

Undamped Forced Motion and Resonance

First let us consider undamped c=0c = 0 motion for simplicity. We have the equation

m x + k x = F 0 cos ( ω t ) mx'' + kx = F_0 \cos (\omega t) \nonumber

This equation has the complementary solution (solution to the associated homogeneous equation)

x c = C 1 cos ( ω 0 t ) + C 2 sin ( ω 0 t ) x_c = C_1 \cos ( \omega_0t) + C_2 \sin (\omega_0t) \nonumber

where ω0=km\omega_0 = \sqrt { \frac {k}{m}} is the natural frequency (angular), which is the frequency at which the system “wants to oscillate” without external interference.

Let us suppose that ω0ω\omega_0 \neq \omega. We try the solution xp=Acos(ωt)x_p = A \cos (\omega t) and solve for AA. Note that we need not have sine in our trial solution as on the left hand side we will only get cosines anyway. If you include a sine it is fine; you will find that its coefficient will be zero.

We solve using the method of undetermined coefficients. We find that

x p = F 0 m ( ω 0 2 ω 2 ) cos ( ω t ) x_p = \dfrac {F_0}{m(\omega^2_0 - \omega^2)} \cos (\omega t) \nonumber

We leave it as an exercise to do the algebra required.

The general solution is

x = C 1 cos ( ω 0 t ) + C 2 sin ( ω 0 t ) + F 0 m ( ω 0 2 ω 2 ) cos ( ω t ) x = C_1 \cos (\omega_0t) + C_2 \sin (\omega_0t) + \frac {F_0}{m(\omega^2_0 - \omega^2)} \cos (\omega t) \nonumber

or written another way

x = C cos ( ω 0 t y ) + F 0 m ( ω 0 2 ω 2 ) cos ( ω t ) x = C \cos (\omega_0t - y ) + \frac {F_0}{m(\omega^2_0 - \omega^2)} \cos (\omega t) \nonumber

Hence it is a superposition of two cosine waves at different frequencies.

Now suppose that ω0=ω\omega_0 = \omega. Obviously, we cannot try the solution Acos(ωt)A \cos (\omega t) and then use the method of undetermined coefficients. We notice that cos(ωt)\cos (\omega t) solves the associated homogeneous equation. Therefore, we need to try xp=Atcos(ωt)+Btsin(ωt)x_p = At \cos (\omega t) + Bt \sin (\omega t). This time we do need the sine term since the second derivative of tcos(ωt)t \cos (\omega t) does contain sines. We write the equation

x + ω 2 x = F 0 m cos ( ω t ) x'' + \omega^2 x = \frac {F_0}{m} \cos (\omega t) \nonumber

Plugging xpx_p into the left hand side we get

2 B ω cos ( ω t ) 2 A ω sin ( ω t ) = F 0 m cos ( ω t ) 2B \omega \cos (\omega t) - 2A \omega \sin (\omega t) = \frac {F_0}{m} \cos (\omega t) \nonumber

Hence A=0A = 0 and B=F02mωB = \frac {F_0}{2m \omega }. Our particular solution is F02mωtsin(ωt)\frac {F_0}{2m \omega } t \sin (\omega t) and our general solution is

x = C 1 cos ( ω t ) + C 2 sin ( ω t ) + F 0 2 m ω t sin ( ω t ) x = C_1 \cos (\omega t) + C_2 \sin (\omega t) + \frac {F_0}{2m \omega } t \sin (\omega t) \nonumber

The important term is the last one (the particular solution we found). We can see that this term grows without bound as tt \rightarrow \infty. In fact it oscillates between F0t2mω\frac {F_0t}{2m \omega } and F0t2mω\frac {-F_0t}{2m \omega }. The first two terms only oscillate between ±C12+C22\pm \sqrt { C^2_1 + C^2_2}, which becomes smaller and smaller in proportion to the oscillations of the last term as tt gets larger. In Figure 3\PageIndex{3} we see the graph with C1=C2=0,F0=2,m=1,ω=πC_1 = C_2 = 0, F_0 = 2, m = 1, \omega = \pi.

Plot of a blue oscillation over time 0 to 20 with fixed period about 2 and amplitude growing without bound, peaks climbing almost linearly to roughly 6 by time 19.
Figure 3\PageIndex{3}: Graph of 1πtsin(πt)\frac{1}{\pi}t\sin (\pi t).

By forcing the system in just the right frequency we produce very wild oscillations. This kind of behavior is called resonance or perhaps pure resonance. Sometimes resonance is desired. For example, remember when as a kid you could start swinging by just moving back and forth on the swing seat in the “correct frequency”? You were trying to achieve resonance. The force of each one of your moves was small, but after a while it produced large swings.

Interactive figureBeating stretching toward pure resonance as the forcing frequency approaches ω₀Drag the Forcing frequency slider from 2.8 to 3.6.
A rapid oscillation runs the width of the frame, its height swelling and collapsing in slow repeated bulges, with a pair of dashed curves tracing the tops and bottoms of those bulges — the slow beat the fast wave is trapped inside. Pushing the forcing frequency toward the system's own natural frequency stretches each bulge wider and drives it taller at the same time, so the beats grow longer and louder together, heading toward the case where the envelope never turns back at all. Adjustable parameter: Forcing frequency (w) = 3.14 rad/s. Viewing window: x from -3.35 to 41.35, y from -13.82 to 13.82.
XYZ Graph · viewer build 5edf91b
This section's own example 0.5x″ + 8x = 10cos(ωt) with x(0) = x′(0) = 0, generalized to a draggable ω and drawn with the slow modulating wave Lebl's own product identity gives: x = 40/(16 − ω²)·sin(((4−ω)/2)t)·sin(((4+ω)/2)t). At the default ω = π it reproduces Figure 2 exactly. Drag ω toward ω₀ = 4 and the beat period 4π/(4 − ω) stretches from about 10 s to about 31 s while the peak amplitude 40/(16 − ω²) climbs from 4.9 to 13.2. That prefactor diverges at ω = ω₀ — which is precisely why this closed form breaks down at resonance, and why the resonant case needs the separate growing solution (F₀/2mω₀)·t·sin(ω₀t), the shape plotted in Figure 3.

On the other hand resonance can be destructive. In an earthquake some buildings collapse while others may be relatively undamaged. This is due to different buildings having different resonance frequencies. So figuring out the resonance frequency can be very important.

A common (but wrong) example of destructive force of resonance is the Tacoma Narrows bridge failure. It turns out there was a different phenomenon at play.1

Damped Forced Motion and Practical Resonance

In real life things are not as simple as they were above. There is, of course, some damping. Our equation becomes

Interactive figureThe driven mass: how big the response is, and how far behind the forcingDrag the Forcing frequency ω (ω₀ = 1) and Damping coefficient c sliders.
Two waves of the same period run across the frame: a pale one of fixed height, and a heavy one whose height changes as the frequency is dragged and whose crests sit to the right of the pale one's. A pair of dashed horizontal lines marks the heavy wave's height. Moving the frequency toward the middle of its range swells the heavy wave far above the pale one and slides its crests until they fall a quarter period late, halfway between the pale crests; continuing past that point shrinks it again while the crests keep sliding until the two waves are opposite. Reducing the damping makes the swelling far larger without moving where it happens. Adjustable parameters: Forcing frequency ω (ω₀ = 1) (w) = 0.9 rad/s, Damping coefficient c (c) = 0.4. Viewing window: x from -0.26 to 15.26, y from -4.8 to 4.8.
XYZ Graph · viewer build 5edf91b
Equation (2.6.1) with the section's own normalisation m = k = F₀ = 1, so ω₀ = 1 and the height of the response is exactly the practical-resonance amplitude plotted further down. The pale curve is the forcing cos(ωt); the heavy curve is the steady periodic response x_sp, drawn in Lebl's own A cos(ωt) + B sin(ωt) form with A = (1 − ω²)/D and B = cω/D, D = (1 − ω²)² + (cω)². Drag the forcing frequency: the response swells as ω approaches ω₀ = 1 and shrinks away on either side, and it also slides to the right of the forcing. At ω = ω₀ exactly, A = 0, the response is a pure sine, and the lag is a quarter period — Lebl's γ = π/2. Push ω past 1 and the lag keeps growing toward half a period, so a fast-driven mass ends up moving opposite to the force pushing it. Damping sets how tall the peak gets, not where it is.

m x + c x + k x = F 0 cos ( ω t ) , \label{eq:15} mx'' + cx' + kx = F_0 \cos (\omega t),

(2.6.1)

for some c>0c > 0. We have solved the homogeneous problem before. We let

p = c 2 m ω 0 = k m p = \frac {c}{2m}\quad \omega_0 = \sqrt { \frac {k}{m} } \nonumber

We replace equation (2.6.1) with

x + 2 p x + ω 0 2 x = F 0 m cos ( ω t ) x'' + 2px' + \omega^2_0x = \frac {F_0}{m} \cos (\omega t) \nonumber

The roots of the characteristic equation of the associated homogeneous problem are r1,r2=p±p2ω02r_1, r_2 = -p \pm \sqrt {p^2 - \omega_0^2}. The form of the general solution of the associated homogeneous equation depends on the sign of p2ω02p^2 - \omega^2_0, or equivalently on the sign of c24kmc^2 - 4km, as we have seen before. That is,

x c = { C 1 e r 1 t + C 2 e r 2 t , if  c 2 > 4 k m , C 1 e p t + C 2 t e p t , if  c 2 = 4 k m , e p t ( C 1 cos ( ω 1 t ) + C 2 sin ( ω 1 t ) ) , if  c 2 < 4 k m , x_c = \begin {cases} C_1e^{r_1t} + C_2e^{r_2t}, & \text{if }c^2 > 4km, \\ C_1e^{pt} + C_2te^{-pt}, & \text{if }c^2 = 4km, \\ e^{-pt} ( C_1 \cos (\omega_1t) + C_2 \sin (\omega_1t)), & \text{if }c^2 < 4km, \end {cases} \nonumber

where ω1=ω02p2\omega_1 = \sqrt {\omega^2_0 - p^2 }. In any case, we can see that xc(t)0x_c(t) \rightarrow 0 as tt \rightarrow \infty. Furthermore, there can be no conflicts when trying to solve for the undetermined coefficients by trying xp=Acos(ωt)+Bsin(ωt)x_p = A \cos (\omega t) + B \sin (\omega t). Let us plug in and solve for AA and BB. We get (the tedious details are left to reader)

( ( ω 0 2 ω 2 ) B 2 ω p A ) sin ( ω t ) + ( ( ω 0 2 ω 2 ) A + 2 ω p B ) cos ( ω t ) = F 0 m cos ( ω t ) ((\omega^2_0 - \omega^2) B - 2 \omega pA ) \sin (\omega t) + ((\omega^2_0 - \omega^2) A + 2 \omega pB ) \cos (\omega t) = \frac {F_0}{m} \cos (\omega t) \nonumber

We get that

A = ( ω 0 2 ω 2 ) F 0 m ( 2 ω p ) 2 + m ( ω 0 2 ω 2 ) 2 A = \frac { (\omega^2_0 - \omega^2) F_0}{m{(2 \omega p)}^2 + m{(\omega^2_0 - \omega^2)}^2} \nonumber

B = 2 ω p F 0 m ( 2 ω p ) 2 + m ( ω 0 2 ω 2 ) 2 B = \frac { 2 \omega pF_0}{m{(2 \omega p)}^2 + m{(\omega^2_0 - \omega^2)}^2} \nonumber

We also compute C=A2+B2C = \sqrt { A^2 + B^2} to be

C = F 0 m ( 2 ω p ) 2 + ( ω 0 2 ω 2 ) 2 C = \frac {F_0}{m \sqrt { {(2 \omega p)}^2 + {(\omega^2_0 - \omega^2)}^2}} \nonumber

Thus our particular solution is

x P = ( ω 0 2 ω 2 ) F 0 m ( 2 ω p ) 2 + m ( ω 0 2 ω 2 ) 2 cos ( ω t ) + 2 ω p F 0 m ( 2 ω p ) 2 + m ( ω 0 2 ω 2 ) 2 sin ( ω t ) x_P = \frac {(\omega^2_0 - \omega^2)F_0}{m {(2 \omega p)}^2 + m {(\omega^2_0 - \omega^2)}^2} \cos (\omega t) + \frac {2 \omega pF_0}{m {(2 \omega p)}^2 + m{(\omega^2_0 - \omega^2)}^2} \sin (\omega t) \nonumber

Or in the alternative notation we have amplitude CC and phase shift γ\gamma where (if ωω0\omega \ne \omega_0)

tan γ = B A = 2 ω p ω 0 2 ω 2 \tan \gamma = \frac {B}{A} = \frac {2 \omega p}{\omega^2_0 - \omega^2} \nonumber

Hence we have

x p = F 0 m ( 2 ω p ) 2 + ( ω 0 2 ω 2 ) 2 cos ( ω t γ ) x_p = \frac {F_0}{m \sqrt { {(2 \omega p)}^2 + {(\omega^2_0 - \omega ^2)}^2}} \cos (\omega t - \gamma) \nonumber

If ω=ω0\omega = \omega_0 we see that A=0,B=C=F02mωp,andγ=π2A = 0, B = C = \frac {F_0}{2m \omega p}, ~\rm{and} ~ \gamma = \frac {\pi}{2}.

The exact formula is not as important as the idea. Do not memorize the above formula, you should instead remember the ideas involved. For different forcing function FF, you will get a different formula for xpx_p. So there is no point in memorizing this specific formula. You can always recompute it later or look it up if you really need it.

For reasons we will explain in a moment, we call xcx_cthe transient solution and denote it by xtrx_{tr}. We call the xpx_p we found above the steady periodic solution and denote it by xspx_{sp}. The general solution to our problem is

x = x c + x p = x t r + x s p x = x_c + x_p = x_{tr} + x_ {sp} \nonumber

We note that xc=xtrx_c = x_{tr} goes to zero as tt \rightarrow \infty, as all the terms involve an exponential with a negative exponent. Hence for large tt, the effect of xtrx_{tr} is negligible and we will essentially only see xspx_{sp}. Hence the name transient. Notice that xspx_{sp} involves no arbitrary constants, and the initial conditions will only affect xtrx_{tr}. This means that the effect of the initial conditions will be negligible after some period of time. Because of this behavior, we might as well focus on the steady periodic solution and ignore the transient solution. See Figure 4\PageIndex{4} for a graph of different initial conditions.

Five solution curves over time 0 to 20 from initial displacements between about -5.3 and 4.7; the transients differ, then from about time 13 all five trace one steady oscillation of amplitude 1.2.
Figure 4\PageIndex{4}: Solutions with different initial conditions for parameters k=1,m=1,F0=1,c=0.7,k = 1, m = 1, F_0 = 1, c = 0.7, and ω=1.1.\omega = 1.1.

Notice that the speed at which xtrx_{tr} goes to zero depends on PP (and hence cc). The bigger PP is (the bigger cc is), the “faster” xtrx_{tr} becomes negligible. So the smaller the damping, the longer the “transient region.” This agrees with the observation that when c=0c = 0, the initial conditions affect the behavior for all time (i.e. an infinite “transient region”).

Let us describe what we mean by resonance when damping is present. Since there were no conflicts when solving with undetermined coefficient, there is no term that goes to infinity. What we will look at however is the maximum value of the amplitude of the steady periodic solution. Let CC be the amplitude of xspx_{sp}. If we plot CC as a function of ω\omega (with all other parameters fixed) we can find its maximum. We call the ω\omega that achieves this maximum the practical resonance frequency. We call the maximal amplitude C(ω)C(\omega ) the practical resonance amplitude. Thus when damping is present we talk of practical resonance rather than pure resonance. A sample plot for three different values of cc is given in Figure 5\PageIndex{5}. As you can see the practical resonance amplitude grows as damping gets smaller, and any practical resonance can disappear when damping is large.

Interactive figurePractical resonance: steady-periodic amplitude C(ω) against dampingDrag the Damping coefficient slider from 0.3 to 2.
A single curve rises from a modest height on the left to a rounded peak a little short of the natural frequency, then falls away and flattens toward the horizontal axis on the right — the response is large at one frequency and small at both extremes. Raising the damping pulls that peak down and slides it further left, flattening the whole hump until, past a threshold, no peak survives at all and the curve simply decreases from the very start. Adjustable parameter: Damping coefficient (c) = 0.4 N·s/m. Viewing window: x from -1.28 to 5.28, y from -0.53 to 3.53.
XYZ Graph · viewer build 5edf91b
The steady-periodic amplitude C(ω) for this section's own parameters m = k = F₀ = 1, so ω₀ = 1 and p = c/2. Figure 5's three frozen curves are three ticks of this one slider — set c to 0.4, 0.8 and 1.6 to reproduce them. Drag c upward and watch the peak slide left of ω₀ and collapse, then vanish entirely as c crosses √2 ≈ 1.414, the exact threshold ω₀² − 2p² > 0 derived just below.
Plot of three amplitude-response curves against forcing frequency 0 to 3, all starting at 1: blue peaks sharply at about 2.55, green gently at about 1.37, dark red not at all, so less damping gives a taller peak.
Figure 5\PageIndex{5}: Graph of C(ω)C( \omega ) showing practical resonance with parameters k=1,m=1,F0=1k = 1, m =1, F_0 = 1. The top line is with c=0.4c = 0.4, the middle line with c=0.8c = 0.8, and the bottom line with c=1.6c = 1.6.

To find the maximum we need to find the derivative C(ω)C' (\omega ). Computation shows

C ( ω ) = 4 ω ( 2 p 2 + ω 2 ω 0 2 ) F 0 m ( ( 2 ω p ) 2 + ( ω 0 2 ω 2 ) ) 3 / 2 C' (\omega ) = \frac {-4 \omega (2p^2 + \omega^2 - \omega^2_0)F_0}{m {( {(2 \omega p)}^2 + {(\omega^2_0 - \omega^2)})}^{3/2}} \nonumber

This is zero either when ω=0\omega = 0 or when 2p2+ω2ω02=02p^2 + \omega^2 - \omega^2_0 = 0. In other words, C(ω)=0C' (\omega ) = 0 when

ω = ω 0 2 2 p 2 o r ω = 0 \omega = \sqrt { \omega^2_0 - 2p^2} \rm{~or~} \omega = 0 \nonumber

It can be shown that if ω022p2\omega^2_0 - 2p^2 is positive, then ω022p2\sqrt {\omega^2_0 - 2p^2} is the practical resonance frequency (that is the point where C(ω)C(\omega ) is maximal, note that in this case C(ω)>0C' (\omega ) > 0 for small ω\omega). If ω=0\omega = 0 is the maximum, then essentially there is no practical resonance since we assume that ω>0\omega > 0 in our system. In this case the amplitude gets larger as the forcing frequency gets smaller.

If practical resonance occurs, the frequency is smaller than ω0\omega_0. As the damping cc (and hence PP) becomes smaller, the practical resonance frequency goes to ω0\omega_0. So when damping is very small, ω0\omega_0 is a good estimate of the resonance frequency. This behavior agrees with the observation that when c=0c = 0, then ω0\omega_0 is the resonance frequency.

Another interesting observation to make is that when ω\omega\to\infty, then ω0\omega\to 0. This means that if the forcing frequency gets too high it does not manage to get the mass moving in the mass-spring system. This is quite reasonable intuitively. If we wiggle back and forth really fast while sitting on a swing, we will not get it moving at all, no matter how forceful. Fast vibrations just cancel each other out before the mass has any chance of responding by moving one way or the other.

The behavior is more complicated if the forcing function is not an exact cosine wave, but for example a square wave. A general periodic function will be the sum (superposition) of many cosine waves of different frequencies. The reader is encouraged to come back to this section once we have learned about the Fourier series.

Footnotes

1K. Billah and R. Scanlan, Resonance, Tacoma Narrows Bridge Failure, and Undergraduate Physics Textbooks, American Journal of Physics, 59(2), 1991, 118–124, http://www.ketchum.org/billah/Billah-Scanlan.pdf

Adapted from Differential Equations for Engineers by Jiří Lebl (https://www.jirka.org/diffyqs/), © Jiří Lebl, licensed under CC BY-SA 4.0. Changes were made. License: CC-BY-SA-4.0.

These eBooks are a prerelease and are not yet certified conformant with WCAG 2.1 AA or ADA Title II. Every page is built against an automated accessibility gate, and the published editions will meet ADA Title II requirements when they release in late September 2026. If something is unusable, please tell us.