[Figure: FiveStudy logo]
FiveStudy
Calculus BC · Unit 7 · 7.5
AP Calculus BC · Differential Equations
Approximating Solutions Using Euler's Method
Follow the tangent line for one step, recompute the slope, repeat.
key idea$y_{\text{new}}=y_{\text{old}}+\frac{dy}{dx}\Big|_{\text{old}}\cdot \Delta x$
The method
Euler's method walks along the slope field in straight steps. From the current point you read the slope the equation gives, follow that tangent line for a fixed step $h$, and land on a new point — then repeat. It is the tangent-line approximation, applied over and over.
Four Euler steps of size $h=0.5$ for $\dfrac{dy}{dx}=y$ with $y(0)=1$, drawn against the true solution. Each dot sits where the previous tangent line landed, and the polygonal path falls steadily below the exact curve — the signature of approximating a concave-up function by its tangents.| Step | $x_n$ | $y_n$ | slope $=y_n$ | $\Delta y=h\cdot$slope | $y_{n+1}$ |
|---|
| $0$ | $0$ | $1$ | $1$ | $0.5$ | $1.5$ |
| $1$ | $0.5$ | $1.5$ | $1.5$ | $0.75$ | $2.25$ |
| $2$ | $1$ | $2.25$ | $2.25$ | $1.125$ | $3.375$ |
| $3$ | $1.5$ | $3.375$ | $3.375$ | $1.6875$ | $5.0625$ |
The whole method is this table. Each row's last entry becomes the next row's $y_n$, and the exact value $e^{2}\approx7.389$ shows how far four coarse steps drift — the approximation $5.0625$ is low by about 31%.
| What you are given | What it becomes | Note |
|---|
| the differential equation | the slope formula | evaluated at the current point |
| the initial condition | the starting row $(x_0,y_0)$ | step zero, not step one |
| the step size $h$ | $\Delta x$ for every step | may be negative to move left |
| the target $x$ | how many steps to take | $n=\dfrac{\text{target}-x_0}{h}$ |
Read all four off the problem before computing anything. Miscounting the steps is more common than any arithmetic slip.
Worked examples
EX 1
Two steps by hand
$\dfrac{dy}{dx}=x+y$Given $\dfrac{dy}{dx}=x+y$ and $y(0)=1$, approximate $y(0.4)$ with two steps of $h=0.2$.
2
First step
Slope $=0+1=1$, so $\Delta y=0.2\cdot1=0.2$ and $y_1=1.2$ at $x_1=0.2$.
3
Second step
Slope $=0.2+1.2=1.4$, so $\Delta y=0.2\cdot1.4=0.28$.
4
Land
$y_2=1.2+0.28=1.48$ at $x_2=0.4$.
5
Answer
$y(0.4)\approx1.48$. The slope was recomputed at the new point each time — reusing the first slope is the classic error.
EX 2
Stepping backwards
negative $h$With $\dfrac{dy}{dx}=2x-y$ and $y(1)=3$, approximate $y(0.6)$ using two steps.
1
Choose the step size
Moving from $x=1$ to $x=0.6$ in two steps gives $h=\dfrac{0.6-1}{2}=-0.2$.
2
First step
Slope at $(1,3)$ is $2(1)-3=-1$. $\Delta y=(-0.2)(-1)=0.2$, so $y_1=3.2$ at $x=0.8$.
3
Second step
Slope at $(0.8,3.2)$ is $1.6-3.2=-1.6$. $\Delta y=(-0.2)(-1.6)=0.32$.
4
Land
$y_2=3.2+0.32=3.52$ at $x=0.6$.
5
Watch the two minus signs
A negative $h$ times a negative slope raises $y$. Both signs must be carried through the multiplication.
EX 3
Compare with the exact value
measure the errorFor $\dfrac{dy}{dx}=y$ with $y(0)=1$, compare one Euler step of $h=1$ with the exact $y(1)$.
1
Take the step
Slope at $(0,1)$ is $1$, so $y_1=1+1\cdot1=2$.
2
Find the exact value
The solution is $y=e^{x}$, so $y(1)=e\approx2.71828$.
3
Compute the error
$2.71828-2=0.71828$ — an underestimate of about $26\%$.
4
Explain the direction
$e^{x}$ is concave up, so its tangent line lies below the curve. Euler follows that tangent.
5
Improve it
Halving to $h=0.5$ gives $2.25$, error $0.468$. Roughly halving the step halves the error.
EX 4
Predict the direction of the error
concavity decidesA solution is known to be concave down throughout. Will Euler's method over- or under-estimate?
1
Recall what a step follows
Each step travels along the tangent line at the current point.
2
Locate the tangent for concave down
A concave-down curve lies below every one of its tangent lines.
3
Conclude
The tangent runs above the curve, so Euler overestimates.
4
State the pair
Concave up $\Rightarrow$ underestimate; concave down $\Rightarrow$ overestimate.
5
Get the concavity without solving
Differentiate the equation to obtain $y''$ and check its sign in the region of interest.
How wrong can it be?
Recompute the slope at every new point
The slope changes as you move. Reusing the initial slope for all steps turns the method into a single straight line.
Count the steps from the initial condition
$(x_0,y_0)$ is step zero. Approximating $y(0.4)$ from $y(0)$ with $h=0.2$ takes two steps, not three.
Concavity fixes the direction of the error
Concave up gives an underestimate, concave down an overestimate. This is worth stating explicitly on free-response work.
Smaller steps, smaller error — roughly proportionally
Euler's error shrinks about in step with $h$. Halving $h$ roughly halves the error, which is slow: high accuracy needs many steps.