Euler's Method

Most differential equations (like \(\frac{dy}{dx} = x + y\)) cannot be separated like in AB. Euler's method lets you approximate the solution anyway—simply by taking tiny straight-line steps along tangent lines.

By the end you can

The big idea

In AB, you used a single tangent line at \((x_0, y_0)\) to estimate a nearby value: \(y_{\text{new}} \approx y_0 + \left.\frac{dy}{dx}\right|_{(x_0,y_0)}\cdot \Delta x\). The problem is that a straight line drifts away from a curving graph as you go farther.

Euler's method fixes that by stopping after a short step \(\Delta x\), plugging your new point \((x_1, y_1)\) back into \(\frac{dy}{dx}\) to get a fresh slope, and taking another short step. Repeat until you reach the target \(x\)-value.

Euler's method update
\[ x_{n+1} = x_n + \Delta x, \qquad y_{n+1} = y_n + \left.\frac{dy}{dx}\right|_{(x_n, y_n)} \cdot \Delta x \]

If you're told to go from \(x_{\text{start}}\) to \(x_{\text{end}}\) in \(n\) equal steps, the step size is \(\Delta x = \dfrac{x_{\text{end}} - x_{\text{start}}}{n}\).

See it: Euler's polygon vs. the exact curve

Drag the slider to use more (smaller) steps on \(\frac{dy}{dx} = x + y\) with \(y(0)=1\). Notice the Euler path stays below the concave-up curve and hugs it tighter as steps shrink.

The AP table layout

Don't do Euler's method in your head—write a 4-column table. Each row computes one step and hands the new \(y\)-value to the next row.

Example 1 · Classic 2-step problem

Given \(\dfrac{dy}{dx} = x + y\) with \(y(0) = 1\), use Euler's method with 2 equal steps to approximate \(y(1)\).

  1. Find the step size: \(\Delta x = \dfrac{1 - 0}{2} = 0.5\).
  2. Fill out the table row by row:
    \(x\)\(y\)\(\frac{dy}{dx} = x+y\)\(\Delta y = \frac{dy}{dx}\cdot\Delta x\)\(y_{\text{new}} = y + \Delta y\)
    \(0\)\(1\)\(0+1 = 1\)\(1(0.5) = 0.5\)\(1 + 0.5 = 1.5\)
    \(0.5\)\(1.5\)\(0.5+1.5 = 2\)\(2(0.5) = 1\)\(1.5 + 1 = 2.5\)
    \(1\)\(2.5\)———
    The exact solution happens to be \(y = 2e^x - x - 1\), so \(y(1) = 2e - 2 \approx 3.437\). Our 2-step estimate of \(2.5\) is an underestimate—and you'll see why below.
\(y(1) \approx 2.5\)
Example 2 · Stepping backwards (\(\Delta x < 0\))

Given \(\dfrac{dy}{dx} = 2x - y\) with \(y(2) = 3\), use Euler's method with 2 equal steps to approximate \(y(1)\).

  1. Step size: \(\Delta x = \dfrac{1 - 2}{2} = -0.5\). Because we're moving left from \(2\) to \(1\), \(\Delta x\) is negative.
  2. Build the table:
    \(x\)\(y\)\(\frac{dy}{dx} = 2x-y\)\(\Delta y = \frac{dy}{dx}(-0.5)\)\(y_{\text{new}}\)
    \(2\)\(3\)\(4-3 = 1\)\(1(-0.5) = -0.5\)\(3 - 0.5 = 2.5\)
    \(1.5\)\(2.5\)\(3-2.5 = 0.5\)\(0.5(-0.5) = -0.25\)\(2.5 - 0.25 = 2.25\)
    \(1\)\(2.25\)———
\(y(1) \approx 2.25\)
Example 3 · Three steps

Given \(\dfrac{dy}{dx} = x^2 - y\) with \(y(0) = 2\), use Euler's method with step size \(\Delta x = 0.5\) to approximate \(y(1.5)\).

  1. From \(0\) to \(1.5\) with \(\Delta x = 0.5\) takes \(3\) steps:
    \(x\)\(y\)\(\frac{dy}{dx} = x^2-y\)\(\Delta y = \frac{dy}{dx}(0.5)\)\(y_{\text{new}}\)
    \(0\)\(2\)\(0 - 2 = -2\)\(-1\)\(1\)
    \(0.5\)\(1\)\(0.25 - 1 = -0.75\)\(-0.375\)\(0.625\)
    \(1\)\(0.625\)\(1 - 0.625 = 0.375\)\(0.1875\)\(0.8125\)
    \(1.5\)\(0.8125\)———
\(y(1.5) \approx 0.8125\) (or \(\tfrac{13}{16}\))

For \(\dfrac{dy}{dx} = x - 2y\) with \(y(1) = 2\), what is \(y(1.5)\) after one Euler step of \(\Delta x = 0.5\)?

At \((1, 2)\), \(\frac{dy}{dx} = 1 - 2(2) = -3\). Then \(\Delta y = (-3)(0.5) = -1.5\), so \(y(1.5) \approx 2 + (-1.5) = 0.5\). Notice \(-1\) is what you get if you forget to multiply the slope by \(\Delta x = 0.5\).

Overestimate or underestimate?

Just like tangent-line approximation in AB, this comes down to concavity (the sign of \(\frac{d^2y}{dx^2}\)) across the interval:

Concave UP (\(\frac{d^2y}{dx^2} > 0\))

Every tangent line sits below the curve, and the slope keeps increasing while Euler keeps using the older, smaller slope. So Euler's method gives an underestimate.

Concave DOWN (\(\frac{d^2y}{dx^2} < 0\))

Every tangent line sits above the curve, so Euler's method gives an overestimate.

How to find \(\frac{d^2y}{dx^2}\) from \(\frac{dy}{dx}\)

Differentiate \(\frac{dy}{dx}\) implicitly with respect to \(x\) (remembering \(\frac{d}{dx}(y) = \frac{dy}{dx}\)), and then substitute the original formula for \(\frac{dy}{dx}\) back in.

Example 4 · AP FRQ concavity check

In Example 1, \(\dfrac{dy}{dx} = x + y\) with \(y(0) = 1\). Explain why the Euler approximation \(y(1) \approx 2.5\) is an underestimate for \(y(1)\).

  1. Differentiate \(\frac{dy}{dx} = x + y\) implicitly with respect to \(x\): \[ \frac{d^2y}{dx^2} = 1 + \frac{dy}{dx} = 1 + x + y \]
  2. Check the sign on \([0, 1]\): at \((0, 1)\), \(\frac{dy}{dx} = 1 > 0\), and for \(x \ge 0,\; y \ge 1\), we have \(\frac{dy}{dx} = x + y > 0\), so \(y\) stays positive and increasing on \([0, 1]\).
  3. Therefore \(\frac{d^2y}{dx^2} = 1 + x + y > 0\) for all \(x \in [0, 1]\), meaning the graph of \(y\) is concave up on \([0, 1]\).
  4. Because the solution curve is concave up on \([0, 1]\), Euler's method (which follows tangent lines) gives an underestimate.
Underestimate, because \(\frac{d^2y}{dx^2} = 1 + x + y > 0\) (the graph of \(y\) is concave up) on \([0, 1]\).
Watch out: concave up only guarantees underestimate if it holds on the whole interval

On an AP FRQ, checking \(\frac{d^2y}{dx^2} > 0\) only at the starting point \((x_0, y_0)\) is not enough! State clearly why \(\frac{d^2y}{dx^2} > 0\) on the entire interval (or use a given fact like "the graph of \(f\) is concave up for all \(x\)"). Also, for a multi-step Euler method going backward (\(\Delta x < 0\)), be careful: only the first tangent step is guaranteed below a concave-up curve; later steps start below the curve with altered slopes, so AP typically only asks over/underestimate when stepping right on a curve with known concavity (often for a single tangent line or a function of \(x\) alone).

Suppose \(f\) is a twice-differentiable function with \(f''(x) < 0\) for all \(x \in [1, 3]\), and you use Euler's method with \(\Delta x = 0.5\) starting at \(x = 1\) to estimate \(f(3)\). Your estimate is:

Since \(f''(x) < 0\) on \([1, 3]\), the graph of \(f\) is concave down everywhere on the interval. Each tangent segment lies above the curve, so Euler's method overestimates \(f(3)\).

Common mistakes

Watch out for these
On the AP exam

Euler's method is almost always non-calculator and uses 2 or 3 steps. Show every step clearly (a table or explicit \(y_1 = \dots,\; y_2 = \dots\) equations) so graders can follow your work even if you make one arithmetic slip.

Practice problems

Warm-up

Given \(\dfrac{dy}{dx} = 2y\) with \(y(0) = 1\), use Euler's method with 2 equal steps to approximate \(y(1)\). Compare with the exact solution \(y = e^{2x}\).

Hint

\(\Delta x = 0.5\). Note that \(x\) doesn't appear in \(\frac{dy}{dx} = 2y\), only \(y\).

Solution

Step 1 at \((0, 1)\): \(\frac{dy}{dx} = 2(1) = 2\), \(\Delta y = 2(0.5) = 1 \Rightarrow y(0.5) \approx 2\).

Step 2 at \((0.5, 2)\): \(\frac{dy}{dx} = 2(2) = 4\), \(\Delta y = 4(0.5) = 2 \Rightarrow y(1) \approx 4\).

Exact: \(e^2 \approx 7.389\). Euler strongly underestimates because \(y = e^{2x}\) is steeply concave up.

\(y(1) \approx 4\)
Warm-up

Given \(\dfrac{dy}{dx} = x - 2y\) with \(y(1) = 2\), use Euler's method with 2 equal steps to approximate \(y(2)\).

Hint

\(\Delta x = 0.5\). From the quiz earlier, after step 1 you're at \((1.5, 0.5)\).

Solution

Step 1 at \((1, 2)\): \(\frac{dy}{dx} = 1 - 4 = -3\), \(\Delta y = -1.5 \Rightarrow y(1.5) \approx 0.5\).

Step 2 at \((1.5, 0.5)\): \(\frac{dy}{dx} = 1.5 - 2(0.5) = 0.5\), \(\Delta y = 0.5(0.5) = 0.25 \Rightarrow y(2) \approx 0.75\).

\(y(2) \approx 0.75\)
Medium

Given \(\dfrac{dy}{dx} = y - x\) with \(y(3) = 2\), use Euler's method with 2 equal steps to approximate \(y(2)\).

Hint

Going backwards: \(\Delta x = \frac{2-3}{2} = -0.5\).

Solution

Step 1 at \((3, 2)\): \(\frac{dy}{dx} = 2 - 3 = -1\), \(\Delta y = (-1)(-0.5) = +0.5 \Rightarrow y(2.5) \approx 2.5\).

Step 2 at \((2.5, 2.5)\): \(\frac{dy}{dx} = 2.5 - 2.5 = 0\), \(\Delta y = 0 \Rightarrow y(2) \approx 2.5\).

\(y(2) \approx 2.5\)
Medium

Given \(\dfrac{dy}{dx} = xy\) with \(y(0) = 1\), use Euler's method with step size \(\Delta x = 0.2\) to approximate \(y(0.6)\).

Hint

Three steps: \(x = 0 \to 0.2 \to 0.4 \to 0.6\). Notice the first slope is \(0\)!

Solution

Step 1 at \((0, 1)\): \(\frac{dy}{dx} = 0\), \(\Delta y = 0 \Rightarrow y(0.2) \approx 1\).

Step 2 at \((0.2, 1)\): \(\frac{dy}{dx} = 0.2\), \(\Delta y = 0.04 \Rightarrow y(0.4) \approx 1.04\).

Step 3 at \((0.4, 1.04)\): \(\frac{dy}{dx} = 0.416\), \(\Delta y = 0.0832 \Rightarrow y(0.6) \approx 1.1232\).

\(y(0.6) \approx 1.1232\) (exact is \(e^{0.18} \approx 1.197\))
AP-style

Let \(y = f(x)\) be the particular solution to \(\dfrac{dy}{dx} = y - 2x\) with \(f(1) = 4\).
(a) Use Euler's method with 2 equal steps starting at \(x = 1\) to approximate \(f(2)\).
(b) Find \(\dfrac{d^2y}{dx^2}\) in terms of \(x\) and \(y\), and evaluate it at \((1, 4)\).

Hint

For (b), differentiate \(y - 2x\) with respect to \(x\), then replace \(\frac{dy}{dx}\) with \(y - 2x\).

Solution

(a) \(\Delta x = 0.5\).

At \((1, 4)\): \(\frac{dy}{dx} = 4 - 2 = 2\), \(\Delta y = 2(0.5) = 1 \Rightarrow f(1.5) \approx 5\).

At \((1.5, 5)\): \(\frac{dy}{dx} = 5 - 3 = 2\), \(\Delta y = 2(0.5) = 1 \Rightarrow f(2) \approx 6\).

(b) \(\frac{d^2y}{dx^2} = \frac{dy}{dx} - 2 = (y - 2x) - 2 = y - 2x - 2\). At \((1, 4)\): \(4 - 2 - 2 = 0\).

(a) \(f(2) \approx 6\) (in fact \(f(x) = 2x + 2\) is the exact linear solution!); (b) \(\frac{d^2y}{dx^2} = y - 2x - 2\), value \(0\) at \((1,4)\).