Interpret the approximation's error
How far off is the path?
The curve through \((0, 4)\) follows \(\frac{dy}{dx} = -y\) and has the formula \(y = 4e^{-x}\), so its exact values are known. The orange path is an Euler path to \(x = 2\), and its end gives the Euler value.
The red gap at x = 2 is the error, the exact value minus the Euler value. With step size 1, the path ends at 0 and the error is about 0.54.
Press a smaller step size. The path has more steps and the gap shrinks, to about 0.29 for 0.5 and 0.14 for 0.25.
Halving the step size about halves the error, and the path ends below the curve every time.
Above or below the curve
One Euler step follows the tangent line at the start. The curve leaves the line because it bends.
Move the slider to the right to bend the curve upward. A curve that is concave up lies above its tangent line, so the Euler value is too small.
Move the slider to the left to bend the curve downward. A curve that is concave down lies below its tangent line, so the Euler value is too large.
The direction of the error depends on the concavity, not on whether the curve rises or falls.
Notation
When the exact value is known, subtract the Euler value from it. The red gap shows the error.
\[\cr{\text{error}} = y_{\text{exact}} - y_{\text{Euler}}\]A positive error means the Euler value is too small, because the curve is above the path. A negative error means it is too large.
When no exact value is known, use concavity. To find \(y''\), differentiate the right side of the equation with respect to \(x\). Since \(y\) depends on \(x\), the chain rule gives each \(y\) a factor of \(y'\).
If \(y'' > 0\) over the whole interval, the Euler values are too small. If \(y'' < 0\), they are too large.
\[\begin{aligned} y'' > 0 &\;\Rightarrow\; \text{too small} \\ y'' < 0 &\;\Rightarrow\; \text{too large} \end{aligned}\]
When it fails
The rule needs \(y''\) to keep one sign on the whole interval. Run Euler's method for \(\frac{dy}{dx} = x^2 - 1\), where \(y'' = 2x\) changes sign at \(x = 0\).
For x < 0 the curve is concave down, so the path ends above it, with a gap of 0.29 at x = 0. For x > 0 the curve is concave up, so the path moves back toward it and the gap shrinks to 0.08 at x = 1.
Example 1: a rising curve that bends down
Let \(y = f(x)\) be the solution to \(\dfrac{dy}{dx} = 6 - 2y\) with \(f(0) = 0\). Two Euler steps of size 0.5 approximate \(f(1)\). The exact solution is \(f(x) = 3 - 3e^{-2x}\). Find the error. Is the Euler value too large or too small?
Find the Euler value. The slope at \((0, 0)\) is 6, and the slope at \((0.5, 3)\) is 0.
\[\begin{aligned} y_1 &= 0 + 0.5(6) = 3 \\ y_2 &= 3 + 0.5(0) = 3 \end{aligned}\]Find the exact value at \(x = 1\).
\[f(1) = 3 - 3e^{-2} \approx 2.59\]Subtract the Euler value from the exact value. The error is negative, so the Euler value is too large.
\[\cr{2.59 - 3 = -0.41}\]Check with concavity. Differentiate \(y' = 6 - 2y\) with the chain rule. The curve stays below 3, so \(y'' < 0\), the curve is concave down, and the Euler value is too large.
\[\begin{aligned} y'' &= -2y' \\ &= -2(6 - 2y) = 4y - 12 \end{aligned}\]
Example 2: a falling curve that bends up
Let \(y = f(x)\) be the solution to \(\dfrac{dy}{dx} = x - 3\) with \(f(0) = 4\). Two Euler steps of size 1 approximate \(f(2)\). Is the Euler value too large or too small?
Find the Euler value. The slope at \((0, 4)\) is \(-3\), and the slope at \((1, 1)\) is \(-2\).
\[\begin{aligned} y_1 &= 4 + 1(-3) = 1 \\ y_2 &= 1 + 1(-2) = -1 \end{aligned}\]A tempting wrong move: The curve falls, so the path stays above it. The Euler value is too large.
\[y' < 0 \;\Rightarrow\; \text{too large}\]The curve bends upward, so it lies above its tangent lines. The path ends at \(-1\), below the curve at 0, so the Euler value is too small.
Use concavity, not the direction of the curve. Differentiate \(y' = x - 3\). The result is positive, so the curve is concave up and the Euler value is too small.
\[y'' = 1 > 0\]As a check, integrating \(x - 3\) with \(f(0) = 4\) gives \(f(x) = \tfrac{x^2}{2} - 3x + 4\), so \(f(2) = 0\) and the error is positive.
\[\cr{0 - (-1) = 1}\]
Practice
Let \(y = f(x)\) be the solution to \(\dfrac{dy}{dx} = \dfrac{1}{x}\) for \(x > 0\), with \(f(1) = 0\). Two Euler steps of size 0.5 approximate \(f(2)\). Use \(y''\) to decide whether the value is too large or too small. Check with \(f(x) = \ln x\).
Differentiate \(\frac{1}{x}\) to find \(y''\). Its sign shows whether the curve lies above or below the orange steps.
Solution
Find the Euler value. The slope at \((1, 0)\) is 1, and the slope at \((1.5, 0.5)\) is \(\frac23\).
\[\begin{aligned} y_1 &= 0 + 0.5(1) = 0.5 \\ y_2 &= 0.5 + 0.5\left(\tfrac23\right) = \cy{\tfrac56} \end{aligned}\]Differentiate \(\frac1x\). The result is negative for every \(x\), so the curve is concave down and the Euler value is too large.
\[y'' = -\dfrac{1}{x^2} < 0\]As a check, the exact value is \(f(2) = \ln 2\), and the error is negative.
\[\ln 2 - \tfrac56 \approx \cr{-0.14}\]
Questions
The graph shows the solution of \(\dfrac{dy}{dx} = x\) through \((0, 1)\). One Euler step of size 2 starts there and ends at the orange point on the right.
The curve is at height 3 when \(x = 2\). The orange point gives the Euler value. What is the error?
- 2
- −2
- 3
- 1
Answer
2
The curve bends upward. What does this mean for the Euler values along this curve?
- They are below the curve, so they are too small.
- They are above the curve, so they are too large.
- They are on the curve.
Answer
They are below the curve, so they are too small.
Let \(y = f(x)\) be the solution to \(\dfrac{dy}{dx} = 2y - 6\) with \(f(0) = 1\). One Euler step of size 0.5 approximates \(f(0.5)\). Which statement is correct?
- The value is \(-1\), and it is too large.
- The value is \(-1\), and it is too small.
- The value is \(-3\), and it is too small.
- The value is 1, and it is too large.
Answer
The value is \(-1\), and it is too large.
Summary
You find the error as the exact value minus the Euler value, and the sign of \(y''\) gives its direction.
This works because a curve that bends up stays above its tangent lines, and one that bends down stays below them.
You use it when a problem asks whether an Euler value is too large or too small.
This is one of four skills in topic 7.5 of Which & Why: AP Calculus.