5.18 · AHL · HL onlyPaper 1Paper 2Paper 3

Second-order differential equations

In a minute

A gives an acceleration, d2xdt2\frac{\mathrm{d}^{2}x}{\mathrm{d}t^{2}}, such as for a spring or a bouncing diving board. Put y=dxdty = \frac{\mathrm{d}x}{\mathrm{d}t} and it becomes two . Then you can use , find an exact solution from , or read the motion from a .

You'll be able to

  • Rewrite a second-order equation as coupled first-order equations with y=dxdty = \frac{\mathrm{d}x}{\mathrm{d}t}, and use both .
  • Estimate xx and dxdt\frac{\mathrm{d}x}{\mathrm{d}t} with Euler's method, by hand and on a GDC.
  • Find the exact solution of d2xdt2+adxdt+bx=0\frac{\mathrm{d}^{2}x}{\mathrm{d}t^{2}} + a\frac{\mathrm{d}x}{\mathrm{d}t} + bx = 0 when the eigenvalues are real and distinct.
  • Use the eigenvalues and a phase portrait of displacement against velocity to describe the motion in context.
Before you start3 quick questions on what this builds on
Check yourself
Find the eigenvalues of (1230)\begin{pmatrix}1 & 2\\ 3 & 0\end{pmatrix}.
Check yourself
dxdt=x−y\frac{\mathrm{d}x}{\mathrm{d}t} = x - y and dydt=2x\frac{\mathrm{d}y}{\mathrm{d}t} = 2x, with x=3x = 3 and y=1y = 1 at t=0t = 0. Use one step of Euler's method with h=0.1h = 0.1 to estimate xx at t=0.1t = 0.1.
Check yourself
A linear system has eigenvalues −1±2i-1 \pm 2\mathrm{i}. What do its trajectories do?

Revise first: 1.15 Eigenvalues and eigenvectors, 2.6 Fitting and testing models, 5.10 Second derivative and concavity, 5.14 Setting up and separating differential equations, 5.16 Euler's method and 5.17 Phase portraits for coupled equations

Writing it as two first-order equations

So far your held only a first derivative. Many laws of motion are about acceleration, the of displacement: d2xdt2\frac{\mathrm{d}^{2}x}{\mathrm{d}t^{2}}.

For example, a spring pulls a mass back to its rest position and friction opposes its velocity: d2xdt2=−26x−2dxdt\frac{\mathrm{d}^{2}x}{\mathrm{d}t^{2}} = -26x - 2\frac{\mathrm{d}x}{\mathrm{d}t}. In the exam the equation is always given. You solve it and interpret it.

The key step is to give the velocity its own letter. Let y=dxdty = \frac{\mathrm{d}x}{\mathrm{d}t}. Then dydt=d2xdt2\frac{\mathrm{d}y}{\mathrm{d}t} = \frac{\mathrm{d}^{2}x}{\mathrm{d}t^{2}}, so the one second-order equation becomes two first-order ones:

Learn this
dxdt=y,dydt=f(x,y,t)\frac{\mathrm{d}x}{\mathrm{d}t} = y, \qquad \frac{\mathrm{d}y}{\mathrm{d}t} = f(x, y, t)

These are , as in 5.16. Here xx is the displacement and yy is the velocity.

When the equation is d2xdt2+adxdt+bx=0\frac{\mathrm{d}^{2}x}{\mathrm{d}t^{2}} + a\frac{\mathrm{d}x}{\mathrm{d}t} + bx = 0 with constants aa and bb, rearrange it to dydt=−bx−ay\frac{\mathrm{d}y}{\mathrm{d}t} = -bx - ay. In matrix form:

Learn this
(dxdtdydt)=(01−b−a)(xy)\begin{pmatrix}\dfrac{\mathrm{d}x}{\mathrm{d}t}\\[6pt] \dfrac{\mathrm{d}y}{\mathrm{d}t}\end{pmatrix} = \begin{pmatrix}0 & 1\\ -b & -a\end{pmatrix}\begin{pmatrix}x\\ y\end{pmatrix}

A solution needs two : the starting displacement xx and the starting velocity y=dxdty = \frac{\mathrm{d}x}{\mathrm{d}t}. "Released from rest" or "let go from rest" means y=0y = 0 at the start.

Worked exampleUse the substitution y=dxdty = \frac{\mathrm{d}x}{\mathrm{d}t} to write d2xdt2+0.4dxdt+3x=2t\frac{\mathrm{d}^{2}x}{\mathrm{d}t^{2}} + 0.4\frac{\mathrm{d}x}{\mathrm{d}t} + 3x = 2t as a pair of coupled first-order equations.

Try it first, then reveal one step at a time.

  1. Let y=dxdty = \frac{\mathrm{d}x}{\mathrm{d}t}. Differentiate both sides: dydt=d2xdt2\frac{\mathrm{d}y}{\mathrm{d}t} = \frac{\mathrm{d}^{2}x}{\mathrm{d}t^{2}}.
Worked exampleAfter a diver jumps, the tip of a diving board is xx cm above its rest position at time tt seconds. A model is d2xdt2+2dxdt+26x=0\frac{\mathrm{d}^{2}x}{\mathrm{d}t^{2}} + 2\frac{\mathrm{d}x}{\mathrm{d}t} + 26x = 0. (a) Write the model in matrix form, using y=dxdty = \frac{\mathrm{d}x}{\mathrm{d}t}. (b) At one moment the tip is 55 cm above its rest position, moving down at 10 cm s−110\text{ cm s}^{-1}. Find dydt\frac{\mathrm{d}y}{\mathrm{d}t} and interpret it.

Try it first, then reveal one step at a time.

  1. (a) dxdt=y\frac{\mathrm{d}x}{\mathrm{d}t} = y and dydt=−26x−2y\frac{\mathrm{d}y}{\mathrm{d}t} = -26x - 2y, so (dxdtdydt)=(01−26−2)(xy)\begin{pmatrix}\dfrac{\mathrm{d}x}{\mathrm{d}t}\\[6pt] \dfrac{\mathrm{d}y}{\mathrm{d}t}\end{pmatrix} = \begin{pmatrix}0 & 1\\ -26 & -2\end{pmatrix}\begin{pmatrix}x\\ y\end{pmatrix}.
Check yourself
d2xdt2+3dxdt−10x=0\frac{\mathrm{d}^{2}x}{\mathrm{d}t^{2}} + 3\frac{\mathrm{d}x}{\mathrm{d}t} - 10x = 0 is written as coupled equations with y=dxdty = \frac{\mathrm{d}x}{\mathrm{d}t}. Which expression is dydt\frac{\mathrm{d}y}{\mathrm{d}t}?
Check yourself
A ball is thrown straight up. Its height xx m at time tt s is modelled by d2xdt2=−9.8−0.05dxdt\frac{\mathrm{d}^{2}x}{\mathrm{d}t^{2}} = -9.8 - 0.05\frac{\mathrm{d}x}{\mathrm{d}t}. It leaves the hand moving up at 12 m s−112\text{ m s}^{-1}. With y=dxdty = \frac{\mathrm{d}x}{\mathrm{d}t}, find dydt\frac{\mathrm{d}y}{\mathrm{d}t} at that moment.

Euler's method for second-order equations

Many second-order equations have no exact solution you can find, for example when the velocity is squared. Euler's method still works on the coupled form. You step xx and yy forward together, as in 5.16.

In the formula booklet
xn+1=xn+h×f1(xn,yn,tn),yn+1=yn+h×f2(xn,yn,tn),tn+1=tn+hx_{n+1} = x_{n} + h \times f_{1}(x_{n}, y_{n}, t_{n}), \quad y_{n+1} = y_{n} + h \times f_{2}(x_{n}, y_{n}, t_{n}), \quad t_{n+1} = t_{n} + h

This is in the booklet, with step length hh. Here f1(x,y,t)=yf_{1}(x, y, t) = y, so the first line becomes xn+1=xn+hynx_{n+1} = x_{n} + hy_{n}. For f2f_{2}, use the right-hand side f(x,y,t)f(x, y, t) of the given equation.

Worked exampleA skydiver falls from rest. Her distance fallen, xx m after tt s, is modelled by d2xdt2=9.8−0.1(dxdt)2\frac{\mathrm{d}^{2}x}{\mathrm{d}t^{2}} = 9.8 - 0.1\left(\frac{\mathrm{d}x}{\mathrm{d}t}\right)^{2}. Use Euler's method with h=0.5h = 0.5 to estimate her distance fallen and her speed after 11 second.

Try it first, then reveal one step at a time.

  1. Let y=dxdty = \frac{\mathrm{d}x}{\mathrm{d}t}, her speed. Then dxdt=y\frac{\mathrm{d}x}{\mathrm{d}t} = y and dydt=9.8−0.1y2\frac{\mathrm{d}y}{\mathrm{d}t} = 9.8 - 0.1y^{2}, with x0=0x_{0} = 0 and y0=0y_{0} = 0 at t0=0t_{0} = 0.
Check yourself
For d2xdt2=−6x−0.2dxdt\frac{\mathrm{d}^{2}x}{\mathrm{d}t^{2}} = -6x - 0.2\frac{\mathrm{d}x}{\mathrm{d}t}, x=2x = 2 and dxdt=1\frac{\mathrm{d}x}{\mathrm{d}t} = 1 at t=0t = 0. One Euler step with h=0.1h = 0.1 gives x1=2.1x_{1} = 2.1. Find y1y_{1}, the estimate of dxdt\frac{\mathrm{d}x}{\mathrm{d}t} at t=0.1t = 0.1.
Worked exampleA buoy bobs on waves. Its height above its rest level is xx m at time tt s, where d2xdt2+0.6dxdt+5x=2cos⁡t\frac{\mathrm{d}^{2}x}{\mathrm{d}t^{2}} + 0.6\frac{\mathrm{d}x}{\mathrm{d}t} + 5x = 2\cos t. At t=0t = 0, x=0.5x = 0.5 and the buoy is at rest. Use Euler's method with h=0.1h = 0.1 to estimate xx and y=dxdty = \frac{\mathrm{d}x}{\mathrm{d}t} when t=1t = 1. Give your answers to 3 s.f. and interpret them.

Try it first, then reveal one step at a time.

  1. Coupled form: dxdt=y\frac{\mathrm{d}x}{\mathrm{d}t} = y and dydt=2cos⁡t−5x−0.6y\frac{\mathrm{d}y}{\mathrm{d}t} = 2\cos t - 5x - 0.6y, with t0=0t_{0} = 0, x0=0.5x_{0} = 0.5 and y0=0y_{0} = 0.
Check yourself
In the skydiver model d2xdt2=9.8−0.1(dxdt)2\frac{\mathrm{d}^{2}x}{\mathrm{d}t^{2}} = 9.8 - 0.1\left(\frac{\mathrm{d}x}{\mathrm{d}t}\right)^{2}, her speed stops changing when her acceleration is 00. Find this speed, in m s−1\text{m s}^{-1} to 3 s.f.

Exact solutions from eigenvalues

When the equation is linear, d2xdt2+adxdt+bx=0\frac{\mathrm{d}^{2}x}{\mathrm{d}t^{2}} + a\frac{\mathrm{d}x}{\mathrm{d}t} + bx = 0, you can solve it exactly as in 5.17. Use the matrix M=(01−b−a)M = \begin{pmatrix}0 & 1\\ -b & -a\end{pmatrix} of the coupled form.

In the exam, still write det⁡(M−λI)=0\det(M - \lambda I) = 0 before the quadratic. That line earns the method mark.

When the eigenvalues λ1\lambda_{1} and λ2\lambda_{2} are real and distinct, the exact solution is the booklet formula:

In the formula booklet
x=Aeλ1tp1+Beλ2tp2\boldsymbol{x} = A\mathrm{e}^{\lambda_{1}t}\boldsymbol{p}_{1} + B\mathrm{e}^{\lambda_{2}t}\boldsymbol{p}_{2}

Here x=(xy)\boldsymbol{x} = \begin{pmatrix}x\\ y\end{pmatrix}. With p1=(1λ1)\boldsymbol{p}_{1} = \begin{pmatrix}1\\ \lambda_{1}\end{pmatrix} and p2=(1λ2)\boldsymbol{p}_{2} = \begin{pmatrix}1\\ \lambda_{2}\end{pmatrix}, the top row is the displacement and the bottom row is its velocity:

Learn this
x=Aeλ1t+Beλ2t,dxdt=Aλ1eλ1t+Bλ2eλ2tx = A\mathrm{e}^{\lambda_{1}t} + B\mathrm{e}^{\lambda_{2}t}, \qquad \frac{\mathrm{d}x}{\mathrm{d}t} = A\lambda_{1}\mathrm{e}^{\lambda_{1}t} + B\lambda_{2}\mathrm{e}^{\lambda_{2}t}

This is the . Find the constants AA and BB by putting t=0t = 0: the starting displacement is A+BA + B, and the starting velocity is Aλ1+Bλ2A\lambda_{1} + B\lambda_{2}.

Worked exampleA door closer swings a door shut. The door is open xx degrees at time tt seconds, where d2xdt2+6dxdt+8x=0\frac{\mathrm{d}^{2}x}{\mathrm{d}t^{2}} + 6\frac{\mathrm{d}x}{\mathrm{d}t} + 8x = 0. It is let go from rest when it is open 9090 degrees. Find xx in terms of tt, and describe how the door closes.

Try it first, then reveal one step at a time.

  1. Characteristic equation: det⁡(−λ1−8−6−λ)=λ2+6λ+8=0\det\begin{pmatrix}-\lambda & 1\\ -8 & -6 - \lambda\end{pmatrix} = \lambda^{2} + 6\lambda + 8 = 0, so (λ+2)(λ+4)=0(\lambda + 2)(\lambda + 4) = 0 and λ=−2\lambda = -2 or λ=−4\lambda = -4.
Worked exampleA tremor jolts the arm of a seismometer. Its displacement is xx mm at time tt seconds, where d2xdt2+9dxdt+14x=0\frac{\mathrm{d}^{2}x}{\mathrm{d}t^{2}} + 9\frac{\mathrm{d}x}{\mathrm{d}t} + 14x = 0. At t=0t = 0, x=0x = 0 and dxdt=40\frac{\mathrm{d}x}{\mathrm{d}t} = 40. (a) Find xx in terms of tt. (b) Use your GDC to find the greatest displacement of the arm, to 3 s.f.

Try it first, then reveal one step at a time.

  1. det⁡(M−λI)=λ2+9λ+14=0\det(M - \lambda I) = \lambda^{2} + 9\lambda + 14 = 0, so (λ+2)(λ+7)=0(\lambda + 2)(\lambda + 7) = 0 and λ=−2\lambda = -2 or λ=−7\lambda = -7.
Check yourself
Find the eigenvalues for d2xdt2+7dxdt+12x=0\frac{\mathrm{d}^{2}x}{\mathrm{d}t^{2}} + 7\frac{\mathrm{d}x}{\mathrm{d}t} + 12x = 0.
Check yourself
The general solution of a model is x=Ae−t+Be−5tx = A\mathrm{e}^{-t} + B\mathrm{e}^{-5t}. At t=0t = 0, x=4x = 4 and dxdt=0\frac{\mathrm{d}x}{\mathrm{d}t} = 0. Find BB.

Phase portraits of displacement against velocity

For the coupled form, a has the displacement xx across and the velocity y=dxdty = \frac{\mathrm{d}x}{\mathrm{d}t} up. Each shows how position and velocity change together.

Where a trajectory crosses the xx-axis, y=0y = 0: the object is momentarily at rest, at the end of a swing. Where it crosses the yy-axis, x=0x = 0: the object is passing through its rest position. The origin is the , at rest in the rest position.

The eigenvalues, from λ2+aλ+b=0\lambda^{2} + a\lambda + b = 0, tell you the motion of d2xdt2+adxdt+bx=0\frac{\mathrm{d}^{2}x}{\mathrm{d}t^{2}} + a\frac{\mathrm{d}x}{\mathrm{d}t} + bx = 0. These are the rules from 5.17, read in context:

1. Real, distinct and both negative: trajectories go into the origin. The object returns to rest without oscillating: it passes through the rest position at most once.

2. Complex with negative real part: trajectories spiral in. The object oscillates, and its swings get smaller.

3. Imaginary (a=0a = 0 and b>0b > 0): trajectories are closed ellipses. The object oscillates for ever with the same size of swing.

4. A positive eigenvalue, or complex eigenvalues with positive real part: almost every trajectory moves away from the origin, so the displacement, or the size of each swing, grows.

Two graphs of the diving board model, d squared x by d t squared plus 2 d x by d t plus 26 x equals 0, starting at x equals 10 at rest. Left: displacement x in centimetres against time t from 0 to 5 seconds, an oscillation that starts at 10 and dies away towards 0. Right: the phase portrait with x across and velocity y equals d x by d t up; the trajectory starts at the point 10, 0 and spirals clockwise into the origin. t x 10 -10 1 2 3 4 5 displacement against time x y 10 -10 50 -50 phase portrait: clockwise spiral in
The diving board model d2xdt2+2dxdt+26x=0\frac{\mathrm{d}^{2}x}{\mathrm{d}t^{2}} + 2\frac{\mathrm{d}x}{\mathrm{d}t} + 26x = 0 from x=10x = 10 at rest. Each full up-and-down swing on the left is one turn of the spiral on the right.
Worked exampleFor the diving board model d2xdt2+2dxdt+26x=0\frac{\mathrm{d}^{2}x}{\mathrm{d}t^{2}} + 2\frac{\mathrm{d}x}{\mathrm{d}t} + 26x = 0, the tip starts at rest 1010 cm above its rest position. Find the eigenvalues. Describe the trajectory on a phase portrait of xx against y=dxdty = \frac{\mathrm{d}x}{\mathrm{d}t}, and interpret it.

Try it first, then reveal one step at a time.

  1. λ2+2λ+26=0\lambda^{2} + 2\lambda + 26 = 0, so λ=−2±4−1042=−2±10i2=−1±5i\lambda = \frac{-2 \pm \sqrt{4 - 104}}{2} = \frac{-2 \pm 10\mathrm{i}}{2} = -1 \pm 5\mathrm{i}.
Worked exampleA glider on a frictionless air track is attached to a spring. Its displacement is xx cm at time tt seconds, where d2xdt2+9x=0\frac{\mathrm{d}^{2}x}{\mathrm{d}t^{2}} + 9x = 0. It is let go from rest at x=2x = 2. Use the eigenvalues to describe its trajectory on a phase portrait and its motion. Comment on the model.

Try it first, then reveal one step at a time.

  1. Here a=0a = 0 and b=9b = 9: λ2+9=0\lambda^{2} + 9 = 0, so λ=±3i\lambda = \pm 3\mathrm{i}. These are imaginary.
Check yourself
A model is d2xdt2+5dxdt+4x=0\frac{\mathrm{d}^{2}x}{\mathrm{d}t^{2}} + 5\frac{\mathrm{d}x}{\mathrm{d}t} + 4x = 0. Which describes the motion?
Check yourself
For d2xdt2+0.4dxdt+9x=0\frac{\mathrm{d}^{2}x}{\mathrm{d}t^{2}} + 0.4\frac{\mathrm{d}x}{\mathrm{d}t} + 9x = 0 with y=dxdty = \frac{\mathrm{d}x}{\mathrm{d}t}, find the gradient dydx\frac{\mathrm{d}y}{\mathrm{d}x} of the trajectory through (2,3)(2, 3), to 3 s.f.

Common mistakes

  • Using the new xn+1x_{n+1} to work out yn+1y_{n+1} in Euler's method. Both new values come from the old row (tn,xn,yn)(t_{n}, x_{n}, y_{n}).
  • Forgetting the starting velocity. A second-order equation needs xx and dxdt\frac{\mathrm{d}x}{\mathrm{d}t} at the start; "from rest" means dxdt=0\frac{\mathrm{d}x}{\mathrm{d}t} = 0.
  • Sign slips in the matrix. Rearranging d2xdt2+adxdt+bx=0\frac{\mathrm{d}^{2}x}{\mathrm{d}t^{2}} + a\frac{\mathrm{d}x}{\mathrm{d}t} + bx = 0 gives the bottom row −b-b, −a-a.
  • Rounding Euler values partway down the table. Keep full calculator values and round only the final answer, usually to 3 s.f.
  • Finding AA and BB from xx at t=0t = 0 alone. Differentiate the general solution and use dxdt\frac{\mathrm{d}x}{\mathrm{d}t} at t=0t = 0 for the second equation.
  • Stopping at the eigenvalues when the question asks about the motion. Say what the object does: settles without oscillating, oscillates with shrinking swings, or oscillates for ever.

Exam tips

  • "Use the substitution y=dxdty = \frac{\mathrm{d}x}{\mathrm{d}t}": write dydt=d2xdt2\frac{\mathrm{d}y}{\mathrm{d}t} = \frac{\mathrm{d}^{2}x}{\mathrm{d}t^{2}}, then both equations of the coupled system. Each line can earn a mark.
  • "Use Euler's method": write both iteration formulas with the numbers in, and show at least the first row of the table. That earns the method marks even if a later value is wrong.
  • "Hence write down the general solution": x=Aeλ1t+Beλ2tx = A\mathrm{e}^{\lambda_{1}t} + B\mathrm{e}^{\lambda_{2}t} or the vector form both earn the mark. Any non-zero multiple of an eigenvector is accepted.
  • "Sketch xx against tt": start at the given xx with the starting gradient dxdt\frac{\mathrm{d}x}{\mathrm{d}t}, show any maximum or minimum, and show xx tending to 00 when both eigenvalues are negative.

Key takeaways

Learn thisTo solve d2xdt2=f(x,dxdt,t)\frac{\mathrm{d}^{2}x}{\mathrm{d}t^{2}} = f\left(x, \frac{\mathrm{d}x}{\mathrm{d}t}, t\right), let y=dxdty = \frac{\mathrm{d}x}{\mathrm{d}t}: then dxdt=y\frac{\mathrm{d}x}{\mathrm{d}t} = y and dydt=f(x,y,t)\frac{\mathrm{d}y}{\mathrm{d}t} = f(x, y, t). You need two initial conditions, xx and dxdt\frac{\mathrm{d}x}{\mathrm{d}t} at the start.
Learn thisEuler's method for a second-order equation, with y=dxdty = \frac{\mathrm{d}x}{\mathrm{d}t}: xn+1=xn+hynx_{n+1} = x_{n} + hy_{n} and yn+1=yn+h×f(xn,yn,tn)y_{n+1} = y_{n} + h \times f(x_{n}, y_{n}, t_{n}), both from the old row. Keep full values until the end.
Learn thisFor d2xdt2+adxdt+bx=0\frac{\mathrm{d}^{2}x}{\mathrm{d}t^{2}} + a\frac{\mathrm{d}x}{\mathrm{d}t} + bx = 0: the matrix is (01−b−a)\begin{pmatrix}0 & 1\\ -b & -a\end{pmatrix}, the eigenvalues solve λ2+aλ+b=0\lambda^{2} + a\lambda + b = 0, and (1λ)\begin{pmatrix}1\\ \lambda\end{pmatrix} is an eigenvector for each eigenvalue λ\lambda.
In bookletx=Aeλ1tp1+Beλ2tp2(real distinct eigenvalues)\boldsymbol{x} = A\mathrm{e}^{\lambda_{1}t}\boldsymbol{p}_{1} + B\mathrm{e}^{\lambda_{2}t}\boldsymbol{p}_{2}\quad\text{(real distinct eigenvalues)}
Learn thisFor d2xdt2+adxdt+bx=0\frac{\mathrm{d}^{2}x}{\mathrm{d}t^{2}} + a\frac{\mathrm{d}x}{\mathrm{d}t} + bx = 0 with real distinct eigenvalues: x=Aeλ1t+Beλ2tx = A\mathrm{e}^{\lambda_{1}t} + B\mathrm{e}^{\lambda_{2}t}. Find AA and BB from xx and dxdt\frac{\mathrm{d}x}{\mathrm{d}t} at t=0t = 0.
Learn thisPhase portrait of xx against y=dxdty = \frac{\mathrm{d}x}{\mathrm{d}t} for d2xdt2+adxdt+bx=0\frac{\mathrm{d}^{2}x}{\mathrm{d}t^{2}} + a\frac{\mathrm{d}x}{\mathrm{d}t} + bx = 0: real, distinct, negative eigenvalues mean a return to rest without oscillating; complex with negative real part, oscillations that die away (a clockwise spiral in); imaginary, oscillations for ever (a clockwise ellipse).

Practise this

20 past-paper questions on Coupled differential equations in the AI HL bank, each with a mark scheme and a worked explanation.

Practise Coupled differential equations →