# Concentration of a solution over time

#### kankerfist

##### New member
I have come across the following question in my study guide:

5 lb of salt is initiall dissolved in a tank holding 15 gal of water. Saltwater is pumped into the tank at a rate of 2gal/min and the fully-mixed solution flows out of the tank at a rate of 3 gal/min. If the salt concentration entering the tank is 2lb/gal, determine the amount of salt in the tank at time t.

I built the following differential equation in order to find the amount of salt at time t. I'm not sure if I set this part up correctly:
$$\displaystyle \left\{ \begin{array}{l} S'(t) = 4 - 3\left( {\frac{{S(t)}}{{15 - t}}} \right) \\ S(0) = 5 \\ \end{array} \right.$$

where S(t) is lb of dissolved salt at time t. When I solve this initial-value D.E, I get the following solution for S(t):
$$\displaystyle S(t) = - 2(t - 15) - \frac{{25\left( {15} \right)^3 }}{{(15 - t)^3 }}$$
But my teacher's solution is:
$$\displaystyle S(t) = - 2(t - 15) - 25\left( {\frac{{15 - t}}{{15}}} \right)^3$$

I think my problem is that I did not make a correct differential equation that reflects the system. Any help would be appreciated!

#### galactus

##### Super Moderator
Staff member
$$\displaystyle \L\\\frac{dy}{dt}=\text{rate in - rate out}$$

$$\displaystyle \L\\\text{rate in}=(2\frac{lb}{gal})(2\frac{gal}{min})=4\frac{lb}{min}$$

$$\displaystyle \L\\\text{rate out}=(\frac{y(t)}{15}\frac{lb}{gal})(3\frac{gal}{min})=\frac{y(t)}{5}\frac{lb}{min}$$

$$\displaystyle \L\\\frac{dy}{dt}=4-\frac{y}{5}$$

$$\displaystyle \L\\\frac{dy}{dt}+\frac{y}{5}=4$$

$$\displaystyle \text{Initial condition}: y(0)=5$$

$$\displaystyle \text{Integrating factor}=e^{\int{\frac{1}{5}dt}}=e^{\frac{t}{5}}$$

$$\displaystyle \L\\\frac{d}{dy}(e^{\frac{t}{5}}y)=4e^{\frac{t}{5}}$$

$$\displaystyle \L\\e^{\frac{t}{5}y}=\int{4e^{\frac{t}{5}}}dt=20e^{\frac{t}{5}}+C$$

$$\displaystyle \L\\y=20+Ce^{\frac{-t}{5}}$$

$$\displaystyle \text{Using the intial condition, we find C=15, so we have:$$

$$\displaystyle \L\\y(t)=20-15e^{\frac{-t}{5}}$$

#### kankerfist

##### New member
Thanks for the reply! In terms of salt in water, I was under the impression that:
$$\displaystyle \frac{{dS}}{{dt}} = (R_{in} )(C_{in} ) - (R_{out} )\left( {\frac{{S(t)}}{{V + (R_{in} - R_{out} )t}}} \right)$$
Where R,C,and V are rate of flow, concentration, and initial volume, respectively. At least that is what my teacher gave us in our notes. This is because the concentration of the fluid leaving the system changes over time due to the concentration in the intake... Is this not the right way to do it? I'm so confused because my teacher, myself, mathematica, and now you all have come up with different solutions! This class is such a pain...

#### galactus

##### Super Moderator
Staff member
I built the following differential equation in order to find the amount of salt at time t. I'm not sure if I set this part up correctly:
$$\displaystyle \L\\ \left\{ \begin{array}{l} S'(t) = 4 - 3\left( {\frac{{S(t)}}{\underbrace{15 -t}}} \right) \\ S(0) = 5 \\ \end{array} \right.$$
Note the underbrace?. If you would've used $$\displaystyle 4-3(\frac{S(t)}{15})$$, you'd have the same thing I came up with.
I don't know how your teacher wants you to do it, but I would do it using the integrating factor.