Approximating Solutions Using Euler's Method
| English | Chinese | Pinyin |
|---|---|---|
| Euler's method | 欧拉法 | ōu lā fǎ |
| step size | 步长 | bù zhǎng |
Walking a solution one small step at a time
- Not every differential equation can be solved with a formula — but you can still approximate the solution numerically.
- Euler's method 欧拉法 follows the slope field in tiny straight steps from a starting point.
- At each point, use the differential equation to get the slope, then step forward along it.
- Repeat, and you trace an approximate solution curve.
The update rule
- Given $\dfrac{dy}{dx}=f(x,y)$ and a start $(x_0,y_0)$, take a fixed step size 步长 $h$:
-
$$y_{n+1}=y_n+h\,f(x_n,y_n),\qquad x_{n+1}=x_n+h$$
- The new $y$ = old $y$ + (slope there) × (step $h$).
- It's "current value plus slope times step" — a tangent-line jump.
Stepping along the slope field
Euler's method takes short straight steps along the slope field — smaller steps hug the true curve better.
Euler's update rule is $y_{n+1}=$
Old $y$ plus slope times step.
The fixed increment $h$ used at each Euler step is called the ____ size.
$x$ advances by the step size $h$ each iteration.
Marching through a table
- Organize the work in a table: at each row, read $(x_n,y_n)$, compute the slope $f(x_n,y_n)$, then get $y_{n+1}$.
- Advance $x$ by $h$ each row and repeat until you reach the target $x$.
- Each step is just arithmetic; the differential equation supplies the slope.
- After a few rows you have an approximate $y$ at the target.
For $\dfrac{dy}{dx}=x+y$, $y(0)=1$, $h=0.5$: the slope at $(0,1)$ is $1$. Find $y_1$.
$1+0.5(1)=1.5$.
Continuing ($y_1=1.5$ at $x=0.5$, slope $=2$), find $y(1)\approx y_2$.
$1.5+0.5(2)=2.5$.
Accuracy and step size
- Euler's method is only an approximation — it follows straight tangents, so it drifts from the true curve.
- A smaller step size $h$ gives a more accurate estimate (but more steps).
- On a concave-up curve Euler tends to underestimate; concave-down, overestimate.
- More steps, less error — the classic accuracy trade-off.
Using a smaller step size $h$ generally makes Euler's estimate...
Smaller steps drift less from the true curve.
You must recompute the slope at each new point, not reuse the initial slope.
The slope $f(x_n,y_n)$ changes each step.
Use the slope at the current point $(x_n,y_n)$ for each step, not a fixed slope. And each step updates both $x$ (by $h$) and $y$ (by $h\cdot f$). A common error is reusing the initial slope for every step — the slope must be recomputed at each new point.
Approximate $y(1)$ for $\dfrac{dy}{dx}=x+y$, $y(0)=1$, with step $h=0.5$.
- Step 1: slope at $(0,1)$ is $0+1=1$; $y_1=1+0.5(1)=1.5$, $x_1=0.5$.
- Step 2: slope at $(0.5,1.5)$ is $0.5+1.5=2$; $y_2=1.5+0.5(2)=2.5$, $x_2=1$.
- So $y(1)\approx 2.5$.
Euler's method approximates a differential equation's solution by stepping along tangents: $y_{n+1}=y_n+h\,f(x_n,y_n)$ with fixed step size $h$, recomputing the slope at each point. It's approximate (straight steps drift from the curve); a smaller $h$ improves accuracy.