Suppose that a 100-gallon 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
\begin{align*}
\frac{dx}{dt} & = \text{rate of salt flowing in} - \text{rate of salt flowing out}\\
& = \underbrace{5}_{\text{in flow}} - \underbrace{4 \frac{x}{V(t)}}_{\text{out flow}},
\end{align*}
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
\begin{equation*}
\frac{dx}{dt} = 5 - \frac{4}{50 + t}x.
\end{equation*}
Our equation is linear since we can rewrite it as
\begin{equation}
\frac{dx}{dt} + \frac{4}{50 + t} x = 5.\tag{1.5.7}
\end{equation}
An integrating factor for this differential equation is
\begin{equation*}
\mu(t) = \exp\left( \int \frac{4}{50 + t} \, dt \right) = e^{4 \ln(50 + t)} = (50 + t)^4.
\end{equation*}
Therefore, if we multiply both sides of equation
(1.5.7) by
\(\mu(t)\text{,}\) we get
\begin{equation*}
(50 + t)^4\frac{dx}{dt} + 4(t + 50)^3 x = 5(50 + t)^4.
\end{equation*}
We can now apply the product rule to obtain
\begin{equation*}
\frac{d}{dt}[ (50 + t)^4 x] = 5(50 + t)^4.
\end{equation*}
Integrating both sides and simplifying gives us
\begin{equation*}
x = t + 50 + \frac{C}{(t + 50)^4}.
\end{equation*}
Our initial condition, \(x(0) = 5\) tells us that \(C = -281{,}250{,}000\) and
\begin{equation*}
x(t) = t + 50 - \frac{281250000}{(t + 50)^4}.
\end{equation*}
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.