Learning Objectives
- 4.2.1 Draw the direction field for a given first-order differential equation.
- 4.2.2 Use a direction field to draw a solution curve of a first-order differential equation.
- 4.2.3 Use Euler’s Method to approximate the solution to a first-order differential equation.
For the rest of this chapter we will focus on various methods for solving differential equations and analyzing the behavior of the solutions. In some cases it is possible to predict properties of a solution to a differential equation without knowing the actual solution. We will also study numerical methods for solving differential equations, which can be programmed by using various computer languages or even by using a spreadsheet program, such as Microsoft Excel.
Creating Direction Fields
Direction fields (also called slope fields) are useful for investigating first-order differential equations. In particular, we consider a first-order differential equation of the form
An applied example of this type of differential equation appears in Newton’s law of cooling, which we will solve explicitly later in this chapter. First, though, let us create a direction field for the differential equation
Here represents the temperature (in degrees Fahrenheit) of an object at time and the ambient temperature is Figure 4.6 shows the direction field for this equation.
The idea behind a direction field is the fact that the derivative of a function evaluated at a given point is the slope of the tangent line to the graph of that function at the same point. Other examples of differential equations for which we can create a direction field include
To create a direction field, we start with the first equation: We let be any ordered pair, and we substitute these numbers into the right-hand side of the differential equation. For example, if we choose substituting into the right-hand side of the differential equation yields
This tells us that if a solution to the differential equation passes through the point then the slope of the solution at that point must equal To start creating the direction field, we put a short line segment at the point having slope We can do this for any point in the domain of the function which consists of all ordered pairs in Therefore any point in the Cartesian plane has a slope associated with it, assuming that a solution to the differential equation passes through that point. The direction field for the differential equation is shown in Figure 4.7.
We can generate a direction field of this type for any differential equation of the form
Definition
A direction field (slope field) is a mathematical object used to graphically represent solutions to a first-order differential equation. At each point in a direction field, a line segment appears whose slope is equal to the slope of a solution to the differential equation passing through that point.
Using Direction Fields
We can use a direction field to predict the behavior of solutions to a differential equation without knowing the actual solution. For example, the direction field in Figure 4.7 serves as a guide to the behavior of solutions to the differential equation
To use a direction field, we start by choosing any point in the field. The line segment at that point serves as a signpost telling us what direction to go from there. For example, if a solution to the differential equation passes through the point then the slope of the solution passing through that point is given by Now let increase slightly, say to Using the method of linear approximations gives a formula for the approximate value of for In particular,
Substituting into gives an approximate value of
At this point the slope of the solution changes (again according to the differential equation). We can keep progressing, recalculating the slope of the solution as we take small steps to the right, and watching the behavior of the solution. Figure 4.8 shows a graph of the solution passing through the point
The curve is the graph of the solution to the initial-value problem
This curve is called a solution curve passing through the point The exact solution to this initial-value problem is
and the graph of this solution is identical to the curve in Figure 4.8.
Checkpoint 4.7
Create a direction field for the differential equation and sketch a solution curve passing through the point
Media
Go to this website to see more about slope fields.
Now consider the direction field for the differential equation shown in Figure 4.9. This direction field has several interesting properties. First of all, at and horizontal dashes appear all the way across the graph. This means that if then Substituting this expression into the right-hand side of the differential equation gives
Therefore is a solution to the differential equation. Similarly, is a solution to the differential equation. These are the only constant-valued solutions to the differential equation, as we can see from the following argument. Suppose is a constant solution to the differential equation. Then Substituting this expression into the differential equation yields This equation must be true for all values of so the second factor must equal zero. This result yields the equation The solutions to this equation are and which are the constant solutions already mentioned. These are called the equilibrium solutions to the differential equation.
Definition
Consider the differential equation An equilibrium solution is any solution to the differential equation of the form where is a constant.
To determine the equilibrium solutions to the differential equation set the right-hand side equal to zero. An equilibrium solution of the differential equation is any function of the form such that for all values of in the domain of
An important characteristic of equilibrium solutions concerns whether or not they approach the line as an asymptote for large values of
Definition
Consider the differential equation and assume that all solutions to this differential equation are defined for Let be an equilibrium solution to the differential equation.
- is an asymptotically stable solution to the differential equation if there exists such that for any value the solution to the initial-value problem
approaches as approaches infinity. - is an asymptotically unstable solution to the differential equation if there exists such that for any value the solution to the initial-value problem
never approaches as approaches infinity. - is an asymptotically semi-stable solution to the differential equation if it is neither asymptotically stable nor asymptotically unstable.
Now we return to the differential equation with the initial condition The direction field for this initial-value problem, along with the corresponding solution, is shown in Figure 4.10.
The values of the solution to this initial-value problem stay between and which are the equilibrium solutions to the differential equation. However, an initial-value problem starting with can never cross the equilibrium solutions and . Therefore, since and for , is decreasing and therefore approaches . Therefore, is an asymptotically stable solution to the differential equation.
What happens when the initial value is below This scenario is illustrated in Figure 4.11, with the initial value
We can see that for initial values for and is increasing and therefore approaches . This reaffirms that is an asymptotically stable solution to the differential equation.
Example 4.8
Stability of an Equilibrium Solution
Create a direction field for the differential equation and identify any equilibrium solutions. Classify each of the equilibrium solutions as stable, unstable, or semi-stable.
Solution
The direction field is shown in Figure 4.12.
The equilibrium solutions are and To classify each of the solutions, look at an arrow directly above or below each of these values. For example, at the arrows directly below this solution point up, and the arrows directly above the solution point down. Therefore all initial conditions close to approach and the solution is stable. For the solution all initial conditions above and below are repelled (pushed away) from so this solution is unstable. The solution is semi-stable, because for initial conditions slightly greater than the solution approaches infinity, and for initial conditions slightly less than the solution approaches
Analysis
It is possible to find the equilibrium solutions to the differential equation by setting the right-hand side equal to zero and solving for This approach gives the same equilibrium solutions as those we saw in the direction field.
Checkpoint 4.8
Create a direction field for the differential equation and identify any equilibrium solutions. Classify each of the equilibrium solutions as stable, unstable, or semi-stable.
Euler’s Method
Consider the initial-value problem
Integrating both sides of the differential equation gives and solving for yields the particular solution The solution for this initial-value problem appears as the parabola in Figure 4.13.
The red graph consists of line segments that approximate the solution to the initial-value problem. The graph starts at the same initial value of Then the slope of the solution at any point is determined by the right-hand side of the differential equation, and the length of the line segment is determined by increasing the value by each time (the step size). This approach is the basis of Euler’s Method.
Before we state Euler’s Method as a theorem, let’s consider another initial-value problem:
The idea behind direction fields can also be applied to this problem to study the behavior of its solution. For example, at the point the slope of the solution is given by so the slope of the tangent line to the solution at that point is also equal to Now we define and Since the slope of the solution at this point is equal to we can use the method of linear approximation to approximate near
Here and so the linear approximation becomes
Now we choose a step size. The step size is a small value, typically or less, that serves as an increment for it is represented by the variable In our example, let Incrementing by gives our next value:
We can substitute into the linear approximation to calculate
Therefore the approximate value for the solution when is We can then repeat the process, using and to calculate and The new slope is given by First, Using linear approximation gives
Finally, we substitute into the linear approximation to calculate
Therefore the approximate value of the solution to the differential equation is when
What we have just shown is the idea behind Euler’s Method. Repeating these steps gives a list of values for the solution. These values are shown in Table 4.2, rounded off to four decimal places.
Theorem 4.1
Euler’s Method
Consider the initial-value problem
To approximate a solution to this problem using Euler’s method, define
Here represents the step size and is an integer, starting with The number of steps taken is counted by the variable
Typically is a small value, say or The smaller the value of the more calculations are needed. The higher the value of the fewer calculations are needed. However, the tradeoff results in a lower degree of accuracy for larger step size, as illustrated in Figure 4.14.
Example 4.9
Using Euler’s Method
Consider the initial-value problem
Use Euler’s method with a step size of to generate a table of values for the solution for values of between and
Solution
We are given and Furthermore, the initial condition gives and Using Equation 4.2 with we can generate Table 4.3.
With ten calculations, we are able to approximate the values of the solution to the initial-value problem for values of between and
Media
For more information on Euler's method use this applet.
Checkpoint 4.9
Consider the initial-value problem
Using a step size of generate a table with approximate values for the solution to the initial-value problem for values of between and
Media
Visit this website for a practical application of the material in this section.
Section 4.2 Exercises
For the following problems, use the direction field below from the differential equation Sketch the graph of the solution for the given initial conditions.
For the following problems, use the direction field below from the differential equation Sketch the graph of the solution for the given initial conditions.
Draw the direction field for the following differential equations, then solve the differential equation.
Draw the directional field for the following differential equations. What can you say about the behavior of the solution? Are there equilibria? What stability do these equilibria have?
Match the direction field with the given differential equations. Explain your selections.
Match the direction field with the given differential equations. Explain your selections.
Estimate the following solutions using Euler’s method with steps over the interval If you are able to solve the initial-value problem exactly, compare your solution with the exact solution. If you are unable to solve the initial-value problem, the exact solution will be provided for you to compare with Euler’s method. How accurate is Euler’s method?
Exact solution is
Exact solution is
Exact solution is
Differential equations can be used to model disease epidemics. In the next set of problems, we examine the change of size of two sub-populations of people living in a city: individuals who are infected and individuals who are susceptible to infection. represents the size of the susceptible population, and represents the size of the infected population. We assume that if a susceptible person interacts with an infected person, there is a probability that the susceptible person will become infected. Each infected person recovers from the infection at a rate and becomes susceptible again. We consider the case of influenza, where we assume that no one dies from the disease, so we assume that the total population size of the two sub-populations is a constant number, The differential equations that model these population sizes are
Here represents the contact rate and is the recovery rate.
Show that, by our assumption that the total population size is constant you can reduce the system to a single differential equation in
[T] Use computational software or a calculator to compute an approximate solution to the initial-value problem using Euler's Method with a given step size Find the solution at in terms of Hint: Here is "pseudo-code" for how to write a computer program to perform Euler's Method for
-
Create function
-
Define parameters step size and total number of steps,
-
Write a for loop:
for
Refer to your answer for Exercise 4.106 to solve the following exercises.
Draw the directional field
Compute using [T]
Compute using [T]
[T] Evaluate the exact solution at Make a table of errors for the relative error between the Euler’s method solution and the exact solution. How much does the error change? Can you explain?
Consider the initial-value problem
Show that solves this initial-value problem.
[T] By hand or by calculator or computer, approximate the solution using Euler’s Method at using
[T] Plot exact answer and each Euler approximation (for and at each on the directional field. What do you notice?