Section 8.1 Graphical and Numerical Solutions to Differential Equations
In Section 5.1, we were introduced to the idea of a differential equation. Given a function we defined a differential equation as an equation involving and derivatives of We explored the simple differential equation and saw that a solution to a differential equation is simply a function that satisfies the differential equation.
Subsection 8.1.1 Introduction and Terminology
To find a solution, we must find a function whose derivative is In other words, we seek an antiderivative of The function
is an antiderivative of and solves the differential equation. So do the functions
and
We call the function
with an arbitrary constant of integration, the general solution to the differential equation.
In order to specify the value of the integration constant we require additional information. For example, if we know that it follows that This additional information is called an initial condition.
Definition 8.1.2. Initial Value Problem.
A differential equation paired with an initial condition (or initial conditions) is called an initial value problem.
The solution to an initial value problem is called a particular solution. A particular solution does not include arbitrary constants.
The family of solutions to a differential equation that encompasses all possible solutions is called the general solution to the differential equation.
Example 8.1.3. A simple first-order differential equation.
Solve the differential equation
Solution.
The solution is a function such that differentiation yields twice the original function. Unlike our starting example, finding the solution here does not involve computing an antiderivative. Notice that βintegrating both sidesβ would yield the result which is not useful. Without knowledge of the function we canβt compute the indefinite integral. Later sections will explore systematic ways to find analytic solutions to simple differential equations. For now, a bit of thought might let us guess the solution
Notice that application of the chain rule yields Another solution is given by
In fact,
where is any constant, is the general solution to the differential equation because
If we are provided with a single initial condition, say we can identify so that
is the particular solution to the initial value problem
Figure 8.1.4 shows various members of the general solution to the differential equation Each value yields a different member of the family, and a different function. We emphasize the particular solution corresponding to the initial condition
Example 8.1.5. A second-order differential equation.
Solve the differential equation
Solution.
We seek a function whose second derivative is negative 9 multiplied by the original function. Both and have this feature. The general solution to the differential equation is given by
where and are arbitrary constants. To fully specify a particular solution, we require two additional conditions. For example, the initial conditions and yield
The differential equation in Example 8.1.5 is second order, because the equation involves a second derivative. In general, the number of initial conditions required to specify a particular solution depends on the order of the differential equation. For the remainder of the chapter, we restrict our attention to first order differential equations and first order initial value problems.
Example 8.1.6. Verifying a solution to the differential equation.
Solution.
Verifying a solution to a differential equation is simply an exercise in differentiation and simplification. We substitute each potential solution into the differential equation to see if it satisfies the equation.
-
Testing the potential solutionDifferentiating, we have
Substituting into the differential equation,Since it doesnβt satisfy the differential equation, is not a solution. -
Testing the potential solutionDifferentiating, we have
Substituting into the differential equation,Thus is a solution to the differential equation. -
Testing the potential solutionDifferentiating,
Substituting into the differential equation,The function is not a solution to the differential equation.
Example 8.1.7. Verifying a solution to a differential equation.
Solution.
The solution in this example is called an implicit solution. That means the dependent variable is a function of but has not been explicitly solved for. Verifying the solution still involves differentiation, but we must take the derivatives implicitly. Differentiating, we have
Solving for we have
From the solution, we know that Then
We have verified that is a solution to
Subsection 8.1.2 Graphical Solutions to Differential Equations
In the examples we have explored so far, we have found exact forms for the functions that solve the differential equations. Solutions of this type are called analytic solutions. Many times a differential equation has a solution, but it is difficult or impossible to find the solution analytically. This is analogous to algebraic equations. The algebraic equation has two real solutions that can be found analytically by using the quadratic formula. The equation has one real solution, but we canβt find it analytically. As shown in Figure 8.1.8, we can find an approximate solution graphically by plotting and and observing the -value of the intersection. We can similarly use graphical tools to understand the qualitative behavior of solutions to a first order-differential equation.
The function could be any function of the two variables and Written in this way, we can think of the function as providing a formula to find the slope of a solution at a given point in the -plane. In other words, suppose a solution to the differential equation passes through the point At the point the slope of the solution curve will be Since this calculation of the slope is possible at any point where the function is defined, we can produce a plot called a slope field (or direction field) that shows the slope of a solution at any point in the -plane where the solution is defined. Further, this process can be done purely by working with the differential equation itself. In other words, we can draw a slope field and use it to determine the qualitative behavior of solutions to a differential equation without having to solve the differential equation.
Definition 8.1.9. Slope Field.
A slope field for a first-order differential equation is a plot in the -plane made up of short line segments or arrows. At each point where is defined, the slope of the line segment is given by Plots of solutions to a differential equation are tangent to the line segments in the slope field.
Example 8.1.10. Sketching a slope field.
Find a slope field for the differential equation
Solution.
Because the function is defined for all points every point in the -plane has an associated line segment. It is not practical to draw an entire slope field by hand, but many tools exist for drawing slope fields on a computer. Here, we explicitly calculate a few of the line segments in the slope field.
- The slope of the line segment at
is - The slope of the line segment at
is - The slope of the line segment at
is - The slope of the line segment at
is
Though it is possible to continue this process to sketch a slope field, we usually use a computer to make the drawing. Most popular computer algebra systems can draw slope fields. There are also various online tools that can make the drawings. The slope field for is shown in Figure 8.1.11.
Example 8.1.12. A graphical solution to an initial value problem.
Solution.
The solution to the initial value problem should be a continuous smooth curve. Using the slope field, we can draw of a sketch of the solution using the following two criteria:
- The solution must pass through the point
- When the solution passes through a point
it must be tangent to the line segment at
Essentially, we sketch a solution to the initial value problem by starting at the point and βfollowing the linesβ in either direction. A sketch of the solution is shown in Figure 8.1.13.
Example 8.1.14. Using a slope field to predict long term behavior.
Use the slope field for the differential equation shown in Figure 8.1.15, to predict long term behavior of solutions to the equation.
Solution.
This differential equation, called the logistic differential equation, often appears in population biology to describe the size of a population. For that reason, we use (time) as the independent variable instead of We also often restrict attention to non-negative -values because negative values correspond to a negative population.
Looking at the slope field in Figure 8.1.15, we can predict long term behavior for a given initial condition.
- If the initial
-value is negative ( ), the solution curve must pass though the point and follow the slope field. We expect the solution to become more and more negative as time increases. Note that this result is not physically relevant when considering a population. - If the initial
-value is greater than 0 but less than 1, we expect the solution to increase and level off at - If the initial
-value is greater than 1, we expect the solution to decrease and level off at
The slope field for the logistic differential equation, along with representative solution curves, is shown in Figure 8.1.16. Notice that any solution curve with positive initial value will tend towards the value We call this the carrying capacity.
Subsection 8.1.3 Numerical Solutions to Differential Equations: Eulerβs Method
While the slope field is an effective way to understand the qualitative behavior of solutions to a differential equation, it is difficult to use a slope field to make quantitative predictions. For example, if we have the slope field for the differential equation from Example 8.1.10 along with the initial condition we can understand the qualitative behavior of the solution to the initial value problem, but will struggle to predict a specific value, for example, with any degree of confidence. The most straightforward way to predict is to find the analytic solution to the the initial value problem and evaluate it at Unfortunately, we have already mentioned that it is impossible to find analytic solutions to many differential equations. In the absence of an analytic solution, a numerical solution can serve as an effective tool to make quantitative predictions about the solution to an initial value problem.
There are many techniques for computing numerical solutions to initial value problems. A course in numerical analysis will discuss various techniques along with their strengths and weaknesses. The simplest technique is called Eulerβs Method.
This notation can be confusing at first, but β β simply means βthe -value of the solution when the -value is β, and β β means βthe -value of the solution when the -value is β.
If we remove the limit but restrict to be βsmall,β we have
so that
because according to the differential equation. Rearranging terms,
This statement says that if we know the solution ( -value) to the initial value problem for some given -value, we can find an approximation for the solution at the value by taking our -value and adding times the function evaluated at the and values. Eulerβs method uses the initial condition of an initial value problem as the starting point, and then uses the above idea to find approximate values for the solution at later -values. The algorithm is summarized in Key Idea 8.1.17.
Key Idea 8.1.17. Eulerβs Method.
- For
define - The value
is given by the initial condition. For define
Letβs practice Eulerβs Method using a few concrete examples.
Example 8.1.18. Using Eulerβs Method 1.
Solution.
Our initial condition yields the starting values and With it takes steps to get to Using steps 1 and 2 from the Eulerβs Method algorithm,
Using Eulerβs method, we find the approximate
To help visualize the Eulerβs method approximation, these three points (connected by line segments) are plotted along with the analytical solution to the initial value problem in Figure 8.1.19.
This approximation doesnβt appear terrific, though it is better than merely guessing. Letβs repeat the previous example using a smaller -value.
Example 8.1.20. Using Eulerβs Method 2.
Solution.
Our initial condition yields the starting values and With we need steps on the interval Using steps 1 and 2 from the Eulerβs Method algorithm (and rounding to 4 decimal points), we have
Using Eulerβs method, we find
These five points, along with the points from Example 8.1.18 and the analytic solution, are plotted in Figure 8.1.21.
Using the results from Examples 8.1.18 and 8.1.20, we can make a few observations about Eulerβs method. First, the Euler approximation generally gets worse as we get farther from the initial condition. This is because Eulerβs method involves two sources of error. The first comes from the fact that weβre using a positive -value in the derivative approximation instead of using a limit as approaches zero. Essentially, weβre using a linear approximation to the solution (similar to the process described in Section 4.4 on Differentials.) This error is often called the local truncation error. The second source of error comes from the fact that every step in Eulerβs method uses the result of the previous step. That means weβre using an approximate -value to approximate the next -value. Doing this repeatedly causes the errors to build on each other. This second type of error is often called the propagated or accumulated error.
A second observation is that the Euler approximation is more accurate for smaller -values. This accuracy comes at a cost, though. Example 8.1.20 is more accurate than Example 8.1.18, but takes twice as many computations. In general, numerical algorithms (even when performed by a computer program) require striking a balance between a desired level of accuracy and the amount of computational effort we are willing to undertake.
Letβs do one final example of Eulerβs Method.
Example 8.1.22. Using Eulerβs Method 3.
Find an approximation for the solution to the logistic differential equation
Solution.
The logistic differential equation is what is called an autonomous equation. An autonomous differential equation has no explicit dependence on the independent variable ( in this case). This has no real effect on the application of Eulerβs method other than the fact that the function is really just a function of To take steps in the variable, we use
Using steps requires Implementing Eulerβs Method, we have
These 11 points, along with the the analytic solution, are plotted in Figure 8.1.23. Notice how well they seem to match the true solution.
The study of differential equations is a natural extension of the study of derivatives and integrals. The equations themselves involve derivatives, and methods to find analytic solutions often involve finding antiderivatives. In this section, we focus on graphical and numerical techniques to understand solutions to differential equations. We restrict our examples to relatively simple initial value problems that permit analytic solutions to the equations, but we should remember that this is only for comparison purposes. In reality, many differential equations, even some that appear straightforward, do not have solutions we can find analytically. Even so, we can use the techniques presented in this section to understand the behavior of solutions. In the next two sections, we explore two techniques to find analytic solutions to two different classes of differential equations.
Exercises 8.1.4 Exercises
Terms and Concepts
1.
In your own words, what is an initial value problem, and how is it different than a differential equation?
2.
In your own words, describe what it means for a function to be a solution to a differential equation.
3.
How can we verify that a function is a solution to a differential equation?
4.
Describe the difference between a particular solution and a general solution.
5.
Why might we use a graphical or numerical technique to study solutions to a differential equation instead of simply solving the differential equation to find an analytic solution?
6.
Describe the considerations that should be made when choosing an value to use in a numerical method like Eulerβs Method.
Problems
Exercise Group.
In the following exercises, verify that the given function is a solution to the differential equation or initial value problem.
Exercise Group.
In the following exercises, verify that the given function is a solution to the differential equation and find the value required to make the function satisfy the initial condition.
Exercise Group.
In the following exercises, sketch a slope field for the given differential equation. Let and range between and
Exercise Group.
Match each slope field below with the appropriate differential equation.
The and the axis are shown both uncalibrated. In the second and the third quadrants the field lines towards larger negative values are south facing. The field lines closer to the axis are south-east facing. Around the axis the field lines are almost horizontal. In the first and the fourth quadrants the field lines closer to the axis are east facing but for greater values of they are south-east facing.
The field lines are concentric facing upwards in the second and the first quadrant along the positive axis. The lines furthest away from the origin are more circular and the lines closest to the axis are almost parallel to the axis. Similarly in the third and the fourth quadrant the field lines are concentric along the negative axis and the ones away from origin are more circular and the ones closest to the axis are almost parallel to the axis.
The field lines in the second and the first quadrant are south-east facing and appear to be east facing when they come very close to the axis. Similarly the field lines in the third and the fourth quadrants are north-east facing and become east facing when they come very close to the axis.
The field lines appear to be concentric dome shaped lines with peaks along the positive axis.
Exercise Group.
In the following exercises, sketch the slope field for the differential equation, and use it to draw a sketch of the solution to the initial value problem.
Exercise Group.
In the following exercises, use Eulerβs Method to make a table of values that approximates the solution to the initial value problem on the given interval. Use the specified or value.