A tank contains 1000L of brine with a concentration of .5kb of salt per liter. In order to dilute the solution, brine with a concentration of 0.1kg of salt per liter runs into the tank at a rate of 20L/min and the resulting solution, which is stirred continuously, runs out at the same rate. How many kilograms of salt will remain after t minutes?

$\displaystyle A = kilograms of salt$

$\displaystyle A' = (concentration in rate * rate of flow in) - (concentration out rate * rate of flow out)$

$\displaystyle A' = (0.1 * 20) - (A/1000 * 20)$

$\displaystyle dA/dt = 2 - 0.02A$

$\displaystyle dA = (2 - 0.02A ) dt$

$\displaystyle \int dA/(2 - 0.02A ) = \int dt$

$\displaystyle ln \left|2 - 0.02A\right| + C_2 = t + C_1$

$\displaystyle Note: C = C_1 - C_2$

$\displaystyle 2 - 0.02A = e^{t+C}$

$\displaystyle 0.02A = 2 -Ke^t for K \in R$

$\displaystyle A(t) = 50(2-Ke^t) $

$\displaystyle A(0) = 0.5 = 50(2-Ke^0) $

$\displaystyle A(0) = 0.01 = 2-K$

$\displaystyle A(0) = 0.01-2 = -K$

$\displaystyle K = 1.99 = 199/100$

$\displaystyle A(t) = 50(2-\frac{199}{100}e^t)$

From skimming this, did I make any mistakes?