Section 1.5 FirstOrder Linear Equations
Objectives

To understand that any firstorder linear differential equation
\begin{equation*} y' + p(x) y = g(x) \end{equation*}can be solved by multiplying each side of the equation by an integrating factor.
To understand the existence and uniqueness of solutions to firstorder initial value problems.
A firstorder differential equation is an equation of the form
This equation will not be separable if \(p(t)\) is not a constant. We shall have to find a new approach to solving such an equation. We could, of course, use a numerical algorithm to solveÂ (1.5.1); however, we can always find an algebraic solution to a firstorder linear differential equation. Moreover, the fact that we can obtain such a solution analytically will prove very useful when we investigate more complicated equations and systems of equations.
Subsection 1.5.1 Mine Tailings
In any mining operation, tailings are what is left after everything of value has been extracted. For example, in a hard rock mining operation, ore is often pulverized and then processed using chemicals to extract certain minerals of value. Soft rock mining operations such as coal mining or extracting oil from tar sands might use solvents or water to extract any commodity of value. The material that is left over after the minerals, coal, or oil is extracted can often present huge environmental challenges. There are different ways of processing mine tailings, but one way is to store them in a pond, especially if water is used in the mining operation. This method allows any particles that are suspended in the water to settle to the bottom of the pond. The water can then be treated and recycled.
Suppose that we have a gold mining operation and we are storing our tailings in a pond that has an initial volume of 20,000 cubic meters. When we begin our operation, the tailings pond is filled with clean water. The pond has a stream flowing into it, and water is also pumped out of the pond. Chemicals are used in processing gold ore. These chemicals such as sodium cyanide can be highly poisonous and dangerous to the environment, and the water must be treated before it is released into the watershed. Suppose that 1000 cubic meters per day flow into the pond from stream and 1000 cubic meters are pumped from the pond each day to be processed and recycled. Thus, the water level of the pond remains constant.
At time \(t = 0\text{,}\) the water from stream becomes contaminated with chemicals from the mining operation, say at a rate of 5 kilograms of chemicals per 1000 cubic meters. We will assume that water in our tailings pond is well mixed so that the concentration of chemicals through out the pond is fairly uniform. In addition, any particulate matter pumped into the pond from the stream settles to the bottom of the pond at a rate of 50 cubic meters per day. Thus, the volume of our tailings pond is reduced by 50 cubic meters each day, and our tailings pond will become full after 400 days of operation. We shall assume that the particulate matter and the chemicals are included in the 1000 cubic meters that flow into the pond from the stream each day.
We wish to find a differential equation that will model the amount of chemicals in the tailings pond at any particular time. Let \(x(t)\) be the amount of chemicals in the pond at time \(t\text{.}\) Then \(dx/dt\) is the difference between the rate at which the chemicals are entering the pond and the rate at which the chemicals leave the pond.
Since water flows into the pond from the stream at a rate of 1000 cubic meters per day, the rate at which the chemicals enter the pond is 5 kilograms per day. On the other hand, the rate at which the chemicals leave the pond will depend on the amount of chemicals in the pond at time \(t\text{.}\) The volume of the pond is decreasing due to sediment, and at time \(t\) it is \(V(t) = 20000  50t\text{.}\) Thus, the concentration of chemicals in the pond at time \(t\) is \(x/(20000  50 t)\text{,}\) and the rate at which the chemicals are flowing out of the pond to be recycled is
Hence, the differential equation that models the amount of chemical in the tailings pond at time \(t\) is
Of course, we will have to cease mining operations once the pond is full, since there will only be water in the pond if \(V(t) = 20000  50t \geq 0\text{;}\) that is, when \(0 \leq t \lt 400\text{.}\)
Notice that equationÂ (1.5.2) is not autonomous. In fact, it is not even separable. We will have to use a different approach to find a solution. First, we will rewrite the equation in the form
If we multiply both sides of this equation by \((400  t)^{20}\text{,}\) we obtain
We now make the crucial observation that the product rule applies to the lefthand side of our equation,
Thus, equationÂ (1.5.3) becomes
Integrating both sides of this equation, we have
where \(C\) is an arbitrary constant. Solving for \(x\text{,}\) we obtain
Since \(x(0) = 0\text{,}\) we can quickly determine that \(C =  (5/19)400^{19}\) and that the solution to our initial value problem is
The graph of the solution to our differential equation (FigureÂ 1.5.1) fits the situation. Initially, there are no chemicals in the pond, but \(x(t)\) quickly increases. However, the amount of chemicals decreases as the pond begins to fill with sediment. Eventually, there are no chemicals at \(t = 400\text{.}\)
Subsection 1.5.2 FirstOrder Linear Equations
The differential equation
is an example of a firstorder linear differential equation. More specifically, a firstorder linear differential equation is an equation that can be written in the form
Let us first show how to solve firstorder linear equations when the coefficient functions are constant. If
then we first multiply both sides of the equation by \(e^{pt}\) to obtain
The lefthand side of the equation is exact. That is,
If we integrate both sides of
then
If we apply the initial condition, we can determine \(C\text{,}\)
Thus, the solution that we seek is
Example 1.5.2.
Suppose we wish to solve the initial value problem
Multiplying both sides of equationÂ (1.5.4) by \(e^{2t}\text{,}\) we obtain
Integrating both sides of this last equation, gives us the following
Applying the initial condition \(x(0) = 1\text{,}\) we can conclude that \(C = 5/2\text{,}\) and
Example 1.5.3.
Now let us solve a firstorder linear differential equation where the coefficients are not constant. Suppose that
where \(y(0) = 1\text{.}\) We will multiply both sides of the equation by \(e^{x^2}\) and use the product rule to obtain
Integrating both sides, we get
Thus, the general solution is
Using the initial condition to solve for \(C\text{,}\) we find that \(C = 1\) and
We can use Sage to check our solution.
Surprisingly, the strategy in ExampleÂ 1.5.3 will always work. Suppose that
If we choose \(P(t)\) such that \(P'(t) = p(t)\) and multiply both sides of the equation by \(e^{P(t)}\text{,}\) then
Integrating both sides,
or
The Fundamental Theorem of Calculus tells us that \(P(t) = \int p(t) \, dt\text{.}\) We say that
is an integrating factor for the differential equationÂ (1.5.6).
Example 1.5.4.
Consider the initial value problem
Our integrating factor is
Multiplying both of our differential equation by \(\mu(x) = x^{2}\text{,}\) we obtain
or
We can now integrate this equation to get
The initial condition \(y(2) = 4\) allows us to find \(C = 5\text{.}\) Therefore, the solution to our initial value problem is
Activity 1.5.1. Finding Solutions to FirstOrder Linear Differential Equations.
Solve each of the following initial value problems.
(a)
\(y' = 3y + t\text{;}\) \(y(0) = 1\)
(b)
\(x' = tx + 2t\text{;}\) \(x(1) = 2\)
(c)
\(y' = 2x  3y + e^{x}\text{;}\) \(y(0) = 1\)
(d)
\(\dfrac{du}{dt} = \dfrac{t  1}{t} u + t^2\text{;}\) \(u(1) = 0\)
(e)
\(y' = \sin x  y\text{;}\) \(y(0) = 1\)
Subsection 1.5.3 Mixing Models
Many applications involve the mixing of two or more substances together. As we mentioned previously, we can model how petroleum products are mixed together in a refinery, how various ingredients are mixed together in a brewery, or how greenhouse gases move across various layers of the earth's atmosphere.
Example 1.5.5.
Suppose that a 100gallon tank initially contains 50 gallons of salt water containing five pounds of salt. A brine mixture containing one pound of salt per gallon flows into the top of the tank at a rate of 5 gallons per minute. A well mixed solution leaves the tank at rate of 4 gallons per minute. We wish to know how much salt is in the tank, when the tank is full.
To construct our model, we will let \(t\) be the time (measured in minutes) and set up a differential equation that will measure how fast the amount of salt at time \(t\text{,}\) \(x(t)\text{,}\) is changing. We have the initial condition \(x(0) = 5\text{,}\) and
where \(V(t)\) is the volume at time \(t\text{.}\) The expression \(x/V(t)\) is the amount of salt in one gallon at time \(t\text{.}\) We have \(V(t) = 50 + t\text{,}\) since the tank starts with 50 gallons and five gallons are pumped into the tank per minute while four gallons leave the tank during the same time interval. Thus, our differential equation becomes
Our equation is linear since we can rewrite it as
An integrating factor for this differential equation is
Therefore, if we multiply both sides of equationÂ (1.5.7) by \(\mu(t)\text{,}\) we get
We can now apply the product rule to obtain
Integrating both sides and simplifying gives us
Our initial condition, \(x(0) = 5\) tells us that \(C = 281{,}250{,}000\) and
Thus, when the tank is full, \(t = 50\) and the amount of salt in the tank is \(x(50) = 97.188\) pounds. We can use Sage to easily check the solution of our initial value problem.
Activity 1.5.2. A Mixing Problem.
Suppose that a tank contains 1000 gallons of a solution consisting of 200 pounds of salt dissolved in water. Pure water is pumped into the tank at a rate of 6 gallons per minute. At the same time, the tank is drained at the same rate. Assume that the brine mixture is kept well stirred.
(a)
Set up an initial value problem to model the amount of salt in the tank at time \(t\text{.}\)
(b)
How long will it take until there is only 20 pounds of salt left in the tank?.
Subsection 1.5.4 Finance Models
There are a number of problems in finance that can be modeled using differential equations. Let \(P(t)\) be the balance of an account at time \(t\) and suppose that the account pays interest at a rate of \(r\) percent per year compounded continuously. Suppose that we also allow withdrawals of \(W\) dollars per year. The net increase in the balance between times \(t\) and \(t + \Delta t\) can now be described as
Thus,
We can solve the equation
by multiplying both sides of the equation by the integrating factor
to obtain
Integrating both sides of this equation, we have
or
If we know the initial balance in the account, say \(P(0) = P_0\text{,}\) we can determine \(C\text{.}\) That is,
or
Thus, the solution to our initial value problem is
Example 1.5.6.
Suppose that your parents have established a money market account with a balance of $50,000 that they will use to help you pay for your college education. The account receives an average annual interest of 4%. You estimate that your tuition, room and board, and other college expenses to be $20,000 per year.
We model this financial situation with the differential equation
Rewriting the differential equation as \(dP/dt  0.04P = 20000\text{,}\) our integrating factor becomes \(\mu(t) = e^{0.04t}\text{,}\) and
Thus,
The solution to this initial value problem is
Your parents have been quite generous but have told you that you must be responsible for the balance of the cost of your education.
Activity 1.5.3. Paying for College.
Suppose that new parents want to start a college fund for their child. They are willing to invest $2000 per year at a rate of 4%.
(a)
Find an initial value problem that models the parents' investment.
(b)
How much will be in the college fund when their child turns 18?
(c)
What would they need to invest per year to have $80,000 in the college fund when their child turns 18?
Subsection 1.5.5 Existence and Uniqueness of Solutions
Several questions about the existence and uniqueness of solutions to firstorder linear differential equations now arise.
Does an initial value problem always have a solution?
Is the solution unique?
Is the solution globally defined or does it only hold for a small interval?
We can use the following theorem to answer these questions.
Theorem 1.5.7.
If
is a differential equation such that \(y(t_0) = y_0\text{,}\) and \(p(t)\) and \(g(t)\) are continuous on the open interval \(I = (\alpha, \beta)\text{,}\) then there exists a unique function \(y = \phi(t)\) satisfying the differential equation and the initial condition on \(I\text{.}\)
Proof.
If
then
Integrating both sides of this equation and solving for \(y\text{,}\) we have
Since \(y(t_0) = y_0\text{,}\) the constant \(C\) is uniquely determined. Notice that we have used continuity to guarantee that the integrals exist.
Subsection 1.5.6 Important Lessons

Any firstorder linear differential equation
\begin{equation*} y' + p(x) y = g(x) \end{equation*}can be solved by multiplying each side of the equation by an integrating factor
\begin{equation*} \mu(s) = e^{\int p(x) \, dx}. \end{equation*}In this case, we get
\begin{equation*} \left( e^{P(x)} y \right)' = e^{P(x)} ( y'(x) + p(x) y(x) ) = e^{P(x)} g(x). \end{equation*}Integrating both sides,
\begin{equation*} e^{P(x)} y = \int e^{P(x)} g(x) \, dx \end{equation*}or
\begin{equation*} y = \frac{1}{e^{P(x)} } \int e^{P(x)} g(x) \, dx. \end{equation*} 
If
\begin{equation*} y' + p(t) y = g(t) \end{equation*}is a differential equation such that \(y(t_0) = y_0\text{,}\) and \(p(t)\) and \(g(t)\) are continuous on the open interval \(I = (\alpha, \beta)\text{,}\) then there exists a unique function \(y = \phi(t)\) satisfying the differential equation and the initial condition on \(I\text{.}\)
Reading Questions 1.5.7 Reading Questions
1.
Explain in your own words what a firstorder linear differential equation is.
2.
What important rule from differential calculus do we use when solving a firstorder differential equation?
Exercises 1.5.8 Exercises
Finding General Solutions.
Find the general solution for each equation in Exercise GroupÂ 1.5.8.1â€“10.
1.
\(\dfrac{dy}{dx} + 5y = 0\)
2.
\(x'  7x = 0\)
3.
\(y' + 2xy = 0\)
4.
\(\dfrac{dx}{dt} t^2 x = 0\)
5.
\(y' + \dfrac{2}{x}y = 0\)
6.
\(\dfrac{dy}{dx}  5y = e^x\)
7.
\(y'  5y = 10x\)
8.
\(\dfrac{dx}{dt}  5x = \sin 2t\)
9.
\(y'  \dfrac{3}{x^2} y = \dfrac{1}{x^2}\)
10.
\(\dfrac{dy}{dx} + \dfrac{2}{x} y = \dfrac{\sin x}{x^2}\)
Solving Initial Value Problems.
Solve the initial value problems in Exercise GroupÂ 1.5.8.11â€“20.
11.
\(\dfrac{dy}{dx} + 5y = 0\text{,}\) \(y(0) = 2\)
12.
\(x'  7x = 0\text{,}\) \(x(0) = 1\)
13.
\(y' + 2xy = 0\text{,}\) \(y(0) = 3\)
14.
\(\dfrac{dx}{dt} t^2 x = 0\text{,}\) \(x(0) = 1\)
15.
\(y' + \dfrac{2}{x}y = 0\text{,}\) \(y(1) = 3\)
16.
\(y' =  \dfrac{2y}{x + 1} + 2x\text{,}\) \(y(0) = 2\)
\(y = \dfrac{3 x^{4} + 8 x^{3} + 6 x^{2} + 12}{6 (x + 1)^2}\)
17.
\(y' =  \dfrac{2y}{1 + x} + e^x\text{,}\) \(y(0) = 1\)
\(y = (e^x + 1)/(x+1)^2\)
18.
\(\dfrac{dx}{dt}  5x = \sin 2t\text{,}\) \(x(0) = \pi\)
19.
\(y' = y \tan x + \dfrac{e^x}{\cos x}\text{,}\) \(y(0) = 1\)
\(y = e^x \sec x\)
20.
\(y' =  \dfrac{y}{x + 2} + \dfrac{\cos x}{x + 2}\text{,}\) \(y(0) = 1\)
\(y = \sin x / (x + 2)\)
21.
A 600liter tank initially contains 200 liters of water containing 10 kilograms of salt. Supposed that water containing 0.1 kilograms of salt flows into the top of the tank at a rate of 10 liters per minute. The water in the tank is kept well mixed, and 5 liters per minute are removed from the bottom of the tank. How much salt is in the tank when the tank is full?
If \(x(t)\) is the amount of salt in the tank at time \(t\text{,}\) we know that \(x(0) = 10\text{.}\) The volume of the tank is \(V = 200 + 5t\text{.}\) We can model the amount of salt in the tank at time \(t\) with a differential equation,
The resulting equation
is a first order linear differential equation. An integrating factor for this equation is given by
Multiplying both sides of the differential equation by \(\mu(t)\text{,}\) we have
Integrating both sides of this equation, we obtain
Using the intial condition \(x(0) = 10\text{,}\) we can determine that \(C = 400\) or
The tank is full at time \(t = 400/5 = 80\text{,}\) and the tank contains \(x(80) = 170/3 \approx 56.67\) kilograms of salt when the tank is full.
22.
A manager in a communications company contributes $2400 per year into her retirement fund by making many small deposits throughout the year. The fund grows at a rate of 3.5% per year compounded continuously. After 35 years, she retires and begins and begins withdrawing from the retirement fund at a rate of $3500 per month. If she does not make any deposits after she retires, how long will her retirement fund last? [Hint: Divide the problem into two smaller problemsâ€”one that deals with the situation before retirement and one that deals with the problem after retirement.]
23.
Lake Baikal, located in southern Siberia, is only the seventh largest lake in the world in terms of surface area; however, it is the world's deepest lake. The lake has a depth of 1,642 meters, and the bottom lies 1,186.5 meters below sea level. Lake Baikal has a volume of 23,600 cubic kilometers and contains 20% of the world's unfrozen fresh water. In contrast, Lake Superior, the largest of the Great Lakes, has a volume of only 12,100 cubic kilometers. Although 544 rivers flow into Lake Baikal, there is only a single outlet, the Angara River. The outflow of the lake is pretty constant at 60.4 cubic kilometers per year.
Pollution is an increasing concern in Lake Baikal. One of the major polluters has been Baykalsk Pulp and Paper Mill. The mill was constructed in 1966 on the shoreline of Lake Baikal and regularly discharged waste into the lake. The plant was closed in November 2008 due to unprofitability, but production resumed in January 2010. The mill underwent a final bankruptcy in September 2013, but the longterm fate of the mill is still undecided.^{â€‰1â€‰}
Suppose that we wish to understand how the pollution level changes in Lake Baikal over a period of years. Hypothetically, let us assume that the Baykalsk Pulp and Paper Mill has been responsible for most of the pollution in Lake Baikal for the last several decades. Suppose that at \(t = 0\) years the mill ceases operation and there are no longer any pollutants discharged into the lake from the mill although there are still other sources of pollution. Let us assume that the lake is currently 6 times more polluted than these other sources of contaminants. We wish to know how long it will take for the pollution level to reduce to half of its current level of lake. Lake Baikal's waters are wellmixed and welloxygenated in spite of its great depth, so we can model this situation as a simple mixing problem.

The volume of water in Lake Baikal is \(V = 23,600 \text{ km}^3\text{,}\) and
\begin{equation*} r_{\text{in}} = r_{\text{out}} = r = 60 \text{ km}^3/\text{year} \end{equation*}be the rates of inflow from the numerous rivers that feed the lake and outflow to the Angara River. Assume that \(C = C_{\text{in}}\) is the pollutant concentration flowing into Lake Baikal and \(C_{\text{out}}\) is the concentration of the outflow into the Angara River (measured in metric tons per cubic km). If \(x(t)\) is the amount of solute at time \(t\) in Lake Baikal, then
\begin{equation*} x_0 = x(0) = 6CV \end{equation*}is the initial amount of solute in the lake. Estimate \(\Delta x\) during the time interval \([t, t + \Delta t]\text{,}\) where \(\Delta t > 0\) is small.
From your estimate of \(\Delta x\) in part (1), write an initial value problem that describes the amount of pollutants in the lake at time \(t\text{.}\)
The equation that you found in part (2) is a firstorder linear equation. Solve this equation.
Using part (3), predict how many years it will take to reduce the pollution in Lake Baikal to half of its current level.
24.
Variation of Parameters. Consider the following method of solving the general linear equation of the first order,

If \(g(t)\) is identically zero, show that the solution is
\begin{equation*} y = A \exp\left[  \int p(t) \, dt \right], \end{equation*}where \(A\) is a constant.

If \(g(t)\) is not identically zero, assume that the solution is of the form
\begin{equation} y = A(t) \exp\left[  \int p(t) \, dt \right],\tag{1.5.9} \end{equation}where \(A\) is now a function of \(t\text{.}\) By substituting for \(y\) in the given differential equation (1.5.8), show that \(A(t)\) must satisfy the condition
\begin{equation} A'(t) = g(t) \exp\left[ \int p(t) \, dt \right].\tag{1.5.10} \end{equation} 
Find \(A(t)\) from Equation (1.5.10). Then substitute for \(A(t)\) in equation (1.5.9) and determine \(y\text{.}\) Verify that the solution obtain in this manner agrees with the solution given in the proof of Theorem TheoremÂ 1.5.7. That is, show that this solution is equivalent to the solution
\begin{equation*} y = \frac{1}{\mu(t)} \left( \int \mu(t) g(t) \, dt + C \right), \end{equation*}where
\begin{equation*} \mu(t) = \exp\left( \int p(t) \, dt \right). \end{equation*}
This technique is know as variation of parameters, which we will revisit when we study second order linear differential equations.
25.
Bernoulli's equation is an equation of the form
where \(n \neq 0\) or 1. Bernoulli's equation is nonlinear and cannot be solved by the techniques that we have used to solve first order linear equations.^{â€‰2â€‰}

Using the substitution \(z = y^{1 n}\text{,}\) show that we can transform Bernoulli's equation into the linear equation
\begin{equation*} z' = (1 n )a(t) z + (1n) f(t). \end{equation*} Solve the equation \(xy' + y = x^4y^3\text{.}\)
26.
The firstorder nonlinear differential equation
is known as the Ricatti equation and has some useful applications in control theory. If one solution \(y_1(t)\) of the Ricatti equation is known, then a more general solution containing an arbitrary constant can be found by substituting \(y = y_1(t) + 1/v(t)\) into equation (1.5.11) to find a firstorder linear equation in \(v\) and \(t\text{,}\) which we can solve to find a general solution to the Ricatti equation.
Show that this firstorder linear equation is \(v' + [q(t) + 2 r(t) y_1(t)]v =  r(t)\text{.}\)

Find the solution to the Ricatti equation
\begin{equation*} y' =  \frac{1}{t^2}  \frac{1}{t} y + y^2 \end{equation*}given the particular solution \(y_1 = 1/t\text{.}\)

Find the solution to the Ricatti equation
\begin{equation*} y' = \cos t  y \tan t + y^2 \sec t \end{equation*}given the particular solution \(y_1 = \sin t\text{.}\)

Find the solution to the Ricatti equation
\begin{equation*} y' = 2  3y + y^2 \end{equation*}given the particular solution \(y_1 \equiv 2\text{.}\)

If \(y = y_1 + 1/v\text{,}\) then \(y' = y_1'  v'/v^2\text{.}\) Substituting into our original equation, we obtain
\begin{equation*} y' = y_1'  \frac{v'}{v^2} = p + q y_1 + r y_1^2  \frac{v'}{v^2}. \end{equation*}On the other hand,
\begin{align*} y' & = p + q \left(y_1 + \frac{1}{v} \right) + r \left(y_1 + \frac{1}{v} \right)^2\\ & = p + q y_1 + \frac{q}{v} + r y_1^2 + \frac{2r y_1}{v} + \frac{r}{v^2}\\ & = y_1' + \frac{q}{v} + \frac{2r y_1}{v} + \frac{r}{v^2}. \end{align*}Therefore,
\begin{equation*}  \frac{v'}{v^2} = \frac{q}{v} + \frac{2r y_1}{v} + \frac{r}{v^2}, \end{equation*}which is just the firstorder linear equation
\begin{equation*} v' + [q(t) + 2 r(t) y_1(t)]v =  r(t). \end{equation*}  \begin{equation*} y = t + \frac{1}{C  t} \end{equation*}
 \begin{equation*} y(t) = \frac{1}{C \cos t  \sin t} + \sin t \end{equation*}
 \begin{equation*} y(t) = 2 + \frac{1}{C e^t  1} \end{equation*}
27.
Suppose that we have a population that not only grows logistically but also requires a minimum threshold population to survive. For example, the case of the North Pacific right whale, a species now very much on the endangered list. If the population drops too low, whales might not be able to find suitable mates and the species will eventually go extinct. In other words, the population will die out if it drops below a certain threshold. We can model this with the following equation,
where \(P\) is the population of the whales at time \(t\) and \(N\) is the carrying capacity. The constants \(k\) and \(a\) are positive with \(a \lt 1\text{.}\)
Find the equilibrium solutions of the this equation.
Since equation (1.5.12) is autonomous, we can find a solution using separation of variables. Find this solution.
Equation (1.5.12) is also a Ricatti equation (1.5.11). Since we know an equilibrium solution from part (1), we can use the method of the previous problem to find a general solution to (1.5.12). Find the general solution using the fact that we have a Ricatti equation and show that your solution agrees with the solution that you found in part (2).
www.nytimes.com/2010/11/09/world/europe/09baikal.html
.