Tutorials › Calculus I › The Forward Euler Update Rule

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

The Forward Euler Update Rule

Use the current point and derivative to make one forward Euler step, then check the updated point and solution value.

Advanced 9 min read

What You'll Learn

  • State the forward Euler formulas for updating the independent variable and solution value.
  • Evaluate the derivative using the current point, not the point being estimated.
  • Track the units and signs in an Euler update.
  • Distinguish a numerical estimate from the exact solution value.
  • Check an update using its implied slope and the original differential equation.

From a Current Value to a New Estimate

A differential equation gives a rate of change. For an initial-value problem, that rate is specified by an equation such as \(y'=f(x,y)\), together with a known value of the solution at a particular input. The equation tells us how the solution is changing at a point, but it does not usually give the solution value at every later input by direct calculation.

The forward Euler method uses the derivative at a known point to estimate the solution at a nearby, larger value of the independent variable. Its update has two parts: first move the independent variable forward; then use the current derivative to estimate the corresponding change in the solution.

Definition: Suppose \(y'=f(x,y)\), and suppose an approximate solution value \(y_n\) is known at the current independent-variable value \(x_n\). For a chosen positive step size \(h\), the forward Euler update is
$$ x_{n+1}=x_n+h, \qquad y_{n+1}=y_n+h f(x_n,y_n). $$
Here \(y_{n+1}\) is the next approximate solution value. The derivative is evaluated at the current point \((x_n,y_n)\).

The subscript \(n\) labels the current step; it does not mean that \(y_n\) is the exact solution value. The method uses the differential equation to find the current slope \(f(x_n,y_n)\), then multiplies that slope by the step size. The resulting change is added to the current solution estimate.

Reading the Update Correctly

The first equation, \(x_{n+1}=x_n+h\), advances the independent variable. Because \(h>0\), this is a forward step. The second equation advances the solution estimate. It can also be written as

$$ y_{n+1}-y_n=h f(x_n,y_n). $$

This form emphasizes the central calculation: change in the approximate solution = step size times current derivative. If the derivative is positive, the update increases the solution value; if it is negative, the update decreases it. If the derivative is zero at the current point, this step leaves the solution estimate unchanged.

The point used to evaluate the derivative is important. The method uses \(f(x_n,y_n)\), the derivative at the known current point. It does not use \(f(x_{n+1},y_{n+1})\), because those are the values being estimated. Evaluating the derivative at the new point would define a different update rule and would require the unknown new solution value.

Units provide a useful check. If \(x\) is measured in seconds and \(y\) in grams, then \(dy/dx\) has units of grams per second. Multiplying the derivative by a step measured in seconds gives grams, the units of a change in \(y\). Thus it can be added to the current value of \(y\).

Why the Formula Is Reasonable

At a point where the solution is differentiable, its derivative describes its instantaneous rate of change. Over a short interval of length \(h\), the forward Euler method estimates the change by using that current rate throughout the interval. The estimate is \(h f(x_n,y_n)\).

The reason this calculation is internally consistent is exact: the straight segment from \((x_n,y_n)\) to the updated point has slope equal to the derivative at the current point. Indeed, the update gives \(x_{n+1}-x_n=h\) and \(y_{n+1}-y_n=h f(x_n,y_n)\), so

$$ \frac{y_{n+1}-y_n}{x_{n+1}-x_n} = \frac{h f(x_n,y_n)}{h} = f(x_n,y_n). $$

Thus the step moves forward by \(h\) while using the current slope as the estimated rate across that step. The calculation does not claim that the actual derivative remains constant over the interval. If the rate changes, the exact solution may end the step above or below the Euler estimate. The update is a numerical approximation, not a guarantee of an exact solution value.

Worked Examples

Worked Example: A Decreasing Slope at the Current Point

Suppose \(y'=2x-y\), and the current point is \(x_n=1\), \(y_n=3\). Take \(h=0.2\). First evaluate the derivative at the current point:

$$ f(x_n,y_n)=2(1)-3=2-3=-1. $$

Advance the independent variable:

$$ x_{n+1}=x_n+h=1+0.2=1.2. $$

Now update the solution estimate using the current derivative:

$$ y_{n+1}=y_n+h f(x_n,y_n) =3+(0.2)(-1) =3-0.2 =2.8. $$

The Euler estimate at \(x=1.2\) is \(2.8\). Check the step by calculating its slope:

$$ \frac{2.8-3}{1.2-1} = \frac{-0.2}{0.2} =-1. $$

This agrees with the derivative \(2(1)-3=-1\) at the current point. The check confirms that the update used the given current slope correctly.

Worked Example: A Decay Rate

Suppose an amount \(y\), measured in milligrams, satisfies \(y'=-0.4y\), where time \(x\) is measured in hours. At the current time \(x_n=2\), the amount is \(y_n=10\) milligrams. Take a step of \(h=0.5\) hours. The current derivative is

$$ f(x_n,y_n)=-0.4(10)=-4 \quad\text{milligrams per hour}. $$

Advance time by half an hour:

$$ x_{n+1}=2+0.5=2.5\text{ hours}. $$

The estimated change in amount is the rate multiplied by the time step:

$$ h f(x_n,y_n) = (0.5\text{ hours})(-4\text{ milligrams per hour}) = -2\text{ milligrams}. $$

Therefore the updated estimate is

$$ y_{n+1}=10+(-2)=8\text{ milligrams}. $$

Check the arithmetic using the original update: \(10+(0.5)(-0.4)(10)=10-2=8\). The change is negative, as expected for the negative rate, and its units are milligrams.

Worked Example: A Positive Current Derivative

Suppose \(y'=x+y\), with current values \(x_n=0\) and \(y_n=1\), and choose \(h=0.25\). Evaluate the derivative at the current point:

$$ f(0,1)=0+1=1. $$

The next independent-variable value is

$$ x_{n+1}=0+0.25=0.25. $$

The solution estimate becomes

$$ y_{n+1}=1+(0.25)(1)=1.25. $$

To check the update, calculate the slope of the segment between the two points:

$$ \frac{1.25-1}{0.25-0} = \frac{0.25}{0.25} =1. $$

The differential equation gives \(f(0,1)=1\) at the current point, so the updated value is consistent with the current slope.

A Common Error: Using the Wrong Slope

A common mistake is to evaluate the derivative at the new independent-variable value while keeping the old solution value. For example, in the first worked example, someone might write

$$ f(1.2,3)=2(1.2)-3=-0.6 $$

and then calculate \(3+(0.2)(-0.6)=2.88\). This is not the forward Euler update from \((1,3)\). It uses a slope evaluated at \(x=1.2\), rather than the required current slope \(f(1,3)=-1\). The correct calculation is

$$ y_{n+1}=3+(0.2)f(1,3) =3+(0.2)(-1) =2.8. $$

The rule is simple: identify the current point first, evaluate the derivative there, and only then apply the update. Do not substitute a new value for an input that the method requires to remain at its current value.

Applying the Rule Repeatedly

After one update, the newly estimated point can serve as the current point for another update. For each step, use the differential equation at the current estimated point, calculate its derivative, and add the derivative multiplied by the step size. The result of one step becomes the input value for the next.

With a fixed step size \(h\), this repeated calculation is expressed by the same pair of formulas at each step:

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

At every update, the subscripted values are the current numerical inputs. Even if the initial value is exact, later \(y_n\) values are generally estimates. It is useful to keep that distinction explicit when reporting results.

Summary

The forward Euler update advances the independent variable by \(h\) and estimates the solution change as \(h\) times the derivative at the current point. Its essential formulas are

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

To use them reliably, evaluate \(f\) at \((x_n,y_n)\), keep track of the sign and units, and label the new solution value as an estimate. A final check is to divide the estimated change in \(y\) by the change in \(x\); the result should equal the derivative used for that step.

Check Your Understanding

For each question, identify the current point and use the current derivative in the update.

  1. If \(y'=3x+y\), \(x_n=1\), \(y_n=2\), and \(h=0.1\), what are \(x_{n+1}\) and \(y_{n+1}\)?
  2. If \(y'=-2y\), \(y_n=4\), and \(h=0.25\), what is the Euler estimate for the next \(y\)-value?
  3. Why must the derivative in the forward Euler formula be evaluated at \((x_n,y_n)\)?
  4. If \(y_n\) is measured in metres and \(x\) in seconds, what are the units of \(f(x_n,y_n)\) and of \(h f(x_n,y_n)\)?
  5. For an update with \(h=0.4\), \(y_n=5\), and \(f(x_n,y_n)=2\), verify the next value by checking the slope of the step.

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