Euler's Method

AP Calculus BC · Unit 7 — Differential Equations

Euler's method — walking the slope field one step at a time

Given $\dfrac{dy}{dx}=f(x,y)$ and a starting point $(x_0,y_0)$, choose a step size $h$ and repeat:

$$x_{n+1}=x_n+h,\qquad y_{n+1}=y_n+h\cdot f(x_n,y_n)$$

Each step follows the tangent line at the point you are standing on, not the point you are heading to. The result is a polygonal path that approximates the solution curve.

Two facts the exam tests more often than the arithmetic:

Stepping backwards, from $x_0$ to a smaller $x$, simply means $h<0$; the formula is unchanged.

true solutionEuler polylineerror00,51xy
Why Euler underestimates when the graph is concave up. The figure shows the solution of $\frac{dy}{dx}=2x(y+1)$ with $y(0)=1$ (solid curve) and the two-step Euler polyline with step size $h=0.5$ (dashed). Each segment of the polyline is a tangent line, and a tangent line to a concave-up graph always lies below the graph — so each step falls a little further behind, and the error accumulates. At $x=1$, Euler gives $2$ while the true value is $2e-1\approx4.437$: the dashed gap is exactly the accumulated error.

Worked example: two Euler steps and the direction of the error

Let $\dfrac{dy}{dx}=x+2y$ with $y(0)=1$. Use Euler's method with two equal steps, $h=0.25$, to approximate $y(0.5)$.

Solution

Step 1. At $(x_0,y_0)=(0,1)$: $f=0+2(1)=2$.

$$y_1=1+0.25\cdot 2=1.5\quad\text{at } x_1=0.25$$

Step 2. At $(0.25;\,1.5)$: $f=0.25+2(1.5)=3.25$.

$$y_2=1.5+0.25\cdot 3.25=2.3125\quad\text{at } x_2=0.5$$

So $y(0.5)\approx 2.3125$.

Direction of the error. $y''=1+2y'=1+2(x+2y)$; at $(0,1)$ this gives $y''=1+2(2)=5>0$, and $y''$ stays positive on the whole interval because $y$ is positive and increasing. The graph is concave up, so $2.3125$ is an underestimate.

Key technical point: the slope in step 2 must be computed at the $y_1=1.5$ just found, not at $y_0=1$.

Common mistake

The costliest mistake is updating $x$ but forgetting to update $y$: step two still uses $f\left(x_1,y_0\right)$. The only reliable safeguard is to draw a three-column table and fill in one entire row before moving to the next row — each row is one point, and the slope is always read from that same row. The second trap: the problem gives $h$ and a target $x$, and students miscount the number of steps, for example going from $x=0$ to $x=1$ with $h=0.25$ but taking only two steps. Count the steps with the division $\frac{x_{\text{target}}-x_0}{h}$ before computing any row.

Key takeaway

$y_{n+1}=y_n+h\cdot f(x_n,y_n)$ — the slope is always taken at the point you are currently standing on. Draw the table, count the steps by division, and answer "overestimate or underestimate" using the sign of $y''$.

← Separation of Variables and Exponential Models · All AP Calculus BC lessons · Practice AP Calculus BC questions (free, instant scoring) · The Logistic Differential Equation →