4.1 Applications of Separation of Variables

advertisement
4.1
Applications of Separation of Variables
Many of the differential equations that arise in the natural and social sciences are
separable. In this section we describe three applications of separable equations to
physics, chemistry, and biology.
Newton’s Law of Cooling
This law was first formulated by Isaac
Newton in 1701 in an anonymous article
entitled Scala Graduum Caloris (“Scale of
the Degrees of Heat”).
Newton’s law of cooling is a differential equation that predicts the cooling of a warm
body placed in a cold environment. According to the law, the rate at which the
temperature of the body decreases is proportional to the difference in temperatures
between the body and its environment. In symbols,
dT
−r (T − Te )
dt
where T is the temperature of the object, Te is the (constant) temperature of the
environment, and r is a constant of proportionality.
We can solve this differential equation using separation of variables. Dividing
through by T − Te gives
1
dT
−r
T − Te dt
so
Z
Z
1
dT −r dt.
T − Te
Integrating gives
ln |T − Te | −rt + C,
and hence
T − Te A e −rt ,
a Newton illustrated his law by describing
the cooling of hot iron.1
where A ±e C . Thus the solutions are
T Te + A e −rt
where A is an arbitrary constant.
Figure 1 shows the cooling of a warm body over time as predicted by Newton’s
law of cooling. The behavior is very similar to exponential decay, except that the
temperature T approaches Te instead of 0 as t → ∞. Indeed, Newton’s law of cooling
can be interpreted as saying that the temperature difference T − Te decays exponentially
over time.
a Figure 1: Cooling of a warm body.
EXAMPLE 1
An apple pie with an initial temperature of 170 ◦ C is removed from the oven and left to cool
in a room with an air temperature of 20 ◦ C. Given that the temperature of the pie initially
decreases at a rate of 3.0 ◦ C/min, how long will it take for the pie to cool to a temperature
of 30 ◦ C?
SOLUTION
The pie should obey Newton’s law of cooling with Te 20 ◦ C. Thus
T ( t ) 20 + A e −rt
1 Photo
and
T 0 ( t ) −rAe −rt
by Jeff Kubina, licensed under CC BY-SA 2.0, cropped from original.
APPLICATIONS OF SEPARATION OF VARIABLES
2
for some constants A and r. We also have the initial conditions
T (0) 170 ◦ C
T 0 (0) −3.0 ◦ C/min.
and
Plugging these in gives the equations
170 20 + A
and
−3 −rA,
so A 150 ◦ C and r 0.02. Thus
T 20 + 150 e −0.02t .
a
Figure 2: The temperature function T ( t )
in Example 1. The diagonal dashed line
shows the initial 3.0 ◦ C/min rate of
temperature decrease.
To find how long it will take for the temperature to reach 30 ◦ C, we plug in 30 for T and solve
for t. The result is that t 135 min, as shown in Figure 2.
Reaction Rates
The study of the rates at which chemical
reactions occur is a branch of chemistry
known as chemical kinetics. For more
complicated reactions, the chemical
kinetics can involve a system of
differential equations, with one equation
for each reactant.
In chemistry, the rate at which a chemical reaction occurs is determined by a differential
equation called a rate equation. For a reaction with a single reactant, the concentration C
of the reactant obeys a rate equation of the form
dC
−rC n ,
dt
where r is a constant called the rate constant, and n is a constant called the order of
the reaction.
Typically the order of the reaction is the same as its molecularity, i.e. the number
of molecules of the reactant that must come together to react. For example, the
decomposition of sulfuryl chloride
SO2 Cl2 −→ SO2 + Cl2 .
is a first-order reaction (n 1), since it involves the decomposition of a single molecule
of SO2 Cl2 . On the other hand, the decomposition of nitrogen dioxide
2 NO2 −→ 2 NO + O2 .
a A sample of nitrogen dioxide gas.
2
is a second order reaction (n 2), since it only occurs when two molecules of NO2
come together.
First and second order reactions behave somewhat differently. The rate equation
for a first-order reaction is
dC
−rC,
dt
which is an instance of the exponential decay equation. Thus the concentration of the
reactant decays exponentially. A second-order reaction, on the other hand, is governed
by the equation
dC
−rC 2 ,
dt
We can solve this equation using separation of variables. Dividing through by C 2 gives
C −2
2 Photo
dC
−r,
dt
by W. Oelen, licensed under CC BY-SA 3.0, via Wikimedia Commons
APPLICATIONS OF SEPARATION OF VARIABLES
3
so the solutions are given by
Z
Z
C
−2
dC −r dt.
Integrating gives
−C −1 −rt + A
a Figure 3: Concentration of a
for some constant A, so
second-order reactant.
C 1
rt + B
where B −A.
Figure 3 shows the decrease in the concentration of a second-order reactant according
to this equation. This decrease behaves somewhat differently than exponential decay,
with the concentration decreasing very quickly at first but having a very long tail. In
particular, the half-life of the reactant is very small at first but increases over the course
of the reaction, as shown in Figure 4.
a
Figure 4: Halving times for the reactant
in a second-order reaction. Note the
increasing half-life.
EXAMPLE 2
The decomposition of nitrogen dioxide (NO2 ) is a second-order reaction. During a chemistry
experiment, nitrogen dioxide with an initial concentration of 0.20 M is decomposed at a high
temperature. If 90% of the NO2 decomposes during the first ten seconds, what is the rate
constant for the reaction?
SOLUTION
Figure 5 shows the concentration [NO2 ] of nitrogen dioxide in this example. We
know that
1
,
rt + B
and we are given that [NO2 ] 0.20 M at t 0, and [NO2 ] 0.020 M (10% of 0.20 M) at
t 10 sec. This information yields two equations:
[NO2 ] 0.20 M a
Figure 5: The concentration of NO2 in
Example 2.
1
B
and
0.020 M 1
.
r (10 sec) + B
Then B 5.0/M, so the rate constant r is 4.5/ (M · sec) .
Logistic Population Growth
a A colony of Paenibacillus dendritiformis
bacteria.3
Consider a colony of bacteria growing in an environment with limited resources.
For example, there may be a scarcity of food, or space constraints on the size of the
colony. In this case, it is not reasonable to expect the population of the colony to grow
exponentially—indeed, the colony will unable to grow larger than some maximum
population Pmax .
In the study of population ecology, the maximum number of organisms of a certain
type that a given environment can support is known as the carrying capacity of the
population. Exponential population growth is a reasonable model in situations where
the carrying capacity Pmax is very large, but for environments with a limited carrying
capacity other models must be used to predict population growth.
The most common model for population growth in an environment with limited
carrying capacity is the logistic equation:
3 Photo from the laboratory of Dr. Eshel Ben Jacob, licensed under CC BY-SA 3.0, via Wikimedia Commons
APPLICATIONS OF SEPARATION OF VARIABLES
4
P
dP
kP 1 −
dt
Pmax
The idea of this equation is that the factor on the right approaches zero as P gets close
to Pmax , causing the population growth to taper off.
It is possible to solve the logistic equation using separation of variables, though the
calculation is a bit difficult. (See Solving the Logistic Equation on the next page.) The
solutions have the form
Pmax
1 + A e −kt
P a Figure 6: Logistic population growth.
where A is an arbitrary constant.
Figure 6 shows the graph of a typical solution to the logistic equation. Note that
the population grows quickly at first, but the rate of increase slows as the population
reaches the maximum. As t → ∞, the population asymptotically approaches the
carrying capacity, i.e.
lim P ( t ) Pmax .
t→∞
Logistic functions are sometimes called
sigmoid functions because of the S-like
shape of their graphs, though this term is
also used more broadly to refer to any
function whose graph has an S-like shape.
The solutions to the logistic equation are known as logistic functions, and can be used
to model any situation where a variable is growing but the growth is bounded above.
EXAMPLE 3
A population of bacteria is undergoing logistic growth with a maximum population of 100,000.
Initially the population is 16,000. By t 1.0 hour, the population has grown to 64,000. What
will the population be at t 2.0 hours?
SOLUTION
We know that
100,000
1 + A e −kt
for some constants A and k. Plugging in the two data points gives
P (t ) 16,000 100,000
1+A
and
64,000 100,000
.
1 + A e −k
Solving for A in the first equation gives A 5.25. Plugging this into the second equation and
solving for k gives k 2.2336. Then
a
P (2) Figure 7: The bacteria population in
Example 3.
100,000
94,315.8,
1 + (5.25) e − (2.2336)(2)
so the population at t 2.0 hours will be approximately 94,000, as shown in Figure 7.
EXERCISES
1. A bottle of water with an initial temperature of 25 ◦ C is placed in a refrigerator
with an internal temperature of 5 ◦ C. Given that the temperature of the water is
21 ◦ C ten minutes after it is placed in the refrigerator, what will the temperature of
the water be after one hour?
2. For the logistic population model, find a formula for the constant A that appears in
the solution in terms of the maximum population Pmax and the initial population P0 .
APPLICATIONS OF SEPARATION OF VARIABLES
5
A Closer Look Solving the Logistic Equation
It is possible to solve the logistic equation using separation of variables. Starting with the
equation
dP
P
,
kP 1 −
dt
Pmax
we can separate the variables to get
Pmax
dP
k.
P ( Pmax − P ) dt
Thus the solutions are given by
Z
Pmax
dP P ( Pmax − P )
Z
k dt.
(1)
The integral on the left requires the integration technique known as partial fractions decomposition. The idea of partial fractions decomposition is to write a complicated fraction as a
sum of simpler fractions. In this case, observe that
1
1
Pmax
+
.
P ( Pmax − P )
P
Pmax − P
This decomposition allows us to evaluate the integral:
Z
Pmax
dP P ( Pmax − P )
Z
1
dP +
P
Z
1
dP
Pmax − P
ln |P| − ln |Pmax − P| + C
P
+ C
ln Pmax − P Plugging this into equation (1) and integrating the right side gives
P
kt + C.
Pmax − P ln Then
P
A e kt
Pmax − P
and solving for P gives
P where B 1/A.
Pmax
,
1 + B e −kt
3. In 1974, Stephen Hawking discovered that black holes emit a small amount of
radiation, causing them to slowly evaporate over time. According to Hawking, the
mass M of a black hole obeys the differential equation
dM
k
− 2
dt
M
where k 1.26 × 1023 kg3 /year.
(a) Use separation of variables to find the general solution to this equation
(b) After a supernova, the remnant of a star collapses into a black hole with an
initial mass of 6.00 × 1031 kg. How long will it take for this black hole to
evaporate completely?
APPLICATIONS OF SEPARATION OF VARIABLES
6
4. The decomposition of hydrogen iodide is a second-order reaction:
2 HI −→ H2 + I2
Initially the concentration of a sample of hydrogen iodide is 0.250 M, and the
concentration is decreasing at a rate of 1.00 × 10−4 M/sec.
(a) How long will it take for half of the hydrogen iodide to be consumed?
(b) How long will it take for three quarters of the hydrogen iodide to be consumed?
5. The velocity of an object moving through a fluid can be modeled by the drag
equation
dv
−kv 2
dt
where k is a constant.
(a) Find the general solution to this equation.
(b) An object moving through the water has an initial velocity of 16 m/sec. After
2.0 seconds, the velocity has decreased to 12 m/sec. What will the velocity be
after ten seconds?
6. A population of bacteria is undergoing logistic growth, with a maximum possible
population of 100,000. Initially, the bacteria colony has 5,000 members, and the
population is increasing at a rate of 400/minute.
(a) How large will the population be 30 minutes later?
(b) When will the population reach 80,000?
7. Water is being drained from a spout in the bottom of a cylindrical tank. According
to Torricelli’s law, the volume V of water left in the tank obeys the differential
equation
√
dV
−k V
dt
where k is a constant.
(a) Use separation of variables to find the general solution to this equation.
(b) Suppose the tank initially holds 30.0 L of water, which initially drains at a rate
of 1.80 L/min. How long will it take for tank to drain completely?
8. The Gompertz equation has been used to model the growth of malignant tumors.
The equation states that
dP
kP (ln Pmax − ln P )
dt
where P is the population of cancer cells, and k and Pmax are constants.
(a) Use separation of variables to find the general solution to this equation.
(b) A tumor with 5000 cells is initially growing at a rate of 200 cells/day. Assuming
the maximum size of the tumor is Pmax 100,000 cells, how large will the tumor
be after 100 days?
4.2
Slope Fields
Consider the differential equation
y 0 sin x 2 .
This equation is directly integrable, with solutions given by
Z
y a Figure 1: The solution to the initial value
problem
y 0 sin x 2 ,
y (0) 1.
sin x 2 dx.
Unfortunately, this integral cannot be evaluated symbolically, which means we can’t
write an explicit formula for the solutions to this equation. The solutions still exist (see
Figure 1), but we can only work with them graphically or numerically.
Explicit First-Order Equations
But how can we know that a differential equation has a solution if we can’t find a
formula for it? For example, consider the equation
y0 x 3 + y 3 .
This is the same as the last equation,
except that we have renamed x to t.
Can we be sure that this equation has a solution?
There is a simple physical argument that this differential equation must have a
solution. Imagine an object moving in one dimension, whose position y changes with
time. In this case, the equation
dy
t3 + y3
dt
can be thought of as instructions for how to move the object. Specifically, this equation
says what the velocity of the object should be at any given instant as a function of the
time t and the position y. If we move the object according to these instructions, we will
obtain a position function y ( t ) , which must be a solution to this differential equation.
This same reasoning applies to any differential equation of the form
y 0 F ( x, y ) ,
Almost every differential equation that
arises in science is explicit.
where F ( x, y ) is any expression involving x and y. An equation of this form is called
an explicit first-order equation, and can be thought of as a set of instructions for how
quickly y should change in terms of x and y. Intuitively, we expect that any such
equation should have at least one solution. Indeed, we expect that any initial value
problem of the form
y 0 F ( x, y ) ,
y (a ) b
should have a uniquely determined solution.
The following theorem makes this intuition rigorous.
Existence and Uniqueness of Solutions
Consider an initial value problem of the form
y 0 F ( x, y ) ,
y ( a ) b.
Assuming the function F ( x, y ) is differentiable, this initial value problem has a
uniquely determined solution.
SLOPE FIELDS
2
Slope Fields
There is a nice geometric way to describe the solutions to a differential equation, even
if we can’t write down explicit solutions. For example, consider the equation:
y 0 ( x − 1) 2 − y 2 .
We can interpret this equation as a formula for the slope y 0 of the solution in terms of x
and y. For example, if a solution for this equation goes through the point (4, 2) , its
slope at that point must be 5, since plugging in x 4 and y 2 into the differential
equation gives y 0 5.
We can visualize this information by drawing small line segments with the appropriate slopes at various points in the x y-plane, as shown in Figure 2. This picture is
called a slope field, and was drawn using the following procedure:
1. First, an array of x and y values were chosen. In this case, we used fifteen equally
spaced x-values between 0 and 2.5, and nine equally spaced y-values between 0
and 1.5.
a Figure 2: Slope field for the equation
2. For each ( x, y ) pair, the slope y 0 was computed using the equation
y 0 ( x − 1) 2 − y 2 .
y 0 ( x − 1) 2 − y 2 .
3. At each point ( x, y ) , a small line segment was drawn with the computed slope.
a
Figure 3: Three solutions to this
equation.
We can think of a slope field as a picture of a differential equation, in the sense that it
contains the same information that the differential equation does. The solutions to a
differential equation are curves that follow the slopes of the slope field, as shown in
Figure 3.
By the way, an initial condition corresponds graphically to a point on the plane
that the solution curve must go through. For example, the solution to the initial value
problem
y 0 ( x − 1) 2 − y 2 ,
y (0) 1
is shown in Figure 4. As you can see, the initial condition y (0) 1 corresponds to
the fact that the solution curve goes through the point (0, 1) . Intuitively, the solution
to this initial value problem can be obtained by starting at the point (0, 1) and then
“following the slopes” to obtain a solution curve.
EXAMPLE 1
a Figure 4: The solution for which
y (0) 1.
a Figure 5: Slope field and solution curves
for the logistic equation.
Recall that the logistic equation is the differential equation
dP
P
kP 1 −
dt
Pmax
where k and Pmax are constants. This equation can be used to modeled the growth of a
population in an environment with a finite carrying capacity Pmax .
A typical slope field for the logistic equation is shown in Figure 5. Several solutions to
the equation are also shown. Note that the slopes point up if P < Pmax and down if P > Pmax ,
so in either case the population approaches the carrying capacity. (The case where P > Pmax
corresponds to a situation where the population is too high to be sustainable.)
By the way, observe that the slopes for this equation are the same on each horizontal line.
This is because the formula for dP/dt depends on P only, with no explicit dependence on the
variable t.
SLOPE FIELDS
3
Based on the pictures so far, you might have noticed a few important properties of
the solution curves for a differential equation. For example, Figure 6 shows several
different solution curves for the equation
y 0 ( x − 1) 2 − y 2 .
These curves have the following properties:
a
Figure 6: Solution curves for the
equation y 0 ( x − 1) 2 − y 2 .
1. The curves entirely fill the plane, in the sense that each point of the plane has a
solution curve going through it. This is because any point in the plane can be
thought of as an initial condition, which means that it lies on the solution curve
for the corresponding initial value problem.
2. No two of the curves intersect, i.e. each point on the plane is contained in
only one curve. This is because of the uniqueness of solutions—each point can
be thought of as an initial condition, and there should only be one solution
corresponding to a given initial condition.
These properties are typical for the solutions to explicit first-order differential equations.
EXERCISES
1. The following picture shows the slope field for a certain explicit first-order equation.
(a) Use this slope field to sketch the solution curve satisfying y (0) 1.
(b) Given that y (0) 1, use your answer to part (a) to estimate the value of y (3) .
2. Consider the following differential equation:


−1 if x < 1,



0

y  0 if 1 ≤ x ≤ 2,


 1 if x > 2.

(a) Sketch the slope field for this equation. Your sketch should include the range
0 ≤ x ≤ 4 and 0 ≤ y ≤ 3.
(b) Given that y (0) 1.5, find the value of y (4) .
SLOPE FIELDS
4
3. Match each differential equation with the corresponding slope field.
(a) y 0 x y
(I)
(II)
(III)
(IV)
(b) y 0 x 2 + y 2
(c) y 0 x 2 − y 2
(d) y 0 y − x 2
4. Match each differential equation with the corresponding solution curve.
(I)
(II)
(III)
(IV)
(a) y 0 sin ( x y )
(b) y 0 x − y 3
(c) y 0 e −x y
(d) y 0 cos ( x y )
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
a Figure 1: The ratio of ∆y to ∆x is
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
∆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
tangent line to the graph of y ( x ) at the point
( x 0 , y0 ) .
Here we are changing x by the small amount ∆x 0.04. The corresponding
change in y is
∆y ≈ y 0 (1) ∆x (0.5)(0.04) 0.02.
SOLUTION
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
example is about 0.501507, so the linear
approximation is fairly accurate.
Then
y (1.002) y (1) + ∆y ≈ 0.5 + 0.0015 0.5015.
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) .
The idea is to use three linear approximations, each with ∆x 0.1. We will keep
track of three decimal places during the process.
SOLUTION
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
so
∆y ≈ y 0 (0) ∆x (0.841)(0.1) 0.084
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
a Figure 3: The three linear
approximations in Example 3.
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.
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.
EULER’S METHOD
x
0.0
0.1
0.2
0.3
y
1.000
1.084
1.142
1.173
y0
0.841
0.584
0.309
—
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
the same column using the differential equation, and each value of y is computed from
the y and y 0 values in the previous column using the following linear approximation
formula:
a Table 4.1: Table of values for the linear
0
ynew ≈ yold + yold
∆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
y
0.5
0.8750
y0
0.75
−0.5156
0.5
1.0
1.5
2.0
2.5
0.6172
0.4267
0.4607
0.8546
−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
a Figure 4: The five steps of Euler’s
method used in Example 4.
Figure 4 shows the five linear approximations used in this example. Note that each linear
segment has the correct slope at its left endpoint, but the slope gradually becomes wrong over
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.
a
Figure 5: Euler’s method for the
initial-value problem in Example 4 with step
size ∆x 0.25.
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.
With a computer, it is possible to implement Euler’s method using very small steps
(e.g. ∆x 0.000001), which leads to very accurate numerical approximations for the
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:
a
Figure 6: Euler’s method for the
initial-value problem in Example 4 with step
size ∆x 0.1.
y0 x 2 − y 3 ,
y (0) 1.
Use Euler’s method with a step size of 0.2 to estimate y (1) , keeping track of three
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.
a Figure 7: Euler’s method for the
initial-value problem in Example 4 with step
size ∆x 0.01.
3. A ball is dropped from the top of a tall building. If air resistance is taken into
account, the downward velocity v of the ball is modeled by the differential equation
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.
Download