# Formation of differential equation under given conditions

A tank contains $100 L$ of lime solution in which $50$ $gm$ of salt is dissolved.Lime water containing $2gm/L$ of salt runs into the tank at the rate of $5L/min$ and flows out of the tank at the rate of $4L/min$.Form an differential equation of the process and solve it.Also find the expression for the amount of salt present at time $t$.

​Could someone help me with this problem. I am not able to initiate.

One way of setting up this differential equation is in terms of salt concentration, the mass of salt per unit volume of water. If we assume the solution is continuously mixed, it will be constant throughout the system. We know the initial concentration is $C_0=0.5\frac{g}{L}$. Suppose the total mass of dissolved salt is $m$, the volume of the system is $V$, and the concentration is $C=\frac{V}{m}$. All three quantities vary in time. Water with salt concentration $C_{in}$ is flowing in at a rate of $F_{in}$ and water is flowing out at a rate $F_{out}$

The rate of change of mass from the source and drain is the concentration multiplied by the flow rate.

$$\frac{dm}{dt}=C_{in}F_{in}-CF_{out}=C_{in}F_{in}-\frac{m}{V}F_{out}$$

The volume, however, is also changing at a rate of $\frac{dV}{dt}=F_{in}-F_{out}$, so $V=V_0+(F_{in}-F_{out})t$.

We can use the quotient rule to find the derivative of C.

$$\frac{dC}{dt}=\frac{d}{dt}(\frac{m}{V})=\frac{V\frac{dm}{dt}-m\frac{dV}{dt}}{V^2}=\frac{C_{in}F_{in}V-mF_{in}}{V^2}=\frac{C_{in}F_{in}-CF_{in}}{V}$$

$$\frac{dC}{dt}=\frac{C_{in}F_{in}-CF_{in}}{V_0+(F_{in}-F_{out})t}$$

This equation can be solved by separation of variables, since everything except $C$ and $t$ is a constant.