0% found this document useful (0 votes)
96 views4 pages

4.3 Euler's Method: Linear Approximation

Euler's method is a numerical method that uses successive linear approximations to estimate solutions to explicit first-order differential equations. It starts with an initial condition and uses the slope at that point to estimate the next point via linear approximation. This process is repeated, using the estimated point as the new base point, to trace out the solution curve through a sequence of linear segments. The method is demonstrated through examples of estimating solutions to initial value problems.

Uploaded by

Jaden Moniez
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
96 views4 pages

4.3 Euler's Method: Linear Approximation

Euler's method is a numerical method that uses successive linear approximations to estimate solutions to explicit first-order differential equations. It starts with an initial condition and uses the slope at that point to estimate the next point via linear approximation. This process is repeated, using the estimated point as the new base point, to trace out the solution curve through a sequence of linear segments. The method is demonstrated through examples of estimating solutions to initial value problems.

Uploaded by

Jaden Moniez
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

4.

3 Euler’s Method
Euler’s method is a numerical method that can be used to approximate the solutions
to explicit first-order equations. It is based on making successive linear approximations
to the solution.

Linear Approximation
Suppose we are given a single data point ( x0 , y0 ) for a function y ( x ) , and suppose we
also know the value of the derivative y 0 ( x0 ) at this point. In this case, nearby points
( x, y ) on the graph of the function obey the approximate formula

∆y
≈ y0 ( x0 ) .
∆x
Here ∆x  x − x0 is the distance in the x direction, and ∆y  y − y0 is the distance
in the y direction, as shown in Figure 1. This equation is only approximately correct,
since it assumes that the average slope between ( x 0 , y0 ) and ( x, y ) is equal to y 0 ( x0 ) .
We can use this formula to estimate y ( x ) for x close to x0 . Specifically, we compute
a Figure 1: The ratio of ∆y to ∆x is ∆x  x − x 0 , and then estimate ∆y using the formula
approximately equal to the slope at ( x 0 , y0 ) .
∆y ≈ y 0 ( x0 ) ∆x

Adding this ∆y to y0 gives an approximate value for y ( x ) . This is called a linear


approximation, because the estimated point actually lies on the tangent line to the
graph of the function, as shown in Figure 2.

EXAMPLE 1
Suppose y ( x ) is a differentiable function satisfying y (1)  3 and y 0 (1)  0.5. Use a linear
approximation to estimate the value of y (1.04) .

a Figure 2: The estimated point lies on the SOLUTION Here we are changing x by the small amount ∆x  0.04. The corresponding
tangent line to the graph of y ( x ) at the point change in y is
( x 0 , y0 ) . ∆y ≈ y 0 (1) ∆x  (0.5)(0.04)  0.02.
Then
y (1.04)  y (1) + ∆y ≈ 3 + 0.02  3.02.

Linear approximation is quite useful in the case of explicit first-order equations,


since we have a formula for y 0 in terms of x and y. Given an initial condition ( x0 , y0 ) ,
we can plug these coordinates directly into the differential equation to get the value
of y 0 ( x0 ) .

EXAMPLE 2
Let y ( x ) be the solution to the following initial value problem:

y 0  3y 2 + ln x, y (1)  0.5.

Estimate y (1.002) .

SOLUTION Plugging x  1 and y  0.5 into the differential equation itself gives us the value
of y 0 (1) :
y 0 (1)  3 (0.5) 2 + ln (1)  0.75.
EULER’S METHOD 2

For ∆x  0.002, the linear approximation gives

∆y ≈ y 0 (1) ∆x  (0.75)(0.002)  0.0015.

The actual value of y (1.002) in this Then


example is about 0.501507, so the linear y (1.002)  y (1) + ∆y ≈ 0.5 + 0.0015  0.5015.
approximation is fairly accurate.

Euler’s Method
The idea of Euler’s method is to use repeated linear approximations to estimate a
sequence of points that lie on a solution curve. Starting with an initial condition ( x0 , y0 ) ,
we use a linear approximation to estimate a nearby point on the solution curve. We
then use a linear approximation based at the new point to estimate yet another point,
and so forth.

EXAMPLE 3
Let y ( x ) be the solution to the following initial value problem:

y 0  sin y − 3x, y (0)  1.

Use Euler’s method to estimate y (0.1) , y (0.2) , and y (0.3) .

SOLUTION The idea is to use three linear approximations, each with ∆x  0.1. We will keep
track of three decimal places during the process.
1st Approximation
We start by making a linear approximation to estimate y (0.1) . We have

y 0 (0)  sin (1) − 3 (0) ≈ 0.841


so ∆y ≈ y 0 (0) ∆x  (0.841)(0.1)  0.084
so y (0.1) ≈ y (0) + ∆y  1 + 0.084  1.084.

2nd Approximation
Next we make a linear approximation to estimate y (0.2) , using the the point (0.1, 1.084)
from the previous approximation as the base point. We have

y 0 (0.1) ≈ sin (1.084) − 3 (0.1) ≈ 0.584


so ∆y  y 0 (0.1) ∆x ≈ (0.584)(0.1) ≈ 0.058
so y (0.2)  y (0.1) + ∆y ≈ 1.084 + 0.058  1.142.

3rd Approximation
Finally we make a linear approximation to estimate y (0.3) , using the the point (0.2, 1.142)
from the previous approximation as the base point. We have

y 0 (0.2) ≈ sin (1.142) − 3 (0.2) ≈ 0.309


so ∆y  y 0 (0.2) ∆x ≈ (0.309)(0.1) ≈ 0.031
so y (0.3)  y (0.2) + ∆y ≈ 1.142 + 0.031  1.173.

a Figure 3: The three linear Figure 3 shows the three linear approximations in this example. By changing slope twice, we
manage to follow the slope field much better than we could with a single linear approximation.
approximations in Example 3.
EULER’S METHOD 3

When using Euler’s method, we typically use the same step size ∆x for all of the
linear approximations. It is common to use a table to keep track of the estimates in each
step, as shown in Table 4.1. Each value of y 0 is computed from the x and y values in
x 0.0 0.1 0.2 0.3
the same column using the differential equation, and each value of y is computed from
y 1.000 1.084 1.142 1.173 the y and y 0 values in the previous column using the following linear approximation
y0 0.841 0.584 0.309 — formula:

a Table 4.1: Table of values for the linear ynew ≈ yold + yold
0
∆x
approximations used in Example 1.
Note that this formula combines the two parts of the linear approximation (computing
∆y and then adding it to yold ) into a single equation.

EXAMPLE 4
Let y ( x ) be the solution to the following initial value problem:

y 0  ( x − 1) 2 − y 2 , y (0)  0.5.

Use Euler’s method with step size ∆x  0.5 to estimate y (2.5) , keeping track of four decimal
places during the procedure.

SOLUTION Euler’s method results in the following table of values:

x 0.0 0.5 1.0 1.5 2.0 2.5

y 0.5 0.8750 0.6172 0.4267 0.4607 0.8546

y0 0.75 −0.5156 −0.3809 0.0679 0.7878 —

Here are the calculations that were used to produce this table:

y 0 (0.0)  ( x − 1) 2 − y 2  (0.0 − 1) 2 − (0.5) 2  0.75


y (0.5)  y (0.0) + y 0 (0.0) ∆x ≈ (0.5) + (0.75)(0.5)  0.875

y 0 (0.5)  ( x − 1) 2 − y 2 ≈ (0.5 − 1) 2 − (0.875) 2 ≈ −0.5156


y (1.0)  y (0.5) + y 0 (0.5) ∆x ≈ (0.875) + (−0.5156)(0.5)  0.6172

y 0 (1.0)  ( x − 1) 2 − y 2 ≈ (1.0 − 1) 2 − (0.6172) 2 ≈ −0.3809


y (1.5)  y (1.0) + y 0 (1.0) ∆x ≈ (0.6172) + (−0.3809)(0.5) ≈ 0.4267

y 0 (1.5)  ( x − 1) 2 − y 2 ≈ (1.5 − 1) 2 − (0.4267) 2 ≈ 0.0679


y (2.0)  y (1.5) + y 0 (1.5) ∆x ≈ (0.4267) + (0.0679)(0.5) ≈ 0.4607

y 0 (2.0)  ( x − 1) 2 − y 2 ≈ (2.0 − 1) 2 − (0.4607) 2 ≈ 0.7878


y (2.5)  y (2.0) + y 0 (2.0) ∆x ≈ (0.4607) + (0.7878)(0.5) ≈ 0.8546

Figure 4 shows the five linear approximations used in this example. Note that each linear
a Figure 4: The five steps of Euler’s segment has the correct slope at its left endpoint, but the slope gradually becomes wrong over
method used in Example 4. the course of each step.

Euler’s method may remind you of using a Riemann sum to approximate a definite
integral. Indeed, in the special case where the differential equation has the form
y0  f ( x ) ,
solving the differential equation is the same as integrating f , and Euler’s method gives
the same result as the left endpoint rule for a Riemann sum.
EULER’S METHOD 4

A Closer Look Numerical Methods

Euler’s method is only the simplest numerical method for solving differential equations.
Finding better ways of approximating solutions to differential equations is an ongoing subject
of research, and is one of the primary goals of the field of mathematics known as numerical
analysis.
One basic improvement is to estimate the slope of each straight segment using a combination
of y 0 values corresponding to different values of x. This idea leads to a set of possible methods
known collectively as Runge-Kutta methods. Another possible improvement, often combined
with Runge-Kutta, is to change the step size ∆x adaptively, using small steps when the value
of y 0 seems to be changing quickly, and using large steps when y 0 is roughly constant.
Modern computer algebra systems such as Mathematica, Sage, and Matlab have a variety of
different numerical methods built into the system. Though you can choose a method explicitly
to solve a given problem, most computer algebra systems also have a built-in algorithm to
choose an appropriate method based on the properties of the given equation.

As with a Riemann sum, Euler’s method becomes more precise as the step size
becomes smaller, since the slope is being adjusted more often. For example, we can
improve the estimated values in Example 4 by decreasing the step size, as shown in
Figures 5, 6, and 7. The last of these three graphs (with step size 0.01) follows the actual
solution curve to within 0.004, which is about a third of the width of the red line.
a Figure 5: Euler’s method for the With a computer, it is possible to implement Euler’s method using very small steps
initial-value problem in Example 4 with step (e.g. ∆x  0.000001), which leads to very accurate numerical approximations for the
size ∆x  0.25.
solution curves. Combining this with other numerical methods (see the Numerical
Methods box above) can increase the speed and accuracy further, making computers an
indispensable tool for scientific modeling.

EXERCISES

1. Consider the following initial value problem:

y0  x 2 − y 3 , y (0)  1.
a Figure 6: Euler’s method for the
Use Euler’s method with a step size of 0.2 to estimate y (1) , keeping track of three
initial-value problem in Example 4 with step
size ∆x  0.1. decimal places during the calculation.

2. Consider the following initial value problem:

y 0  x y − 2, y (2)  1.

Use Euler’s method with a step size of 0.5 to estimate y (4) , keeping track of three
decimal places during the calculation.

3. A ball is dropped from the top of a tall building. If air resistance is taken into
a Figure 7: Euler’s method for the account, the downward velocity v of the ball is modeled by the differential equation
initial-value problem in Example 4 with step
size ∆x  0.01. dv
 g − kv 2
dt
where g  9.8 m/sec2 is the acceleration due to gravity, and k  0.1/m is the drag
coefficient. Assuming the initial velocity of the ball is zero, use Euler’s method
with a step size of 0.25 sec to estimate the velocity of the ball after one second.
Keep track of three decimal places during the calculation.

You might also like