Section 2.4 Solving Systems Analytically
Objectives

To understand that a system of the form
\begin{align*} \frac{dx}{dt} & =f(x)\\ \frac{dy}{dt} & = g(y) \end{align*}is decoupled and can be solved by solving each equation independently.

To understand that a system of the form
\begin{align*} \frac{dx}{dt} & =f(x),\\ \frac{dy}{dt} & = g(x, y) \end{align*}is partially coupled system and can be solved by first solving the first equation and then substituting the solution into the second equation, which can then be solved.

To be able to use Sage to solve systems of the form
\begin{align*} x' & = ax + by\\ y' & = cx + dy. \end{align*}
Mixing problems model how substances flow back and forth between two or more compartments. These problems often arise in applicationsāfor example, we might want to model how greenhouse gases flow back and forth between different layers of the earth's atomosphere[17], how chemicals move between tanks in a refinery or a brewery, or how pollutants move between a series of lakes or ponds. Systems of differential equations can prove very useful when it comes to modeling such situations.
Subsection 2.4.1 Partially Coupled Systems
We will use linear systems of differential equations such as
to illustrate how we can use systems of differential equations to model how substances flow back and forth between two or more compartments. Suppose that we have two tanks (\(A\) and \(B\)) between which a mixture of brine flows (FigureĀ 2.4.1). Tank \(A\) contains 300 liters of water in which 100 kilograms of salt has been dissolved and Tank \(B\) contains 300 liters of pure water. Fresh water is pumped into Tank \(A\) at the rate of 500 liters per hour, and brine is pumped into Tank \(B\) from Tank \(A\) at the rate of 500 liters per hour. Brine is also drained at a rate 500 liters of brine per hour from Tank \(B\text{.}\) All brine mixtures are wellstirred. If we let \(x = x(t)\) be the amount of salt in Tank \(A\) at time \(t\) and \(y = y(t)\) be the amount of salt in Tank \(B\) at time \(t\text{,}\) then we know that
We know that the salt concentrations in the two tanks are \(x/300\) kilograms per liter and \(y/300\) kilograms per liter. Thus, we can describe the rate of change in each tank with a differential equation,
We can now ask how we might solve the system of equations
The task of solving the system
may be quite difficult or even impossible. However, we can find solutions in certain cases. For example, if we have a system of the form
then each equation is an autonomous firstorder equation. To solve our system, we only need to solve two firstorder equations. Such a system is said to be decoupled. Generalizing slightly, we say that a partially coupled system is a system of the form
Since the first equation is an autonomous firstorder equation in \(x\text{,}\) we can solve this equation separately, and substitute our solution into the second equation.
Consider the system
We can easily solve the first equation, \(dx/dt = x\text{,}\) to obtain \(x = a e^t\text{.}\) Using this information in the second equation, we have
which is a firstorder linear equation. This equation has an integrating factor \(\mu(t) = e^{t}\text{,}\) and
Therefore, the solution to our second equation is
Revisiting the mixing problem that we posed at the beginning of this section, we have the following initial value problem,
Solving \(dx/dt =  (5/3) x\) is easy. We can quickly determine that \(x(t) = c_1 e^{5t/3}\text{.}\) Applying the initial condition \(x(0) = 100\text{,}\) we can determine that \(c_1 = 100\) and \(x(t) = 100 e^{5t/3}\text{.}\) Our second equation now becomes
This last equation is a firstorder linear equation
Multiplying both sides of this last equation by the integrating factor \(\mu(t) = e^{5t/3}\) yields
Integrating both sides of this last equation gives us
Using our initial condition \(y(0) = 0\text{,}\) we can determine that \(c_2 = 0\text{.}\) Thus,
Example 2.4.2.
Consider the partially coupled system
Notice that we already have the tools to solve \(x' = 2x\text{.}\) In fact, the solution is \(x(t) = c_1 e^{2t}\text{.}\) We can use this information to solve the second equation, \(y' = x + 3y\text{.}\) That is, if we use the fact that \(x(t) = c_1 e^{2t}\text{,}\) the second equation becomes
We can rewrite this equation as
which is a firstorder linear equation. If we multiply both sides of the equation by \(\mu(t) = e^{3t}\text{,}\) we have
Integrating, we have
Solving for \(y\text{,}\) yields \(y =  c_1 e^{2t} + c_2e^{3t}\text{.}\) Thus the solution to our system is
Activity 2.4.1. Solving Partially Coupled Systems.
Solve each of the following systems of differential equations.
(a)
(b)
(c)
(d)
Subsection 2.4.2 Using Sage to Solve Linear Systems
Solving linear systems such as
is much more difficult, since we cannot use the same strategies that we used to solve partiallycoupled systems. We will devote all of ChapterĀ 3 to finding an answer. However, we can use Sage to solve linear systems for the moment. The following is a Sage interact that will solve the initial value problem
however, we can change the coefficients and initial values to be anything that we like.
Subsection 2.4.3 Harmonic Oscillators
The equation
is a specific case of a damped harmonic oscillator, where \(m = 1\text{,}\) the spring constant is 2, and the damping constant is 3. We can rewrite this equation as a firstorder linear system,
Suppose that \(x(0) = 0\) is the initial position of the mass and \(v(0) = 1\) is the initial velocity. We can use Sage to verify that the solution to our system is
This is an example of an overdamped harmonic oscillator (FigureĀ 2.4.4). In other words, a springmass system that is modeled by this system of equations has so much damping that the mass will not oscillate.
Now let us relax the damping and increase the spring constant on our harmonic oscillator,
The corresponding linear system is
Notice that our initial conditions have not changed. We again use Sage to solve our system.
The solution to our system is
Notice that the system oscillates due to the sine and cosine terms in the solution. This system is underdamped (FigureĀ 2.4.5).
Subsection 2.4.4 Important Lessons

A system of the form
\begin{align*} \frac{dx}{dt} & =f(x)\\ \frac{dy}{dt} & = g(y) \end{align*}is said to be decoupled. Such a system can be solved by solving each equation independently.

A system of the form
\begin{align*} \frac{dx}{dt} & =f(x),\\ \frac{dy}{dt} & = g(x, y) \end{align*}is a partially coupled system. Since the first equation is an autonomous firstorder equation in \(x\text{,}\) we can solve this equation separately, and substitute our solution into the second equation.

We can use Sage to solve systems of the form
\begin{align*} x' & = ax + by\\ y' & = cx + dy. \end{align*} Sage is useful for investigating the behavior of harmonic oscillators.
Reading Questions 2.4.5 Reading Questions
1.
Explain what a partially coupled system is?
2.
Why would you expect that it is impossible to find explicit solutions for most systems of differential equations?
Exercises 2.4.6 Exercises
1.
Solve each of the following partially coupled systems.
 \begin{align*} x' & = 2x\\ y' & = x + 2y \end{align*}
 \begin{align*} x' & = x + 3y\\ y' & = 2y \end{align*}
 \begin{align*} x' & = 3x\\ y' & = 2x + 3y \end{align*}
 \begin{align*} x' & = 2x  3y\\ y' & = 4y \end{align*}
2.
Suppose that we have two tanks (\(A\) and \(B\)) between which a mixture of brine flows. Tank \(A\) contains 200 liters of water in which 20 kilograms of salt has been dissolved and Tank \(B\) contains 200 liters of water in which 10 kilograms of salt has been dissolved. Fresh water is pumped into Tank \(A\) at the rate of 200 liters per hour, and brine is pumped into Tank \(B\) from Tank \(A\) at the rate of 200 liters per hour. Brine is also drained at a rate 200 liters of brine per hour from Tank \(B\text{.}\) All brine mixtures are wellstirred. Find the amount of salt in each tank at time \(t\text{.}\)
3.
For each of the following harmonic oscillators (1) rewrite the secondorder initial value problem as a system of two firstorder linear equations, (2) use Sage to solve the system of linear equations, and (3) classify the harmonic oscillator as underdamped, critically damped, or overdamped.
 \begin{align*} y'' + 7y' + 6y & = 0\\ y(0) & = 1\\ y'(0) & = 0 \end{align*}
 \begin{align*} y'' + 4y' + 5y & = 0\\ y(0) & = 1\\ y'(0) & = 0 \end{align*}
 \begin{align*} y'' + 6y' + 9y & = 0\\ y(0) & = 1\\ y'(0) & = 0 \end{align*}