If we view the differential equation \(y' = f(t,y)\) as a formula for the slope of a tangent line to a solution curve, we can approximate the graph of a solution curve. For example, if we consider the equation \(y' = t + y\text{,}\) then a solution curve will have a slope of \(2\) at the point \((1, 1)\text{.}\) We can use this information to obtain a geometric description of the solutions to the equation.

Suppose that we wish to analyze how an electric current flows through a circuit. An RC circuit is a very simple circuit might contain a voltage source, a capacitor, and a resistor (Figure 1.19). A battery or generator is an example of a voltage source. The glowing red heating element in a toaster or an electric stove is an example of something that provides resistance in a circuit. A capacitor stores an electrical charge and can be made by separating two metal plates with an insulating material. Capacitors are used to power the electronic flashes for cameras. Current, \(I(t)\text{,}\) is the rate at which a charge flows through this circuit and is measured in amperes or amps (A). We assign a direction to the current. A current flowing in the opposite direction will be given negative values.

The source voltage, \(E(t)\text{,}\) is measured in volts (V). Kirchhoff's Second Law tells us that the impressed voltage in a closed circuit is equal to the sum of the voltage drops in the rest of the circuit. Thus, we need only compute the voltage drop across the resistor, \(E_R\text{,}\) and the voltage drop across the capacitor, \(E_C\text{.}\) According to Kirchhoff's Law, this is

\begin{equation*}
E_R + E_C = E.
\end{equation*}

Resistance, \(R\text{,}\) to the current is measured in ohms (\(\Omega\)). Ohm's Law tells us that the voltage drop across a resistor is given by

We will now investigate how our circuit reacts under different voltage sources. For example, we might have a zero voltage source (the capacitor could still hold a charge). We could also have a constant nonzero source of voltage such as a battery or a fluctuating source of voltage such as a generator. We might even have a series of pulses of voltage where the current is periodically turned on and off. We would like to be able to understand the solutions to the equation (1.7) for different voltage sources \(E(t)\text{.}\) If we view the differential equation (1.7) as an expression for computing how fast current is flowing across the capacitor, we can analyze our circuit from a geometric point of view and can actually say a great deal about circuits without solving a differential equation.

can be viewed as a formula for the slope of a function \(y = y(t)\text{.}\) Geometrically, the equation tells us that, at any point \((t_0, y_0)\text{,}\) the slope of a solution curve is given by \(f(t_0, y_0)\text{.}\) Suppose that our differential equation is defined on the rectangle \(R = [a, b] \times [c, d]\text{,}\) and let \(y(t)\) be a solution curve for \(y' = f(t, y)\) that passes through the point \((t_0, y_0)\text{.}\) Then the differential equation tells us the slope of this solution curve at \((t_0, y_0)\text{.}\) We can indicate this on the \((t, y)\)-plane by drawing a short line segment at the point \((t, y)\) with slope \(f(t_0, y_0)\text{.}\) Thus, we can obtain a direction field or slope field for the differential equation. A solution curve must be tangent to its direction field at every point.

For example, consider the differential equation \(y' = y^2/2 - t\text{.}\) The direction field for this equation is given in Figure 1.20 along with several solution curves.

Although direction fields can be tedious to compute using pencil and paper, we can easily generate direction fields for any differential equation with the use of computer software. Most computer algebra systems, including Sage, have facilities for generating and graphing direction fields. For example, the following Sage cell will generate the direction field for \(y' = y^2/2 - t\) using the command plot_slope_field. We will learn how to add solution curves at the end of this section.

with \(R = 1\) and \(C = 1\text{.}\) First suppose that there is no voltage source in the circuit. If we let \(E(t) = 0\) for all \(t \ge 0\text{,}\) we will get the direction field of given in Figure 1.21. The direction field agrees with our analytic solution

If we assume that we have a nonzero constant source of voltage, \(E(t) = K\text{,}\) in our circuit such as a battery, then we obtain the separable differential equation

\begin{equation*}
\frac{d E_C}{dt} = K - E_C.
\end{equation*}

The direction field for this differential equation for \(K = 10\) is given in Figure 1.22.

If we attach a battery to our circuit at time \(t = 0\) and then disconnect the battery at \(t = 4\text{,}\) then we obtain a different solution. For example, if

\begin{equation*}
E(t) =
\begin{cases}
10 & 0 \leq t \leq 4, \\
0 & t \gt 4,
\end{cases}
\end{equation*}

we will obtain a different direction field (Figure 1.23).

If our voltage source emits a series of pulses, say

then the direction field for our differential equation is given in Figure 1.24.

Finally, if we use a generator for a voltage source, the voltage source might be given by a function such as \(E(t) = \sin(\pi t /2)\text{.}\) The direction field for this circuit is given in Figure 1.25.

Subsection1.3.4Plotting Direction Fields with Sage

The Sage interact below will help you plot direction fields for a given initial value problem. A Sage interact is a menu driven Sage applet. Simply evaluate the Sage cell. You can then change each field in the cell output to solve a particular initial value problem.

Of course, it is quite easy to give the interact an initial-value problem that yield unitelligible results.

In other words, a differential equation is autonomous if it does not depend on $t$. Since an autonomous differential equation is time independent, its direction field is particularly easy to graph. The slope only depends on \(x\) and is the same for all values of \(t\text{.}\)

Example1.26A Logistic Model with Harvesting

Let us consider a trout pond that has a carrying capacity of 200 fish. Suppose that the trout population can be modeled according to the logistic equation

The direction field for this equation is given in Figure 1.27.

One of the basic questions that we can ask of our model is whether or not we have a sustainable population in our trout pond given this harvest rate. If so, under what conditions for sustainablility?

is an autonomous differential equation, the direction field does not depend on \(t\text{.}\) Consequently, we need only keep track of what happens on the vertical axis. We can do this with a phase line. Instead of drawing the entire direction field, we can draw a single line containing the same information (Figure 1.28).

Notice that \(dP/dt = 0\) when \(P= 40\) or \(P = 160\text{.}\) Thus, the two constant solutions \(P(t) = 40\) and \(P(t) = 160\) are the same for all values of the independent variable \(t\text{.}\) We say that such a solution is an equilibrium solution. Equilibrium solutions graph as horizontal lines on the direction field. We can identify equilibrium solutions by setting the derivative of the function equal to zero. On our phase line we will represent these solutions as equilibrium points. For values of \(P\) between 40 and 160, we know that \(dP/dt \gt 0\text{.}\) Thus, any solution curve must be increasing. We denote this property on the phase line by drawing an upward pointing arrow. On the other hand, we know that \(dP/dt \lt 0\) when \(P \lt 40\) or \(P \gt 160\text{.}\) In this case any solution curve will be decreasing, and we will indicate this by a downward pointing arrow.

Let \(y' = f(y)\) and suppose that \(y = y_0\) is an equilibrium solution. We say this solution is a sink if for any solution \(y(t)\) with initial condition sufficiently close to \(y_0\text{,}\) we have

We say that an equilibrium point is a source if all solutions that start sufficiently close to \(y_0\) tend toward \(y_0\) as \(t \to - \infty\text{.}\) An equilibrium solution that is neither a sink or a source is called a node (Figure 1.28). When \(P= 40\text{,}\) we have a source, and when \(P = 160\text{,}\) we have a sink

An equilibrium solution is stable if a small change in the initial conditions gives a solution which tends toward the equilibrium as the independent variable tends towards positive infinity. An equilibrium solution is unstable if a small change in the initial conditions gives a solution which veers away from the equilibrium as the independent variable tends towards positive infinity.

The graph of \(f(y) = y^4 - 4y^2\) is given in Figure 1.29. If \(y = -2\text{,}\) we have a sink. If \(y = 2\text{,}\) we have a source. Finally, if \(y = 0\text{,}\) we have a node.

It is easy to generate a phase line diagram for equation (1.8) from the graph of \(f(y) = y^2(y + 2)(y - 2)\) (Figure 1.29). If the graph is above the \(y\)-axis, then \(y\) is increasing. If the graph is below the \(y\)-axis, then \(y\) is decreasing. Therefore, the phase line is easy to sketch (Figure 1.30).

One of the reasons why autonomous equations are so important is Taylor's theorem, which tells us that any function \(f(x)\) can be approximated near a point \(x_0\) by an \(n\)th degree polynomial,

Direction fields and phase lines are a useful way of analyzing a differential equation from a geometric point of view, especially since not all differential equations can be solved analytically.

An autonomous equation is a differential equation of the form \(y' = f(y)\text{.}\) We can use a phase line to analyze autonomous differential equations.

Equilibrium solutions to a differential equation \(y' = f(y)\) are those solutions given by \(f(y) = 0\) for all \(y\text{.}\) In this case, any solution must be constant. We can classify equilibrium solutions according to whether they are stable or unstable. In particular, an equilibrium solution is either a sink, source, or node.

Find all of the equilibrium solutions for each of the following differential equations. Use Sage to graph the direction field of each equation and then superimpose a plot of the equilibrium solution(s) on the direction field. Classify each equilibrium solution as a sink, a source, or a node.

\(y' = 2y(1 - y)\)

\(\dfrac{dP}{dt} = 0.1P(P - 100)\)

\(\dfrac{dx}{dt} = (2 - x)\cos x\)

\(\dfrac{dy}{dx} = (2 - y)\cos x\)

2

Consider the differential equation \(y' = f(y)\text{,}\) where the graph of \(f(y)\) is given below. Identify any equilibrium solutions and classify each equilibrium solution as a sink, source, or node.

3

What happens if we increase the harvest rate to 100 in Example Example 1.26.? What should be our strategy to maintain a viable population in the trout pond?

Subsection1.3.8Sage—Plotting Direction Fields and Solutions

If we wish to plot a direction field for a differential equation, we can use the command plot_slope_field. Let us plot the direction field for the equation \(y' = y^2/2 - t\text{.}\)

There are a few extra commands to specify the size of the arrows in the plot and to label the axes. Try changing or omitting these commands and see what happens.

Now let us find a numerical solution to the equation using the command desolve_rk4. This is a fourth-order Runge-Kutta method, and returns a numerical solution (a table of values). Here, we must supply the dependent variable and initial conditions.

At time \(t = 30\text{,}\) a disease is introduced into the population that kills 10\% of the population per year. To see how the disease affects the fish population, we will change our original model to the folllowing: