Maths with Lemon

First-Order Differential Equations & Euler’s Method

IB Mathematics: Analysis and Approaches Higher Level · AHL 5.18 · Lesson 10.2. Understand differential equations, translate real situations into rate models, and estimate solutions using Euler’s method and slope fields.

Lesson 10.2 worksheet (PDF)Previous lesson: Related RatesCalculus overview

1. What Is a Differential Equation?

What you need to know

  • A differential equation relates a function to one or more of its derivatives.
  • The order is the highest derivative appearing.
  • A general solution contains an arbitrary constant; a particular solution satisfies an initial or boundary condition.
  • A first-order equation may be linear or nonlinear.

Key ideas

\[\frac{dy}{dx}=f(x,y)\]
First-order linear
\[\frac{dy}{dx}=x+y\]
First-order nonlinear
\[\left(\frac{dy}{dx}\right)^2+y\frac{dy}{dx}=y^2-4\]
General vs particular solution

For \(\frac{dy}{dx}=e^{2x}\), integrate:

\[y=\frac12 e^{2x}+C\]

Using \(y(0)=3\), we obtain \(C=\frac52\).

\[\boxed{y=\frac12e^{2x}+\frac52}\]

2. Writing Differential Equations from Words

Modelling language

  • “Rate of change” becomes a derivative with respect to time.
  • “Proportional to” means multiply by a constant \(k\).
  • Use a negative sign for a decreasing quantity when \(k>0\).
  • State variables and units before writing the equation.

Worked examples

Water draining from a bucket

The outflow rate is proportional to the square root of the volume remaining.

\[\boxed{\frac{dV}{dt}=-k\sqrt V},\qquad k>0\]

The minus sign indicates that the volume is decreasing.

Bacterial growth

The growth rate is proportional to the number of bacteria \(B\).

\[\boxed{\frac{dB}{dt}=kB},\qquad k>0\]
You try: modelling the spread of a disease

If \(I\) people are infected in a population of size \(N\), and the rate is proportional to both infected and uninfected populations, then

\[\frac{dI}{dt}=kI(N-I)\]

3. Euler’s Method: The Essential Formula

Four steps

  • Start with \((x_0,y_0)\) and a fixed step size \(h\).
  • Calculate the slope \(f(x_n,y_n)\) at the current point.
  • Move \(h\) units horizontally and \(h\times\text{slope}\) vertically.
  • Repeat until the requested \(x\)-value is reached.

Euler iteration

\[\boxed{x_{n+1}=x_n+h}\]
\[\boxed{y_{n+1}=y_n+h\,f(x_n,y_n)}\]
Euler’s method uses the slope at the beginning of each step. The resulting value is an approximation, not generally an exact solution.
Worksheet example: first two steps

Use \(\frac{dy}{dx}=x+2y\), \(y(0)=2\), and \(h=0.2\).

\[y_1=2+0.2(0+2\cdot2)=2.8\]
\[y_2=2.8+0.2(0.2+2\cdot2.8)=3.96\]

Continue for five steps to estimate \(y(1)\).

4. Interactive Euler Explorer

Experiment with the step size

  • Select one of the differential equations from the worksheet.
  • Adjust the initial value and step size.
  • Compare the Euler polygon with the slope field.
  • Follow every calculation in the generated iteration table.
A smaller step size often improves accuracy, although Euler’s method is still approximate.

Slope field and numerical approximation

━━ Euler approximation   — local slope segments

nxₙyₙf(xₙ,yₙ)

5. Euler’s Method in Tables and Applications

Worksheet · Pages 3–4

  • Organise calculations in a table before rounding.
  • Use the same step size throughout.
  • For velocity data, approximate displacement by adding rectangular areas.
  • Distinguish left-endpoint estimates from trapezoidal estimates.

Worked example: distance from a speed table

Speed is recorded every 3 seconds at times \(0,3,6,9,12,15\), with values \(0,6,12,19,24,27\) m/s.

Using the speed at the start of each 3-second interval:

\[s\approx 3(0+6+12+19+24)\]
\[\boxed{s\approx183\ \mathrm{m}}\]
This is the left-endpoint estimate; it does not use the final speed at \(t=15\) as a new interval.
You try: speeds 20, 15, 10, 8, 6, 5 m/s
\[s\approx3(20+15+10+8+6)=\boxed{177\ \mathrm{m}}\]

6. Understanding and Recognising Slope Fields

What to look for

  • For \(\frac{dy}{dx}=f(x)\), slopes are constant along vertical lines.
  • For \(\frac{dy}{dx}=f(y)\), slopes are constant along horizontal lines.
  • Zero slopes indicate horizontal tangent segments.
  • Solution curves follow the direction of nearby segments.

Examples from the worksheet

\(\frac{dy}{dx}=y\)

Horizontal segments along \(y=0\); positive slopes above the x-axis and negative slopes below it.

\(\frac{dy}{dx}=-xy\)

Horizontal segments along both axes. The sign of the slope changes between quadrants.

Use the interactive explorer above to inspect other fields, including \(\frac{dy}{dx}=x+y\) and \(\frac{dy}{dx}=x-y\).

Check your understanding: where is the slope zero for \(dy/dx=x-y\)?
\[x-y=0\quad\Longrightarrow\quad\boxed{y=x}\]

7. IB AA HL Revision Checklist

Before your assessment

  • Identify first-order differential equations.
  • Write equations from proportionality statements.
  • Distinguish general and particular solutions.
  • Apply Euler’s method accurately over several steps.
  • Interpret and sketch slope fields.

Common mistakes

Wrong slope

Evaluate \(f(x_n,y_n)\) at the current point, not at the next point.

Rounding too early

Keep full precision in intermediate steps and round the final approximation as requested.

Open the full Lesson 10.2 worksheet

IB Past Paper Problems

Select a topic and unit, then click the button below to get a new problem.

Press the button to start!