← All notesMaths AI · Differential equations and phase portraits⬇ Download PDF
IB DP Maths AI · Topic 5 Calculus · AHL 5.14–5.18 · ~8 min read

Differential equations and phase portraits

HL differential equations for Maths AI: setting up models from rates of change, slope fields, separation of variables, Euler’s method for single and coupled equations, coupled linear systems solved with eigenvalues and eigenvectors, phase portraits and their stability, and second-order equations written as systems.

Setting up DEsExponential growth & decay modelsSlope fieldsSeparation of variablesEuler’s methodCoupled systemsEigenvalue solutionsPhase portraits
RSby Riyaz Sir
mentorriyaz.in
No tag = SL and HLHL ONLY HL students onlyFORMULA BOOKLET given in the examM1A1 how marks are awardedhighlight = comes up again and againTest yourself at the end

In 30 seconds

  • A differential equation describes how a quantity changes: dPdt = kP says the growth rate is proportional to the size.
  • Separation of variables: write the DE as g(y) dy = f(x) dx, integrate both sides, then use the initial condition to find the constant.
  • Euler's method: step along the slope field: xn + 1 = xn + h and yn + 1 = yn + h × f(xn, yn).
  • Coupled linear systems dXdt = MX have solutions X = Aeλ1tp1 + Beλ2tp2, where λ1, λ2 are the eigenvalues and p1, p2 the eigenvectors of M. The eigenvalues decide the shape of the phase portrait.
  • This note is HL only and unchanged for 2029.

By the end you can

  • Set up differential equations from a description of a rate of change. HL
  • Sketch and interpret slope fields. HL
  • Solve separable differential equations with an initial condition. HL
  • Use Euler's method for first-order DEs and for coupled systems. HL
  • Solve coupled linear systems with eigenvalues and eigenvectors, and sketch phase portraits. HL
  • Classify equilibrium points and discuss stability. HL
  • Write second-order DEs as coupled systems. HL

1Setting up and separating variables HL

  • From words: "the population grows at a rate proportional to its size" ⇒ dPdt = kP. "A drink cools at a rate proportional to the difference between its temperature and the room's" ⇒ dTdt = −k(T − Troom).
Worked example

A population satisfies dPdt = 0.03P with P(0) = 1200. Solve the DE, find P(10), and find the doubling time.

  1. ∫1P dP = ∫0.03 dt ⇒ ln P = 0.03t + c M1A1
  2. P = 1200e0.03t A1
  3. P(10) = 1620; doubling: e0.03t = 2 ⇒ t = 23.1 A1A1
Worked example

Solve dydx = xy with y(0) = 2.

  1. ∫y dy = ∫x dx ⇒ y22 = x22 + c M1A1
  2. y(0) = 2 ⇒ y2 = x2 + 4 M1
  3. y = √(x2 + 4) (positive root, since y(0) > 0) A1
Common mistakeAdding the constant after exponentiating: ln P = 0.03t + c gives P = ece0.03t = Ae0.03t, not e0.03t + c.
  • Slope fields: at each point draw a short line with gradient f(x, y). Solution curves follow the lines and never cross each other. Where f = 0 the lines are horizontal.

2Euler's method HL

xn + 1 = xn + h, yn + 1 = yn + h × f(xn, yn) FORMULA BOOKLET
for dydx = f(x, y)
xy00.10.20.31.11.21.31.4Euler 1.362exact 1.400dy/dx = x + y, y(0) = 1step h = 0.1
Euler's method follows the tangent for each step. Here the solution curve bends upwards, so Euler falls a little below it.
Worked example

Use Euler's method with h = 0.1 to estimate y(0.3) for dydx = x + y, y(0) = 1.

  1. y1 = 1 + 0.1(0 + 1) = 1.1 M1
  2. y2 = 1.1 + 0.1(0.1 + 1.1) = 1.22 A1
  3. y3 = 1.22 + 0.1(0.2 + 1.22) = 1.362 A1
  • Accuracy: smaller steps give better estimates (the exact value here is 1.400). If the curve is concave up, Euler underestimates; concave down, it overestimates.
GDC (calculator) methodSet up a table or spreadsheet with columns n, xn, yn and yn + h f(xn, yn), or use a recursive sequence. Show the first two steps by hand.

3Coupled linear systems HL

  • Form: dxdt = ax + by, dydt = cx + dy, or dXdt = MX with M = (a b; c d). They model interacting quantities: two competing species, two connected tanks.
Worked example

Solve dxdt = x + 2y, dydt = 2x + y with x(0) = 3, y(0) = 1.

  1. M = (1 2; 2 1): λ2 − 2λ − 3 = 0 ⇒ λ = 3, −1 M1A1
  2. eigenvectors (1; 1) for 3 and (1; −1) for −1 A1
  3. X = Ae3t(1; 1) + Be−t(1; −1); A + B = 3, A − B = 1 ⇒ A = 2, B = 1 M1
  4. x = 2e3t + e−t, y = 2e3t − e−t A1

4Phase portraits HL

stable node: λ₁, λ₂ < 0unstable node: λ > 0saddle: λ₁ > 0 > λ₂stable spiral: a ± bi, a < 0unstable spiral: a > 0centre: ±bi (ellipses)
The six phase portraits for dXdt = MX. The eigenvalues of M decide which one you get.
Eigenvalues of MPortraitEquilibrium at origin
real, both negativetrajectories go into the originstable node
real, both positivetrajectories leave the originunstable node
real, opposite signsin along one eigenvector, out along the othersaddle (unstable)
complex a ± bi, a < 0spiral inwardsstable spiral
complex a ± bi, a > 0spiral outwardsunstable spiral
purely imaginary ±biclosed loops (ellipses)centre
  • Sketching: draw the eigenvector lines first (for real eigenvalues), then add trajectories in the right directions. For spirals, check the direction at a point such as (1, 0): dydt = c tells you whether it turns clockwise or anticlockwise.
Worked example

Describe the phase portrait of the system above and the long-term behaviour from (3, 1).

  1. λ = 3 and −1 have opposite signs: a saddle A1
  2. the e3t term dominates, so the solution moves away along the eigenvector (1; 1): x and y both grow without limit, with y/x → 1 R1A1
Common mistakeMixing up the eigenvector lines. The negative eigenvalue's eigenvector is the line trajectories come in along; the positive one is the line they go out along.

5Second-order differential equations HL

  • Method: for d2xdt2 = adxdt + bx, let y = dxdt. Then dxdt = y and dydt = bx + ay: a coupled system with M = (0 1; b a).
Worked example

Write d2xdt2 + 3dxdt + 2x = 0 as a system and describe the motion.

  1. y = dxdt: dxdt = y, dydt = −2x − 3y, M = (0 1; −2 −3) M1A1
  2. λ2 + 3λ + 2 = 0 ⇒ λ = −1, −2: both negative A1
  3. stable node: x returns to 0 without oscillating (an over-damped spring) R1
  • Euler for systems: step both variables together: xn + 1 = xn + h f1(xn, yn, tn), yn + 1 = yn + h f2(xn, yn, tn). This also works for non-linear systems such as predator–prey models.
Linking questionSeparation of variables needs Integration, areas and kinematics; coupled systems need eigenvalues and eigenvectors from Matrices and eigenvalues; exponential solutions are the models of Modelling with functions. For the AA treatment, with integrating factors, see Differential equations and Maclaurin series.
Idea for your IA / explorationModel a real cooling curve or the spread of a rumour with a differential equation, fit the parameter from your data, and compare the model with measurements. Or simulate a predator–prey system with Euler's method in a spreadsheet and investigate its equilibrium.

Test yourself — cover the answers first

Quick check

  1. HL Write "the rate of decay of mass m is proportional to m" as a DE.
  2. HL What does a slope field line show at a point?
  3. HL Give the Euler formula for yn+1.
  4. HL Eigenvalues −2 and −5. What is the equilibrium?
  5. HL Eigenvalues 1 ± 2i. What does the portrait look like?
  6. HL Write x″ = −4x as a system.

Exam-style

  1. HL A tank's water level h satisfies dhdt = −0.4√h with h(0) = 25. Solve the DE and find when the tank is empty.
  2. HL For dXdt = (0 −1; 1 0)X, find the eigenvalues, describe the phase portrait, and give the direction of motion at (1, 0).
Show answers
  1. dm/dt = −km
  2. the gradient dy/dx there
  3. yn + h f(xn, yn)
  4. a stable node
  5. an unstable spiral
  6. x′ = y, y′ = −4x
  7. ∫h−½ dh = ∫−0.4 dt ⇒ 2√h = −0.4t + c
    c = 10, so √h = 5 − 0.2t, h = (5 − 0.2t)2
    empty when √h = 0: t = 25
  8. λ2 + 1 = 0 ⇒ λ = ±i
    a centre: trajectories are closed circles around the origin
    at (1, 0): dx/dt = 0, dy/dt = 1, so it moves upwards: anticlockwise
Practise this chapter
Stuck on a question?

Send it to me on WhatsApp. I read every message.

Want regular help? Send this to your parent →
Share with a friendAsk Riyaz Sir

Independent notes written by Riyaz Sir. Not produced, endorsed or approved by the International Baccalaureate Organization. Syllabus codes refer to the IB DP subject guides.