Applications of some Differential Equation I was practicing some questions to get a grip of differential equation when I stumbled upon this problem. It looks like this:

Tank A initially holds 100 gallons of brine that contains 100 pounds of salt, and tank B holds 100 gallons of water. Two gallons of water enter A each minute, and the mixture, assumed uniform, flows from A into tank B at the same rate. If the resulting mixture, also kept uniform, runs out of B at the rate of 2 gallons per minute, how much salt is in tank B at the end of 1 hour?

It seems confusing......to build a differential equation that would describe that statement above. How do you answer it?
 A: First, note that nothing is messing with the relative ratio of salt and brine, so there will always be one pound of salt per gallon of brine. So, we don't need to worry about the concentration of salt and brine separately, we can just consider the salt-brine mixture and water. 
Let $f_B(t)$ denote the volume (in gallons) of salt-brine mixture in tank $B$ at time $t$, and define $f_A(t)$ similarly for tank $A$. Then let $c_A(t) = \frac{f_A(t)}{100}$ denote the concentration of salt-brine mixture in tank $A$, and define $c_B(t)$ similarly. This definition for concentration is okay, since the volume of liquid in each tank is unchanging. 
Consider a small time interval $dt$. Over this period of time, $2dt$ gallons of water enter tank $B$, $2c_A(t)dt$ gallons of salt-brine mixture leave (that is, the volume of salt-brine-water mixture times the proportion of this liquid which is salt-brine mixture), and $2(1-c_A(t))dt$ gallons of water leave tank $A$. Therefore, the total volume of salt-brine mixture in tank $A$ is now $f_A(t+dt)=
 f_A(t) - 2c_A(t)dt$
$$\implies \frac{df_A}{dt} = -\frac{1}{50}f_A(t)$$
So now you can solve for $f_A(t)$. The process is similar for tank B; try it yourself before continuing this post. 
Over a small time interval $dt$, the amount of salt-brine mixture that leaves tank B is $2c_B(t)dt$, and the amount that comes in is $2c_A(t)dt$. So, the differential equation for $f_B$ is
$$\frac{df_B}{dt} = 2(c_A(t)-c_B(t)) = \frac{1}{50}(f_A(t)-f_B(t))$$
Since we know $f_A$, we can solve for $f_B$. 
A: Let $x$ be the pounds of salt in tank A and $y$ be the pounds of salt in tank B. Then the change in $x$ is:
$$\frac{dx}{dt} = -2\frac{x}{100}$$
and the change in $y$ is 
$$\frac{dy}{dt} = 2\frac{x}{100}-2\frac{y}{100},$$
where we've used "change = rate in x concentration in  - rate out x concentration out."
You can solve this system in a number of ways.  The "earliest" would be to take the derivative of the second and plug the the first for $x'$:
$$y'' = \frac{1}{50}x'-\frac{1}{50}y' = \frac{1}{50}(-2)\frac{x}{100}-\frac{1}{50}y'.$$
then solve the second equation for $x$ and plug it in this last expression:
$$y''=\frac{1}{50}(-2)\frac{50y'+y}{100}-\frac{1}{50}y'.$$
Collect like terms and you get:
$$y'' +\frac{1}{25}y' +\frac{1}{2500}y = 0,$$
which is solved pretty early in most DE books.  Then you have the initial conditions $y(0)=0$ and $x(0) = 100.$
