### Learning Outcomes

- Draw the direction field for a given first-order differential equation.
- Use a direction field to draw a solution curve of a first-order differential equation

## 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 [latex]T\left(t\right)[/latex] represents the temperature (in degrees Fahrenheit) of an object at time [latex]t[/latex], and the ambient temperature is [latex]72^\circ\text{F}\text{.}[/latex] Figure 1 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: [latex]y^{\prime} =3x+2y - 4[/latex]. We let [latex]\left({x}_{0},{y}_{0}\right)[/latex] be any ordered pair, and we substitute these numbers into the right-hand side of the differential equation. For example, if we choose [latex]x=1[/latex] and [latex]y=2[/latex], substituting into the right-hand side of the differential equation yields

This tells us that if a solution to the differential equation [latex]y^{\prime} =3x+2y - 4[/latex] passes through the point [latex]\left(1,2\right)[/latex], then the slope of the solution at that point must equal [latex]3[/latex]. To start creating the direction field, we put a short line segment at the point [latex]\left(1,2\right)[/latex] having slope [latex]3[/latex]. We can do this for any point in the domain of the function [latex]f\left(x,y\right)=3x+2y - 4[/latex], which consists of all ordered pairs [latex]\left(x,y\right)[/latex] in [latex]{\mathbb{R} }^{2}[/latex]. 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 [latex]{y}^{\prime }=3x+2y - 4[/latex] is shown in Figure 2.

We can generate a direction field of this type for any differential equation of the form [latex]y^{\prime} =f\left(x,y\right)[/latex].

### 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 2 serves as a guide to the behavior of solutions to the differential equation [latex]y^{\prime} =3x+2y - 4[/latex]. Before developing this method, it is worthwhile to revisit the notion of a linear approximation.

### Recall: Linear Approximation OF a Function

The **linear approximation** of a function at a given point, also known as the **linearization**, is equivalent to the equation of the tangent line to the graph of the function at that point.

Since the slope of a function [latex] f(x) [/latex] at [latex] \left(x_0,y_0 \right) [/latex] is given by [latex] f'(x_0) [/latex], the linear approximation of a function [latex] f(x) [/latex] at a point [latex] \left(x_0,y_0 \right) [/latex] is:

[latex] L(x) = y_0 + f'(x_0) (x - x_0)[/latex]

For values near the point [latex] \left(x_0,y_0 \right) [/latex], [latex] L(x) \approx f(x) [/latex]. In other words, [latex] L(x) [/latex] can be used to predict function values near [latex] \left(x_0,y_0 \right) [/latex].

Put another way, the actual change in the function output, [latex] \Delta y [/latex], can be approximated using the slope at [latex] \left(x_0,y_0 \right) [/latex].

[latex] \Delta y \approx f'(x_0) \Delta x [/latex]

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 [latex]\left(0,1\right)[/latex], then the slope of the solution passing through that point is given by [latex]y^{\prime} =3\left(0\right)+2\left(1\right)-4=-2[/latex]. Now let [latex]x[/latex] increase slightly, say to [latex]x=0.1[/latex]. Using the method of linear approximations gives a formula for the approximate value of [latex]y[/latex] for [latex]x=0.1[/latex]. In particular,

Substituting [latex]{x}_{0}=0.1[/latex] into [latex]L\left(x\right)[/latex] gives an approximate [latex]y[/latex] value of [latex]0.8[/latex].

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 3 shows a graph of the solution passing through the point [latex]\left(0,1\right)[/latex].

The curve is the graph of the solution to the initial-value problem

This curve is called a solution curve passing through the point [latex]\left(0,1\right)[/latex]. The exact solution to this initial-value problem is

and the graph of this solution is identical to the curve in Figure 3.

### try it

Create a direction field for the differential equation [latex]y^{\prime} ={x}^{2}-{y}^{2}[/latex] and sketch a solution curve passing through the point [latex]\left(-1,2\right)[/latex].

Watch the following videos to see the worked solution to the above Try It

### Interactive

Now consider the direction field for the differential equation [latex]y^{\prime} =\left(x - 3\right)\left({y}^{2}-4\right)[/latex], shown in Figure 5. This direction field has several interesting properties. First of all, at [latex]y=-2[/latex] and [latex]y=2[/latex], horizontal dashes appear all the way across the graph. This means that if [latex]y=-2[/latex], then [latex]y^{\prime} =0[/latex]. Substituting this expression into the right-hand side of the differential equation gives

Therefore [latex]y=-2[/latex] is a solution to the differential equation. Similarly, [latex]y=2[/latex] 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 [latex]y=k[/latex] is a constant solution to the differential equation. Then [latex]{y}^{\prime }=0[/latex]. Substituting this expression into the differential equation yields [latex]0=\left(x - 3\right)\left({k}^{2}-4\right)[/latex]. This equation must be true for all values of [latex]x[/latex], so the second factor must equal zero. This result yields the equation [latex]{k}^{2}-4=0[/latex]. The solutions to this equation are [latex]k=-2[/latex] and [latex]k=2[/latex], which are the constant solutions already mentioned. These are called the equilibrium solutions to the differential equation.

### Definition

Consider the differential equation [latex]y^{\prime} =f\left(x,y\right)[/latex]. An **equilibrium solution** is any solution to the differential equation of the form [latex]y=c[/latex], where [latex]c[/latex] is a constant.

To determine the equilibrium solutions to the differential equation [latex]y^{\prime} =f\left(x,y\right)[/latex], set the right-hand side equal to zero. An equilibrium solution of the differential equation is any function of the form [latex]y=k[/latex] such that [latex]f\left(x,k\right)=0[/latex] for all values of [latex]x[/latex] in the domain of [latex]f[/latex].

An important characteristic of equilibrium solutions concerns whether or not they approach the line [latex]y=k[/latex] as an asymptote for large values of [latex]x[/latex].

### Definition

Consider the differential equation [latex]{y}^{\prime }=f\left(x,y\right)[/latex], and assume that all solutions to this differential equation are defined for [latex]x\ge {x}_{0}[/latex]. Let [latex]y=k[/latex] be an equilibrium solution to the differential equation.

- [latex]y=k[/latex] is an
**asymptotically stable solution**to the differential equation if there exists [latex]\epsilon >0[/latex] such that for any value [latex]c\in \left(k-\epsilon ,k+\epsilon \right)[/latex] the solution to the initial-value problem

[latex]{y}^{\prime }=f\left(x,y\right),y\left({x}_{0}\right)=c[/latex]

approaches [latex]k[/latex] as [latex]x[/latex] approaches infinity. - [latex]y=k[/latex] is an
**asymptotically unstable solution**to the differential equation if there exists [latex]\epsilon >0[/latex] such that for any value [latex]c\in \left(k-\epsilon ,k+\epsilon \right)[/latex] the solution to the initial-value problem

[latex]{y}^{\prime }=f\left(x,y\right),y\left({x}_{0}\right)=c[/latex]

never approaches [latex]k[/latex] as [latex]x[/latex] approaches infinity. - [latex]y=k[/latex] 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 [latex]y^{\prime} =\left(x - 3\right)\left({y}^{2}-4\right)[/latex], with the initial condition [latex]y\left(0\right)=0.5[/latex]. The direction field for this initial-value problem, along with the corresponding solution, is shown in Figure 6.

The values of the solution to this initial-value problem stay between [latex]y=-2[/latex] and [latex]y=2[/latex], which are the equilibrium solutions to the differential equation. Furthermore, as [latex]x[/latex] approaches infinity, [latex]y[/latex] approaches [latex]2[/latex]. The behavior of solutions is similar if the initial value is higher than [latex]2[/latex], for example, [latex]y\left(0\right)=2.3[/latex]. In this case, the solutions decrease and approach [latex]y=2[/latex] as [latex]x[/latex] approaches infinity. Therefore [latex]y=2[/latex] is an asymptotically stable solution to the differential equation.

What happens when the initial value is below [latex]y=-2?[/latex] This scenario is illustrated in Figure 7, with the initial value [latex]y\left(0\right)=-3[/latex].

The solution decreases rapidly toward negative infinity as [latex]x[/latex] approaches infinity. Furthermore, if the initial value is slightly higher than [latex]-2[/latex], then the solution approaches [latex]2[/latex], which is the other equilibrium solution. Therefore in neither case does the solution approach [latex]y=-2[/latex], so [latex]y=-2[/latex] is called an asymptotically unstable, or unstable, equilibrium solution.

### Example: Stability of an Equilibrium Solution

Create a direction field for the differential equation [latex]y^{\prime} ={\left(y - 3\right)}^{2}\left({y}^{2}+y - 2\right)[/latex] and identify any equilibrium solutions. Classify each of the equilibrium solutions as stable, unstable, or semi-stable.

### try it

Create a direction field for the differential equation [latex]y^{\prime} =\left(x+5\right)\left(y+2\right)\left({y}^{2}-4y+4\right)[/latex] and identify any equilibrium solutions. Classify each of the equilibrium solutions as stable, unstable, or semi-stable.