Resources For Teachers For Tutors For Students & Parents Pricing
Year 12 Maths - Specialist (Unit 3 & Unit 4) Differential equations

Euler's method

20 practice questions 0 video lessons Theory + worked examples

Master Euler’s method in Year 12 VCE Specialist Mathematics. Euler’s method is a step-by-step numerical way to estimate the solution of a differential equation \(\dfrac{dy}{dx}=f(x,y)\), following the tangent one small step at a time from a known starting point. It sits in the Calculus area of study of the VCE Mathematics Study Design (VCAA), within the Differential equations topic of Unit 4.

You will learn to apply the update rule \(y_{n+1}=y_n+h\,f(x_n,y_n)\) with \(x_{n+1}=x_n+h\), take one or several steps to estimate \(y\) at a target \(x\), see how the step size \(h\) affects accuracy, and compare the estimate with the exact solution — a first numerical tool for differential equations.

Create a free accountTrack your progress and save your work as you go.
Create free account

Theory

Euler's method is a step-by-step way to estimate the solution of a differential equation \(\dfrac{dy}{dx}=f(x,y)\) when an exact formula is hard to find. In Year 12 Specialist Mathematics you start from a known point \((x_0,y_0)\) and take steps of size \(h\) using the update \(y_{n+1}=y_n+h\,f(x_n,y_n)\), \(x_{n+1}=x_n+h\), to reach an estimate of \(y\) at a target \(x\).

A differential equation \(\dfrac{dy}{dx}=f(x,y)\) gives the slope of the solution curve at every point. With an initial condition \(y=y_0\) when \(x=x_0\), Euler's method builds an approximate solution one small step at a time.

The idea is to follow the tangent. At the current point \((x_n,y_n)\) the slope is \(f(x_n,y_n)\); moving a horizontal step size \(h\) along that straight tangent raises \(y\) by \(h\,f(x_n,y_n)\). This gives the next point \((x_{n+1},y_{n+1})\).

Repeating the step traces a polyline of short straight segments that approximates the true curve. Because it uses only the slope at the start of each step (a first-order approximation), it drifts away from the exact solution — the estimate is rarely exact.

Accuracy depends on the step size: a smaller \(h\) (with more steps to reach the same \(x\)) hugs the curve more closely and is generally more accurate, but takes more work. Where the exact solution is known, the Euler estimate can be compared with it to find the error.

Euler polyline following tangent segments vs the true curveFor dy/dx equals y with y equals 1 at x equals 0 and step size h equals 1, the Euler estimate is a polyline joining the points (0,1), (1,2) and (2,4) by straight tangent segments. The true solution y equals e to the x is a smooth curve rising above the polyline, so the Euler estimate underestimates and the gap grows with each step. x y y = e^x Euler
Euler's method follows the tangent for one step of \(h\) at a time. The polyline \((0,1)\to(1,2)\to(2,4)\) approximates \(y=e^{x}\); it sits below the true curve, so this estimate underestimates.
Smaller step size gives a closer Euler estimateTwo Euler polylines for dy/dx equals y from (0,1) to x equals 2 are drawn against the true curve y equals e to the x, which reaches about 7.39. The coarse step h equals 1 reaches only 4, while the finer step h equals 0.5 reaches about 5.06, sitting closer to the true curve. A smaller step size generally gives a more accurate approximation. x y y = e^x h = 0.5 h = 1
A smaller step size tracks the curve more closely. With \(h=0.5\) the estimate reaches about \(5.06\) at \(x=2\), closer to the exact \(e^{2}\approx 7.39\) than the coarse \(h=1\) estimate of \(4\).

Euler's method advances from the current point \((x_n,y_n)\) by one step of size \(h\), using the slope \(f(x_n,y_n)\) from the differential equation:

\[ y_{n+1}=y_n+h\,f(x_n,y_n),\qquad x_{n+1}=x_n+h \]
yn+1=yn+hf(xn,yn)

The \(x\)-values step up by \(h\) each time, so after \(n\) steps:

\[ x_n = x_0 + n\,h \]
xn=x0+nh

Where the exact solution \(y(x)\) is known, the error of the estimate at a target \(x\) is the difference from the exact value:

\[ \text{error} = y_{\text{exact}} - y_{\text{Euler}} \]
error=yexactyEuler
Only the slope at the start of the step is used. Euler holds \(f(x_n,y_n)\) constant across the whole step, so where the curve bends the estimate drifts. Halving the step size roughly halves the error of this first-order method — more accuracy costs more steps.

How to apply Euler's method

  1. Start at the given point \((x_0,y_0)\) and note the step size \(h\) and the slope function \(f(x,y)=\dfrac{dy}{dx}\).
  2. Evaluate the slope at the current point, \(f(x_n,y_n)\) — always at the start of the step.
  3. Take one step: \(y_{n+1}=y_n+h\,f(x_n,y_n)\) and \(x_{n+1}=x_n+h\).
  4. Repeat until \(x_n\) reaches the target \(x\); the last \(y_n\) is the estimate. A step table keeps each line tidy:

For \(\dfrac{dy}{dx}=x+y\) with \(y=1\) at \(x=0\) and \(h=0.1\), two steps give \(y\approx 1.22\) at \(x=0.2\):

\(n\)\(x_n\)\(y_n\)\(f(x_n,y_n)=x_n+y_n\)\(y_{n+1}=y_n+h\,f\)
0\(0\)\(1\)\(1\)\(1.1\)
1\(0.1\)\(1.1\)\(1.2\)\(1.22\)
Example 1 — One Euler step
For \(\dfrac{dy}{dx}=3x^2\) with \(y=2\) when \(x=1\), use Euler's method with step size \(h=0.1\) to find the estimate \(y_1\) after one step.
Solution

Evaluate the slope at the starting point \((x_0,y_0)=(1,2)\):

\(f(x_0,y_0)\)\(=\)\(3(1)^2\)
\(=\)\(3\)

Take one Euler step \(y_1=y_0+h\,f(x_0,y_0)\):

\(y_1\)\(=\)\(2 + 0.1(3)\)
\(=\)\(2 + 0.3\)
\(=\)\(2.3\)

After one step, \(y_1 = 2.3\).

Example 2 — Two steps with a step table
For \(\dfrac{dy}{dx}=x+y\) with \(y=1\) at \(x=0\) and \(h=0.1\), estimate \(y_2\), the value of \(y\) at \(x=0.2\), after two steps.
Solution

Step 1 — slope at \((0,1)\), then update:

\(f(x_0,y_0)\)\(=\)\(0 + 1 = 1\)
\(y_1\)\(=\)\(1 + 0.1(1)\)
\(=\)\(1.1\)

Step 2 — slope at \((0.1,\,1.1)\), then update:

\(f(x_1,y_1)\)\(=\)\(0.1 + 1.1 = 1.2\)
\(y_2\)\(=\)\(1.1 + 0.1(1.2)\)
\(=\)\(1.22\)

Each line of the working is one row of the step table:

\(n\)\(x_n\)\(y_n\)\(f(x_n,y_n)=x_n+y_n\)\(y_{n+1}=y_n+h\,f\)
0\(0\)\(1\)\(1\)\(1.1\)
1\(0.1\)\(1.1\)\(1.2\)\(1.22\)

At \(x=0.2\), \(y_2 = 1.22\).

Example 3 — Estimate y at a target x
A function satisfies \(\dfrac{dy}{dx}=x+1\) with \(y=2\) when \(x=0\). Using Euler's method with \(h=0.5\), estimate \(y\) when \(x=1.5\).
Solution

Three steps of \(h=0.5\) take \(x\) from \(0\) to \(1.5\):

\(y_1\)\(=\)\(2 + 0.5(0+1) = 2.5\)
\(y_2\)\(=\)\(2.5 + 0.5(0.5+1) = 3.25\)
\(y_3\)\(=\)\(3.25 + 0.5(1+1) = 4.25\)

At \(x=1.5\), \(y \approx 4.25\).

Example 4 — Compare with the exact solution
For \(\dfrac{dy}{dx}=y\) with \(y=1\) at \(x=0\), the exact solution is \(y=e^{x}\). Use two Euler steps of \(h=0.5\) to estimate \(y(1)\), then find the error against \(e\approx 2.718\).
Solution

Two Euler steps to reach \(x=1\):

\(y_1\)\(=\)\(1 + 0.5(1) = 1.5\)
\(y_2\)\(=\)\(1.5 + 0.5(1.5) = 2.25\)

Error \(=\) exact \(-\) estimate:

\(\text{error}\)\(=\)\(2.718 - 2.25\)
\(=\)\(0.468\ldots\)
\(\approx\)\(0.47\)

\(y(1)\approx 2.25\), about \(0.47\) below the exact value — a smaller \(h\) would reduce this error.

Euler polyline following tangent segments vs the true curveFor dy/dx equals y with y equals 1 at x equals 0 and step size h equals 1, the Euler estimate is a polyline joining the points (0,1), (1,2) and (2,4) by straight tangent segments. The true solution y equals e to the x is a smooth curve rising above the polyline, so the Euler estimate underestimates and the gap grows with each step. x y y = e^x Euler

Common pitfalls

Evaluating the slope at the wrong point. Euler uses the slope at the start of each step, \(f(x_n,y_n)\). For the second step, use the new point \((x_1,y_1)\), not the original \((x_0,y_0)\) and not the end of the step.
Forgetting to advance \(x\). Every step increases \(x\) by \(h\): \(x_{n+1}=x_n+h\). To reach a target \(x\), take \((x-x_0)/h\) steps — e.g. from \(x=0\) to \(x=1.5\) with \(h=0.5\) is three steps, not two.
Dropping the step size \(h\). The update adds \(h\,f(x_n,y_n)\), not \(f(x_n,y_n)\). Multiplying the slope by \(h\) is what makes each step small.
Treating the estimate as exact. Euler is a first-order approximation. Where the curve bends upward the estimate underestimates; where it bends downward it overestimates. A smaller \(h\) reduces — but never removes — the error.

Frequently asked questions

What is Euler's method?

It is a step-by-step numerical method for estimating the solution of a differential equation \(\dfrac{dy}{dx}=f(x,y)\) from a starting point \((x_0,y_0)\). Each step follows the tangent for a horizontal distance \(h\), using \(y_{n+1}=y_n+h\,f(x_n,y_n)\).

What is the formula for Euler's method?

The update rule is \(y_{n+1}=y_n+h\,f(x_n,y_n)\) with \(x_{n+1}=x_n+h\), where \(h\) is the step size and \(f(x_n,y_n)\) is the slope \(\dfrac{dy}{dx}\) at the current point.

How do I estimate y at a particular x value?

Work out how many steps reach the target: \(n=(x-x_0)/h\). Then apply the update rule that many times, advancing \(x\) by \(h\) each step; the final \(y_n\) is the estimate at that \(x\).

Does a smaller step size give a better approximation?

Generally yes. A smaller \(h\) (with more steps) follows the changing slope more closely, so the polyline stays nearer the true curve. For this first-order method, halving \(h\) roughly halves the error.

Why does Euler's method under- or overestimate?

Euler holds the slope constant across each step. Where the solution curve bends upward (concave up) the straight step falls below it, so Euler underestimates; where it bends downward it overestimates.

How does Euler's estimate compare with the exact solution?

When the exact solution is known, the error is \(y_{\text{exact}}-y_{\text{Euler}}\). For example, \(\dfrac{dy}{dx}=y\) from \((0,1)\) with \(h=0.5\) estimates \(y(1)\approx 2.25\), about \(0.47\) below the exact \(e\approx 2.718\).