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.
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.
Key Vocabulary
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
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
Understanding Error Behavior
Concavity and Error Direction
Step-by-Step Procedure
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
Smaller step size \(h\) keeps the approximation closer to the true solution. The large step drifts much further away.
Common Mistakes
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: