Lemma
← All topics
Further mathematics

Differential equations

Equations whose unknown is a function.

Introduction

A differential equation links a function with its derivatives. Solving it means finding the function. This Further Maths topic covers first order linear equations by integrating factors, second order linear equations with constant coefficients (the auxiliary equation, complementary function and particular integral), and their use in modelling oscillations: simple harmonic motion and damped motion.

Why it matters

Almost every law of physics is a differential equation. Newton's second law for a spring gives mx¨=−kxm\ddot x = -kx. A circuit, a car's suspension, a swinging pendulum and a cooling cup of tea are all modelled this way. Solving the equation predicts the future from the present.

Intuitive explanation

IntuitionIntegrating factor: make the left side a product rule

For dydx+P(x)y=Q(x)\frac{dy}{dx} + P(x)y = Q(x), multiply by I=e∫P dxI = e^{\int P\,dx}. Then the left-hand side becomes exactly ddx(Iy)\frac{d}{dx}(Iy), and you can integrate both sides directly.

IntuitionWhy emxe^{mx} for second order equations

Differentiating emxe^{mx} just multiplies by mm. So substituting y=emxy = e^{mx} into ay′′+by′+cy=0ay'' + by' + cy = 0 gives (am2+bm+c)emx=0(am^2 + bm + c)e^{mx} = 0: a quadratic in mm, the auxiliary equation.

Formal definitions

DefinitionFirst order linear

dydx+P(x)y=Q(x)\dfrac{dy}{dx} + P(x)y = Q(x). Integrating factor I(x)=e∫P(x) dxI(x) = e^{\int P(x)\,dx}, and then ddx(Iy)=IQ\dfrac{d}{dx}(Iy) = IQ.

DefinitionSecond order, constant coefficients

ad2ydx2+bdydx+cy=f(x)a\dfrac{d^2y}{dx^2} + b\dfrac{dy}{dx} + cy = f(x). Auxiliary equation am2+bm+c=0am^2 + bm + c = 0.

DefinitionGeneral solution

y=CF+PIy = \text{CF} + \text{PI}, where the complementary function (CF) solves the equation with f=0f = 0, and the particular integral (PI) is any one solution of the full equation.

Notation

  • x˙=dxdt\dot x = \frac{dx}{dt}, x¨=d2xdt2\ddot x = \frac{d^2x}{dt^2}.
  • AA, BB are arbitrary constants, fixed by initial or boundary conditions.

Complementary functions

Roots of the auxiliary equationComplementary function
real, distinct α,β\alpha, \betaAeαx+BeβxAe^{\alpha x} + Be^{\beta x}
repeated α\alpha(A+Bx)eαx(A + Bx)e^{\alpha x}
complex p±qip \pm qiepx(Acos⁡qx+Bsin⁡qx)e^{px}(A\cos qx + B\sin qx)

Key results

TheoremParticular integrals: trial forms
  • f(x)=kf(x) = k: try λ\lambda. f(x)=\quad f(x) = polynomial of degree nn: try a general polynomial of degree nn.
  • f(x)=kepxf(x) = ke^{px}: try λepx\lambda e^{px} (try λxepx\lambda xe^{px} if epxe^{px} is in the CF).
  • f(x)=kcos⁡ωxf(x) = k\cos\omega x or ksin⁡ωxk\sin\omega x: try λcos⁡ωx+μsin⁡ωx\lambda\cos\omega x + \mu\sin\omega x.
TheoremSimple harmonic motion

x¨=−ω2x\ddot x = -\omega^2x has solution x=Acos⁡ωt+Bsin⁡ωtx = A\cos\omega t + B\sin\omega t, period 2πω\dfrac{2\pi}{\omega}.

Why the integrating factor works

ProofProduct rule in reverse

ddx(Iy)=Idydx+I′y\frac{d}{dx}(Iy) = I\frac{dy}{dx} + I'y. With I=e∫PI = e^{\int P}, I′=PII' = PI, so ddx(Iy)=I(dydx+Py)=IQ\frac{d}{dx}(Iy) = I\left(\frac{dy}{dx} + Py\right) = IQ.

∎
ProofComplex roots give oscillation

With roots p±qip \pm qi, the solutions e(p±qi)x=epx(cos⁡qx±isin⁡qx)e^{(p \pm qi)x} = e^{px}(\cos qx \pm i\sin qx) combine (by choosing complex constants) into the real forms epxcos⁡qxe^{px}\cos qx and epxsin⁡qxe^{px}\sin qx.

∎
ProofWhy a repeated root gives xeαxxe^{\alpha x}

Write D=ddxD = \frac{d}{dx}. Then ay′′+by′+cy=a(D−α)(D−β)yay'' + by' + cy = a(D - \alpha)(D - \beta)y, where α\alpha, β\beta are the roots of the auxiliary equation (the factors commute because the coefficients are constant). The key identity is

(D−α)(ueαx)=u′eαx.(D - \alpha)\left(ue^{\alpha x}\right) = u'e^{\alpha x}.

If α=β\alpha = \beta, then (D−α)2(ueαx)=u′′eαx(D - \alpha)^2(ue^{\alpha x}) = u''e^{\alpha x}, which is zero exactly when u′′=0u'' = 0, i.e. u=A+Bxu = A + Bx. So the solutions are precisely (A+Bx)eαx(A + Bx)e^{\alpha x}. The same identity explains the "multiply the trial by xx" rule (Q41, Q33, Q58): substituting y=ueαxy = ue^{\alpha x} removes the resonant exponential.

∎
ProofThe exponential response formula

Let p(m)=am2+bm+cp(m) = am^2 + bm + c. Since Dekx=kekxD e^{kx} = ke^{kx}, we have p(D)ekx=p(k)ekxp(D)e^{kx} = p(k)e^{kx}. So:

  • if p(k)≠0p(k) \ne 0, a PI of p(D)y=ekxp(D)y = e^{kx} is ekxp(k)\dfrac{e^{kx}}{p(k)};
  • if kk is a simple root, differentiate p(D)ekx=p(k)ekxp(D)e^{kx} = p(k)e^{kx} with respect to kk: p(D)(xekx)=(p′(k)+xp(k))ekx=p′(k)ekxp(D)(xe^{kx}) = (p'(k) + xp(k))e^{kx} = p'(k)e^{kx}, so a PI is xekxp′(k)\dfrac{xe^{kx}}{p'(k)};
  • if kk is a double root, a PI is x2ekxp′′(k)\dfrac{x^2e^{kx}}{p''(k)} (Q33: p′′=2p'' = 2, giving 12x2ex\frac12x^2e^x).

Trig forcing is the real or imaginary part of eiωxe^{i\omega x}, which is why the complex method (Q31, Q49, Q60) is so efficient.

∎
ProofFirst order linear equations have exactly one solution through each point

If y1y_1 and y2y_2 both solve y′+Py=Qy' + Py = Q, then z=y1−y2z = y_1 - y_2 solves z′+Pz=0z' + Pz = 0, so (Iz)′=0(Iz)' = 0 and z=CIz = \frac{C}{I}. If they agree at one point, C=0C = 0. So the integrating factor method doesn't just find a solution: it finds all of them, and the initial condition picks out exactly one.

∎

Methods

MethodFull solution of a second order equation
  1. Solve the auxiliary equation; write the CF.
  2. Choose a trial PI, substitute, compare coefficients.
  3. General solution == CF ++ PI.
  4. Use the conditions to find AA and BB (apply them to the general solution, not the CF alone).
MethodDamping

For x¨+2kx˙+ω2x=0\ddot x + 2k\dot x + \omega^2x = 0: overdamped if k>ωk > \omega (real distinct roots), critically damped if k=ωk = \omega, underdamped if k<ωk < \omega (decaying oscillations).

Examples

ExampleA complementary function

y′′−5y′+6y=0y'' - 5y' + 6y = 0: m2−5m+6=0⇒m=2,3m^2 - 5m + 6 = 0 \Rightarrow m = 2, 3; y=Ae2x+Be3xy = Ae^{2x} + Be^{3x}.

See the Worked examples tab.

Common mistakes

Common mistakeForgetting +c+c before dividing

In Iy=∫IQ dxIy = \int IQ\,dx, include the constant before dividing by II.

Common mistakeApplying conditions to the CF

Initial conditions apply to the full solution CF ++ PI.

Common mistakePI clashing with the CF

If the trial function already appears in the CF, multiply it by xx.

Applications

  • Engineering: suspension systems are designed to be critically damped.
  • Electronics: RLC circuits obey second order equations.
  • Biology and medicine: drug concentrations, population models.

Connections

Summary

  • First order linear: I=e∫PI = e^{\int P}, Iy=∫IQ dxIy = \int IQ\,dx.
  • Second order: auxiliary equation →\to CF; trial PI; general == CF ++ PI.
  • SHM x¨=−ω2x\ddot x = -\omega^2x; damping determined by the discriminant.

Worked examples

Try each one yourself first, then open the solution.

Example 1Integrating factor

Solve dydx+2xy=x\dfrac{dy}{dx} + \dfrac{2}{x}y = x, x>0x > 0, given y=1y = 1 when x=1x = 1.

Show the solution
  1. 1Integrating factor

    I=e∫2/x dx=e2ln⁡x=x2I = e^{\int 2/x\,dx} = e^{2\ln x} = x^2.

  2. 2Multiply

    ddx(x2y)=x3\frac{d}{dx}(x^2y) = x^3.

  3. 3Integrate

    x2y=x44+cx^2y = \frac{x^4}{4} + c.

  4. 4Condition

    1=14+c⇒c=341 = \frac14 + c \Rightarrow c = \frac34, so y=x24+34x2y = \frac{x^2}{4} + \frac{3}{4x^2}.

Answer

y=x24+34x2y = \dfrac{x^2}{4} + \dfrac{3}{4x^2}

Example 2CF plus PI

Find the general solution of y′′−3y′+2y=4xy'' - 3y' + 2y = 4x.

Show the solution
  1. 1CF

    m2−3m+2=0⇒m=1,2m^2 - 3m + 2 = 0 \Rightarrow m = 1, 2: Aex+Be2xAe^x + Be^{2x}.

  2. 2Trial PI

    y=px+qy = px + q: 0−3p+2(px+q)=4x0 - 3p + 2(px + q) = 4x.

  3. 3Compare

    2p=4⇒p=22p = 4 \Rightarrow p = 2; −3p+2q=0⇒q=3-3p + 2q = 0 \Rightarrow q = 3.

  4. 4General solution

    y=Aex+Be2x+2x+3y = Ae^x + Be^{2x} + 2x + 3.

Answer

y=Aex+Be2x+2x+3y = Ae^x + Be^{2x} + 2x + 3

Example 3Complex roots

Solve y′′+2y′+5y=0y'' + 2y' + 5y = 0 with y(0)=1y(0) = 1, y′(0)=1y'(0) = 1.

Show the solution
  1. 1Auxiliary equation

    m2+2m+5=0⇒m=−1±2im^2 + 2m + 5 = 0 \Rightarrow m = -1 \pm 2i.

  2. 2CF

    y=e−x(Acos⁡2x+Bsin⁡2x)y = e^{-x}(A\cos2x + B\sin2x).

  3. 3Conditions

    y(0)=A=1y(0) = A = 1. y′(0)=−A+2B=1⇒B=1y'(0) = -A + 2B = 1 \Rightarrow B = 1.

Answer

y=e−x(cos⁡2x+sin⁡2x)y = e^{-x}(\cos2x + \sin2x)

Example 4Simple harmonic motion

A particle moves with x¨=−9x\ddot x = -9x. At t=0t = 0, x=2x = 2 and x˙=0\dot x = 0. Find xx and the period.

Show the solution
  1. 1General solution

    x=Acos⁡3t+Bsin⁡3tx = A\cos3t + B\sin3t.

  2. 2Conditions

    A=2A = 2; x˙(0)=3B=0\dot x(0) = 3B = 0.

  3. 3Solution and period

    x=2cos⁡3tx = 2\cos3t; period 2π3\frac{2\pi}{3}.

Answer

x=2cos⁡3tx = 2\cos3t, period 2π3\frac{2\pi}3

Beyond the specification

University-level ideas and the deeper mathematics behind this topic. Not needed for exams, but this is where the subject really opens up.

Do solutions exist, and are they unique? (university)

For a linear equation we can write the solutions down. For a general first order equation y′=f(x,y)y' = f(x, y), y(x0)=y0y(x_0) = y_0, we usually can't, yet it is still possible to prove that a solution exists and is unique.

Picard iteration. Integrating, the problem is equivalent to the integral equation

y(x)=y0+∫x0xf(t,y(t)) dt.y(x) = y_0 + \int_{x_0}^x f(t, y(t))\,dt.

Start with the constant guess y0(x)=y0y_0(x) = y_0 and repeatedly substitute: yn+1(x)=y0+∫x0xf(t,yn(t)) dty_{n + 1}(x) = y_0 + \int_{x_0}^xf(t, y_n(t))\,dt. For y′=yy' = y, y(0)=1y(0) = 1, this gives

1,1+x,1+x+x22,1+x+x22+x36, …1,\quad 1 + x,\quad 1 + x + \frac{x^2}{2},\quad 1 + x + \frac{x^2}2 + \frac{x^3}{6},\ \dots

the Maclaurin series of exe^x, built one term at a time.

The theorem (Picard–Lindelöf). Suppose ff is continuous and Lipschitz in yy: ∣f(x,y)−f(x,z)∣≤L∣y−z∣|f(x, y) - f(x, z)| \le L|y - z| near (x0,y0)(x_0, y_0). Then for ∣x−x0∣|x - x_0| small enough the iterates converge to a solution, and the solution is unique. The proof shows ∣yn+1−yn∣≤C(L∣x−x0∣)nn!|y_{n + 1} - y_n| \le C\frac{(L|x - x_0|)^n}{n!}, so the differences are dominated by an exponential series. (Equivalently, the map y↦y0+∫f(t,y)y \mapsto y_0 + \int f(t, y) is a contraction, and the Banach fixed point theorem applies.)

When the hypotheses fail.

  • Non-uniqueness. y′=3y2/3y' = 3y^{2/3}, y(0)=0y(0) = 0: both y=0y = 0 and y=x3y = x^3 are solutions (and so is y=0y = 0 until any time aa, then (x−a)3(x - a)^3). Here f=3y2/3f = 3y^{2/3} is not Lipschitz at y=0y = 0: its slope is infinite. Physically: a ball balanced on top of a dome shaped like −∣x∣3/2-|x|^{3/2} can sit still forever, or roll off at any moment, without breaking Newton's laws ("Norton's dome").
  • Blow-up. y′=y2y' = y^2, y(0)=1y(0) = 1 has solution y=11−xy = \frac{1}{1 - x}, which escapes to infinity at x=1x = 1. The theorem only promises a solution for a short while; Q56 is another example. For linear equations with continuous coefficients, Grönwall's inequality rules out blow-up, so solutions exist on the whole interval.

Uniqueness has consequences. Two different solution curves of y′=f(x,y)y' = f(x, y) can never cross, and for an autonomous system x˙=F(x)\dot{\mathbf x} = \mathbf F(\mathbf x) two trajectories never cross in the phase plane. In two dimensions this is so restrictive that bounded trajectories must settle down to a point or a closed loop (the Poincaré–Bendixson theorem); chaos needs at least three dimensions, like the Lorenz system.

Linear systems, eigenvalues and the phase plane (university)

Q39 and Q55 were systems of equations. In general a linear system is x˙=Ax\dot{\mathbf x} = A\mathbf x with AA a constant matrix, and any second order equation can be written this way: x¨+bx˙+cx=0\ddot x + b\dot x + cx = 0 becomes

ddt(xx˙)=(01−c−b)(xx˙),\frac{d}{dt}\begin{pmatrix}x\\ \dot x\end{pmatrix} = \begin{pmatrix}0 & 1\\ -c & -b\end{pmatrix}\begin{pmatrix}x\\ \dot x\end{pmatrix},

whose characteristic polynomial is λ2+bλ+c\lambda^2 + b\lambda + c: the auxiliary equation is the characteristic equation of this matrix.

Eigenvectors are straight-line solutions. If Av=λvA\mathbf v = \lambda\mathbf v, then x=eλtv\mathbf x = e^{\lambda t}\mathbf v solves the system. With two independent eigenvectors, the general solution is c1eλ1tv1+c2eλ2tv2c_1e^{\lambda_1t}\mathbf v_1 + c_2e^{\lambda_2t}\mathbf v_2. In Q39, A=(1141)A = \begin{pmatrix}1 & 1\\ 4 & 1\end{pmatrix} has eigenvalues 33, −1-1 with eigenvectors (1,2)(1, 2) and (1,−2)(1, -2), and indeed x=12e3t(1,2)+12e−t(1,−2)\mathbf x = \frac12e^{3t}(1, 2) + \frac12e^{-t}(1, -2). In general x(t)=etAx(0)\mathbf x(t) = e^{tA}\mathbf x(0), using the matrix exponential from the Matrices deep section.

The phase plane. Plot x(t)\mathbf x(t) as a curve. The picture near the origin depends only on the eigenvalues, which are determined by τ=tr⁡A\tau = \operatorname{tr}A and Δ=det⁡A\Delta = \det A (they solve λ2−τλ+Δ=0\lambda^2 - \tau\lambda + \Delta = 0):

EigenvaluesPictureCondition
real, opposite signssaddle (unstable)Δ<0\Delta < 0
real, same signnode (stable if negative)0<Δ<τ240 < \Delta < \frac{\tau^2}{4}
complex, real part ≠0\ne 0spiral (stable if τ<0\tau < 0)Δ>τ24\Delta > \frac{\tau^2}{4}, τ≠0\tau \ne 0
purely imaginarycentre (closed orbits)Δ>0\Delta > 0, τ=0\tau = 0

For the damped oscillator (τ=−b\tau = -b, Δ=c\Delta = c) the three damping cases are exactly the stable node (overdamped), the borderline Δ=τ24\Delta = \frac{\tau^2}{4} (critical) and the stable spiral (underdamped); SHM is a centre.

Linearisation. A nonlinear system x˙=F(x)\dot{\mathbf x} = \mathbf F(\mathbf x) behaves, near an equilibrium x∗\mathbf x^*, like the linear system with AA the matrix of partial derivatives (the Jacobian) at x∗\mathbf x^*. For the pendulum θ¨=−ω2sin⁡θ\ddot\theta = -\omega^2\sin\theta (Q54):

  • at θ=0\theta = 0, sin⁡θ≈θ\sin\theta \approx \theta, giving A=(01−ω20)A = \begin{pmatrix}0 & 1\\ -\omega^2 & 0\end{pmatrix}: a centre (small swings);
  • at θ=π\theta = \pi (balanced upside down), sin⁡θ≈−(θ−π)\sin\theta \approx -(\theta - \pi), giving A=(01ω20)A = \begin{pmatrix}0 & 1\\ \omega^2 & 0\end{pmatrix}, eigenvalues ±ω\pm\omega: a saddle (unstable).

The Hartman–Grobman theorem says this is reliable for saddles, nodes and spirals; centres are delicate, since a tiny nonlinear term can turn closed orbits into slow spirals. For the pendulum the energy (Q54 part (a)) is conserved, which keeps the orbits closed: the phase portrait is a row of "eyes" (oscillations) separated by separatrices from wavy lines (the pendulum going over the top).

From vibrating springs to vibrating strings: partial differential equations (university)

Q55 had two masses and two normal modes. Joining NN masses with springs gives NN modes; letting N→∞N \to \infty gives a continuous string, and the equations of motion become a partial differential equation, for a displacement u(x,t)u(x, t) depending on position and time.

The wave equation. For a string fixed at x=0x = 0 and x=πx = \pi:

∂2u∂t2=c2∂2u∂x2,u(0,t)=u(π,t)=0.\frac{\partial^2u}{\partial t^2} = c^2\frac{\partial^2u}{\partial x^2}, \qquad u(0, t) = u(\pi, t) = 0.

Separation of variables: look for u=X(x)T(t)u = X(x)T(t). Then T′′c2T=X′′X\frac{T''}{c^2T} = \frac{X''}{X}; the left side depends only on tt and the right only on xx, so both equal a constant, −k2-k^2. Now X′′+k2X=0X'' + k^2X = 0 with X(0)=X(π)=0X(0) = X(\pi) = 0 is a boundary value problem like Q37: it has non-zero solutions only when kk is a whole number nn, with X=sin⁡nxX = \sin nx. These are the normal modes of the string, with frequencies ncnc: a fundamental and its harmonics, which is why a plucked string sounds a musical note rather than noise.

Superposition and Fourier series. The general motion is

u(x,t)=∑n=1∞sin⁡nx(ancos⁡nct+bnsin⁡nct),u(x, t) = \sum_{n=1}^\infty\sin nx\left(a_n\cos nct + b_n\sin nct\right),

and matching the initial shape u(x,0)=f(x)u(x, 0) = f(x) requires f(x)=∑ansin⁡nxf(x) = \sum a_n\sin nx. Multiplying by sin⁡mx\sin mx and integrating, using ∫0πsin⁡nxsin⁡mx dx=0\int_0^\pi\sin nx\sin mx\,dx = 0 for n≠mn \ne m (the modes are orthogonal, like the eigenvectors in Q55), gives

am=2π∫0πf(x)sin⁡mx dx.a_m = \frac2\pi\int_0^\pi f(x)\sin mx\,dx.

Fourier's bold claim (1807) that essentially any function can be expanded this way drove a century of work on what "function", "convergence" and "integral" mean.

The heat equation. ∂u∂t=∂2u∂x2\frac{\partial u}{\partial t} = \frac{\partial^2u}{\partial x^2} separates the same way, but now T′=−n2TT' = -n^2T, so each mode decays like e−n2te^{-n^2t}: high-frequency wiggles in the initial temperature are smoothed out almost immediately, and after a while only the slowest mode e−tsin⁡xe^{-t}\sin x remains. This is first order decay (as in Newton's law of cooling, Q19) running independently in every mode.

The big picture. The constant coefficient method (emxe^{mx}, auxiliary equation), normal modes (eigenvectors) and Fourier series (eigenfunctions) are one idea at three scales: find the special solutions on which the equation acts by simple multiplication, and build everything else by adding them up. In quantum mechanics the same idea, applied to the Schrödinger equation, produces the discrete energy levels of atoms.

Why does this work?

Why does this work?Why is the general solution CF + PI?

The equation is linear: if y1y_1 and y2y_2 both solve ay′′+by′+cy=fay'' + by' + cy = f, their difference solves the equation with f=0f = 0. So every solution is one particular solution plus a solution of the homogeneous equation, and those form a two-dimensional space (two arbitrary constants) spanned by the two exponential solutions.

Beyond the syllabus

Beyond the syllabusChaos: the Lorenz equations

x˙=10(y−x)\dot x = 10(y - x), y˙=x(28−z)−y\dot y = x(28 - z) - y, z˙=xy−83z\dot z = xy - \frac83z. These innocent-looking nonlinear equations, from a model of convection, have solutions that never settle down and never repeat, and two nearby starting points diverge exponentially: the butterfly effect. Long-range weather forecasting is fundamentally limited by this.

Beyond the syllabusStochastic differential equations

Add randomness: dX=μX dt+σX dWdX = \mu X\,dt + \sigma X\,dW, where WW is Brownian motion. This is the model behind the Black–Scholes formula for option prices. Ordinary calculus fails for dWdW (it is too rough); Itô calculus has an extra term, d(f(X))=f′(X) dX+12f′′(X)σ2X2 dtd(f(X)) = f'(X)\,dX + \frac12f''(X)\sigma^2X^2\,dt.

Mathematical curiosities

Mathematical curiosityResonance

For x¨+ω2x=cos⁡ωt\ddot x + \omega^2x = \cos\omega t the usual trial fails (it is in the CF), and the particular integral is t2ωsin⁡ωt\frac{t}{2\omega}\sin\omega t, which grows without bound. Forcing a system at its natural frequency can destroy it, as soldiers marching in step on bridges have discovered.

Further exploration

Further explorationInvestigations
  • Solve the logistic equation dPdt=kP(1−PK)\frac{dP}{dt} = kP\left(1 - \frac PK\right) and sketch its S-shaped solutions.
  • Show that the predator–prey (Lotka–Volterra) equations conserve the quantity δx−γln⁡x+βy−αln⁡y\delta x - \gamma\ln x + \beta y - \alpha\ln y, so the orbits are closed curves.

Reading pathway: Nonlinear Dynamics and Chaos (Strogatz).

Now practise60 questions from Very easy to Extreme →