Tutorials › Calculus I › Deriving Forward Euler from Tangent-Line Approximation

Euler's Method and Numerical Solutions · Tutorial 1428 of 1495

Deriving Forward Euler from Tangent-Line Approximation

See why a tangent-line step produces the forward Euler rule and how bounded curvature quantifies the part the approximation leaves out.

Advanced 11 min read

What You'll Learn

  • Identify the tangent line to a solution curve at a known time and value.
  • Derive the forward Euler update from the differential equation’s slope.
  • Distinguish the tangent-line prediction from the solution’s actual next value.
  • Use differentiability to describe the size of the discarded part.
  • Bound that part using a bound on the solution’s second derivative.
  • Check Euler steps and curvature bounds in concrete initial-value problems.

From a Local Slope to a Numerical Step

A differential equation specifies how a solution changes, but it does not always give the solution’s values in a convenient explicit form. A numerical method can estimate a value at a nearby time by using information available at the current time. For forward Euler, that information is the solution’s current value and its slope there.

The geometric idea is simple: near a point on a differentiable curve, the curve is approximated by its tangent line. The numerical step follows that tangent line for a chosen time increment. The approximation is local: it uses the slope at the start of the step, not the slope at the end.

We will derive the update and make precise what is discarded when the curved solution is replaced by its tangent. In particular, differentiability alone gives a first-order approximation; a bound on the solution’s second derivative gives a quantitative bound on the error in that one step.

The Tangent Line at a Known Point

Consider a scalar initial-value problem

$$ y'=f(t,y), \qquad y(t_n)=y_n. $$

Here \(t_n\) is the current time, \(y_n\) is the value of the solution at that time, and \(f(t_n,y_n)\) is the slope specified by the differential equation at the current point. Assume the solution is differentiable near \(t_n\). The tangent line to its graph at \((t_n,y_n)\), written as a function of time \(t\), is

$$ L(t)=y_n+y'(t_n)(t-t_n). $$

The differential equation gives \(y'(t_n)=f(t_n,y_n)\). If the next time is \(t_{n+1}=t_n+h\), then the tangent line’s value at that time is

$$ L(t_{n+1}) =y_n+f(t_n,y_n)(t_{n+1}-t_n) =y_n+h f(t_n,y_n). $$

Using this tangent-line value as the approximation at the next time gives the forward Euler update.

Definition: For a step of length \(h=t_{n+1}-t_n\), the forward Euler update for \(y'=f(t,y)\) is $$ y_{n+1}=y_n+h f(t_n,y_n). $$ Here \(y_n\) is the numerical approximation at \(t_n\). The formula uses the slope at the start of the step. A positive \(h\) advances time; the same algebraic formula also applies to a negative step when stepping backward.

The value \(y_{n+1}\) produced by the rule is generally an approximation, not an assertion that the exact solution has that value. To keep the distinction clear, write \(y(t_{n+1})\) for the exact solution value and \(y_{n+1}\) for the Euler approximation. Their difference measures what the tangent-line step leaves out at that step.

Why the Update Is a Tangent-Line Approximation

The derivative describes the limiting rate of change as the time increment shrinks. In precise terms, differentiability at \(t_n\) means

$$ \lim_{h\to 0} \frac{y(t_n+h)-y(t_n)-h y'(t_n)}{h}=0. $$

Thus, for small \(h\), the difference between the actual solution value and its tangent-line value is smaller than a fixed multiple of \(|h|\) in the limiting sense. The tangent-line expression is therefore the natural first-order estimate of the solution at the nearby time. Substituting \(y(t_n)=y_n\) and \(y'(t_n)=f(t_n,y_n)\) into that expression yields the forward Euler rule.

Key idea: Forward Euler does not guess a new slope at the end of the step. It starts at the known point, follows the tangent line whose slope is determined there, and uses that line’s value at the next time.

Quantifying What the Tangent Line Discards

Differentiability explains why the tangent line is a good approximation for sufficiently small steps, but it does not by itself give a numerical error bound. For a bound, suppose the solution has a continuous second derivative on the interval between \(t_n\) and \(t_n+h\), and suppose

$$ |y''(t)|\le M $$

throughout that interval, for some constant \(M\ge 0\). The exact difference between the solution and its tangent line at the end of the step is

$$ R(h)=y(t_n+h)-y(t_n)-h y'(t_n). $$

This difference can be bounded directly. For \(h\ge 0\), the fundamental theorem of calculus gives

$$ \begin{aligned} R(h) &=\int_0^h \bigl(y'(t_n+s)-y'(t_n)\bigr)\,ds. \end{aligned} $$

For each \(s\) between \(0\) and \(h\), the mean value theorem applied to \(y'\) gives \(|y'(t_n+s)-y'(t_n)|\le Ms\). Therefore

$$ |R(h)| \le \int_0^h Ms\,ds =\frac{M h^2}{2}. $$

The same bound, with \(|h|\) in place of \(h\), holds for a negative step by integrating over the interval in the reverse direction. Since the Euler value is the tangent-line value, this is also a bound on the difference between the exact next value and the Euler prediction when the starting value is exact.

Bound: If \(|y''(t)|\le M\) between \(t_n\) and \(t_n+h\), then the one-step difference between the solution and its tangent-line value satisfies $$ \left|y(t_n+h)-\bigl(y(t_n)+h y'(t_n)\bigr)\right| \le \frac{M h^2}{2}. $$ The bound requires a second derivative and a bound on it over the whole step. The size of the step enters quadratically.

This bound describes the part discarded by one tangent-line step under the stated assumptions. It is not a statement about the total difference after many Euler steps: that would also depend on how errors from earlier steps affect later values.

Worked Examples

Worked Example: A Step with a Time-Dependent Slope

Consider \(y'=2t+1\) with \(y(1)=2\). Take a forward Euler step of length \(h=0.5\). At the starting point, the slope is

$$ f(1,2)=2(1)+1=3. $$

The next time is \(t_1=1+0.5=1.5\), and the update gives

$$ y_1=2+0.5(3)=2+1.5=3.5. $$

Check the tangent line: it is \(L(t)=2+3(t-1)\). It passes through \((1,2)\), and its slope is \(3\), which is the differential equation’s slope at that point. At \(t=1.5\), \(L(1.5)=2+3(0.5)=3.5\), as in the update.

For comparison, integrating the equation gives \(y=t^2+t+C\). The initial condition yields \(2=1+1+C\), so \(C=0\) and \(y(1.5)=1.5^2+1.5=3.75\). The Euler prediction is \(3.5\), so the exact value exceeds it by \(3.75-3.5=0.25\). Here \(y''=2\), so \(M=2\) and the bound is \(M h^2/2=2(0.5)^2/2=0.25\). The bound matches the actual one-step difference.

Worked Example: A Curvature Bound for Exponential Decay

Consider \(y'=-2y\) with \(y(0)=4\), and take one Euler step with \(h=0.25\). The starting slope is

$$ f(0,4)=-2(4)=-8. $$

Thus the Euler value at \(t_1=0.25\) is

$$ y_1=4+0.25(-8)=4-2=2. $$

The tangent line is \(L(t)=4-8t\). It starts at \(4\) when \(t=0\), has slope \(-8\), and gives \(L(0.25)=4-8(0.25)=2\), checking the update.

The exact solution is \(y(t)=4e^{-2t}\), since its derivative is \(-8e^{-2t}=-2y(t)\) and \(y(0)=4\). Hence \(y(0.25)=4e^{-0.5}\), which is approximately \(2.4261\) to four decimal places. The exact value exceeds the Euler value by \(4e^{-0.5}-2\), approximately \(0.4261\).

Differentiate the solution twice: \(y''=4y\). On the step interval \([0,0.25]\), \(y\) decreases from \(4\), so \(0<y(t)\le 4\) and \(|y''(t)|=4y(t)\le16\). We may take \(M=16\). The bound is

$$ \frac{M h^2}{2} =\frac{16(0.25)^2}{2} =\frac{16(0.0625)}{2} =0.5. $$

The observed difference, approximately \(0.4261\), is less than \(0.5\), as required. The estimate is a guaranteed upper bound; it need not equal the actual difference.

Worked Example: A Step Starting at a Later Time

Consider \(y'=t^2\), \(y(1)=2\), and take a step of length \(h=0.5\). The starting slope is \(f(1,2)=1^2=1\). Therefore

$$ t_1=1+0.5=1.5, \qquad y_1=2+0.5(1)=2.5. $$

The tangent line is \(L(t)=2+(t-1)\), so \(L(1)=2\), its slope is \(1\), and \(L(1.5)=2+0.5=2.5\). This verifies the Euler prediction from the tangent line.

An exact solution is \(y(t)=2+(t^3-1)/3\): its derivative is \(t^2\), and substituting \(t=1\) gives \(y(1)=2\). Thus

$$ y(1.5) =2+\frac{1.5^3-1}{3} =2+\frac{3.375-1}{3} =2+\frac{2.375}{3} =2+\frac{19}{24} =\frac{67}{24}. $$

The Euler value \(2.5=5/2=60/24\) is below the exact value by \(67/24-60/24=7/24\). Since \(y''=2t\), on \([1,1.5]\) we have \(|y''(t)|\le3\), so \(M=3\) is valid. The curvature bound gives

$$ \frac{M h^2}{2} =\frac{3(0.5)^2}{2} =\frac{3(0.25)}{2} =\frac{3}{8} =\frac{9}{24}. $$

The actual difference \(7/24\) is less than the bound \(9/24\). This checks both the direction and the size estimate for the discarded part.

A Common Mistake: Forgetting the Step Length

The slope is a rate of change per unit of time. To convert that rate into a predicted change in the dependent variable, it must be multiplied by the length of the time step. Omitting \(h\) confuses a slope with a change in value.

For example, in the first worked example the starting value is \(2\), the starting slope is \(3\), and the step length is \(0.5\). The incorrect calculation \(y_1=2+3=5\) adds the slope directly to the value. The correct change over this step is \(0.5(3)=1.5\), so

$$ y_1=2+0.5(3)=3.5. $$

The tangent line check confirms the correction: \(L(1.5)=2+3(1.5-1)=3.5\), not \(5\). Always include the time increment between the starting and next times.

When the Curvature Bound Is Useful

The tangent-line derivation explains the structure of the update: current value plus step length times current slope. The curvature bound adds a way to assess how far a smooth solution might bend away from that line over one step. A larger bound on \(|y''|\) allows a larger possible discrepancy; a shorter step reduces the bound in proportion to \(h^2\).

The estimate has conditions. The solution must have a second derivative on the interval, and \(M\) must bound its absolute value throughout the interval, not merely at the starting point. If those conditions are unavailable, differentiability still justifies the tangent-line approximation in the limiting sense, but the stated numerical bound cannot be claimed. These statements concern a single step begun at an exact solution value; they do not, on their own, bound errors accumulated over a sequence of steps.

Summary

At a known point \((t_n,y_n)\), the differential equation supplies the tangent slope \(f(t_n,y_n)\). Following that tangent line for a time increment \(h\) gives \(y_n+h f(t_n,y_n)\), which is the forward Euler update. If the solution’s second derivative is bounded in magnitude by \(M\) over the step, the difference between the exact next value and the tangent-line prediction is at most \(M h^2/2\). The update is therefore a local linear approximation, with its discarded part controlled by the solution’s curvature when the required smoothness and bound are available.

Check Your Understanding

Use the tangent-line interpretation and state any assumptions needed for an error bound.

  1. For \(y'=t+y\), \(y(0)=1\), and \(h=0.2\), what slope is used and what is the forward Euler value at \(t=0.2\)?
  2. Write the tangent line at a general point \((t_n,y_n)\) for a solution of \(y'=f(t,y)\).
  3. Why does the Euler update use the slope at \(t_n\), rather than a slope evaluated at \(t_{n+1}\)?
  4. If \(|y''(t)|\le 6\) over a step of length \(0.1\), what upper bound does the curvature estimate give for the one-step tangent-line difference?
  5. Does differentiability alone guarantee the bound \(M h^2/2\)? Explain what additional condition the bound requires.

Test yourself: Calculus I final exam practice

Ready to check what you know? Work a full-length practice final, then open the complete worked solutions.

Want all 1,114 practice problems?

This tutorial covers one topic. Calc Pass covers the full Calculus AB & BC curriculum (the core of Calculus I and II): full review, every practice question, and step-by-step solutions to each one.

QR code to download the Calc Pass app

Get the Calc Pass App

Scan to download and practice on the go, with instant scoring.

Calc Pass Volume 1: 1,114 Practice Questions book cover

Vol. 1: 1,114 Questions

The complete practice question bank, organized by AB & BC topic.

View on Amazon
Calc Pass Volume 2: Solutions Manual book cover

Vol. 2: Solutions Manual

Fully worked solutions to every question in Volume 1.

View on Amazon