01 / 20

Euler's Method
Numerical Approximation

Learn how to approximate solutions to differential equations one step at a time, understand error behavior, and build intuition for numerical methods.

Differential Equations

Why Do We Need Numerical Methods?

Most differential equations cannot be solved analytically. When we write \(\frac{dy}{dx} = f(x, y)\), we often cannot find a closed-form expression for \(y(x)\). Instead, we approximate the solution at discrete points.

The Big Idea: Follow the Slope

At any point \((x_n, y_n)\), the derivative \(f(x_n, y_n)\) tells us the slope of the solution curve. Euler's Method walks along that tangent line for a small step \(h\), then recalculates the slope at the new point.

\(x\)
\(y\)
True solution
Tangent line
Euler steps
\((x_0, y_0)\)
\((x_1, y_1)\)
\(h\)

Key Vocabulary

Step Size \(h\)
The horizontal distance between consecutive approximation points. Smaller \(h\) means more work but better accuracy.
Initial Condition
The known starting point \((x_0, y_0)\) from which we begin stepping forward.
Local vs. Global Error
Local error is the error in a single step. Global error is the total accumulated error at any given point.

The Euler Update Formula

Each new \(y\)-value equals the previous value plus the step size times the slope at the current point. This is just the tangent line approximation applied repeatedly.

Geometric Interpretation

\(x\)
\(y\)
Error
Exact solution
Euler approximation

The green segments follow the slope field at each point. The blue curve is the true solution. The gap between them is the accumulated error.

Euler's Method vs. Exact Solution

Euler's Method
Uses linear steps along the tangent. Fast and simple. Produces an approximation that drifts from the true curve, especially with large step sizes.
Exact Solution
Obtained by solving the ODE analytically (when possible). Gives the true value of \(y\) at every point \(x\), with no approximation error.

Understanding Error Behavior

1
Local Truncation Error: The error introduced in a single step is proportional to \(h^2\). Formally: \(\text{LTE} = O(h^2)\).
2
Global Error: Over many steps, local errors accumulate. The total error at a fixed endpoint is proportional to \(h\). Formally: \(\text{Global Error} = O(h)\).
3
Halving \(h\): If you halve the step size, the global error is roughly halved. You need twice as many steps, but the result is twice as accurate.

Concavity and Error Direction

Concave Up
Under-
estimate
Concave Down
Over-
estimate

Step-by-Step Procedure

1
Identify: the ODE \(\frac{dy}{dx} = f(x,y)\), initial condition \((x_0, y_0)\), step size \(h\), and target \(x\)-value.
2
Compute the slope: Evaluate \(f(x_n, y_n)\) at the current point.
3
Update \(y\): Calculate \(y_{n+1} = y_n + h \cdot f(x_n, y_n)\).
4
Update \(x\): Set \(x_{n+1} = x_n + h\).
5
Repeat steps 2–4 until you reach the target \(x\)-value.

Example 1: Simple Linear ODE

Approximate \(y(1)\) given \(\frac{dy}{dx} = x + y\), \(y(0) = 1\), with step size \(h = 0.5\).

Example 2: Smaller Step Size

Same problem: \(\frac{dy}{dx} = x + y\), \(y(0) = 1\). Now use \(h = 0.25\) (4 steps to reach \(x = 1\)).

Step \(x_n\) \(y_n\) Slope \(f(x_n, y_n)\)
0 0 1 1
1 0.25 1.25 1.5
2 0.50 1.625 2.125
3 0.75 2.15625 2.90625
4 1.00 2.8828 —

Visualizing Step Size Effects

\(x\)
\(y\)
0
0.25
0.5
0.75
1.0
1
2
3
Exact
\(h = 0.5\)
\(h = 0.25\)

Smaller step size \(h\) keeps the approximation closer to the true solution. The large step drifts much further away.

Common Mistakes

✕ Using the Wrong Slope
Evaluating \(f\) at \((x_{n+1}, y_{n+1})\) instead of \((x_n, y_n)\). Euler's Method uses the slope at the current point, not the next one.
✕ Forgetting to Update \(x\)
Computing \(y_{n+1}\) correctly but then using the old \(x_n\) in the next slope calculation. Both \(x\) and \(y\) must advance each step.
✕ Confusing \(h\) with Number of Steps
If asked to take 4 steps from \(x = 0\) to \(x = 2\), then \(h = 0.5\), not \(h = 4\). Calculate: $$h = \frac{\text{interval length}}{\text{number of steps}}$$

Summary: Error Properties

Property Euler's Method
Update Rule \(y_{n+1} = y_n + h f(x_n, y_n)\)
Local Error Order \(O(h^2)\)
Global Error Order \(O(h)\)
Concave Up Solution Underestimates
Concave Down Solution Overestimates
Complexity 1 slope evaluation/step

Question 1 of 5

Given \(\frac{dy}{dx} = 2x\), \(y(0) = 1\), and \(h = 0.5\), what is the Euler approximation of \(y(0.5)\)?

Question 2 of 5

If you halve the step size \(h\) in Euler's Method while keeping the same interval, the global error is approximately:

Question 3 of 5

If the true solution to a differential equation is concave up and increasing, Euler's Method will:

Question 4 of 5

Using Euler's Method with \(\frac{dy}{dx} = y\), \(y(0) = 1\), and \(h = 1\), what is \(y(2)\)?

Question 5 of 5

The local truncation error of Euler's Method at each step is of order: