First notice that neither tank will change in total gallons at any time.
The pump is just mixing the water among the 2 tanks continuously. So eventually the concentration in each tank will be the same as concentration of both tanks put together.
Total gallons = 500, Total Salt = 50
Concentration = 50/500 = 1/10
If tank A has this concentration , then salt = 20
For tank B the salt amount is then 30.
This gives us 2 points, an initial amount and a finishing amount as t -> infinity.
To find functions for x(t) and y(t) , we need to look at the rate of change.
![Rate = R_{in} - R_{out}](https://tex.z-dn.net/?f=Rate%20%3D%20R_%7Bin%7D%20-%20R_%7Bout%7D%20)
For tank A, 20/300 or 1/15 of tank B salt is coming in. While 20/200 or 1/10 of its own salt is leaving.
For tank B its just the other way around.
This will give a system of 2 differential equations:
![\frac{dx}{dt} = \frac{y}{15} - \frac{x}{10}](https://tex.z-dn.net/?f=%5Cfrac%7Bdx%7D%7Bdt%7D%20%3D%20%5Cfrac%7By%7D%7B15%7D%20-%20%5Cfrac%7Bx%7D%7B10%7D)
![\frac{dy}{dt} = \frac{x}{10} - \frac{y}{15}](https://tex.z-dn.net/?f=%5Cfrac%7Bdy%7D%7Bdt%7D%20%3D%20%5Cfrac%7Bx%7D%7B10%7D%20-%20%5Cfrac%7By%7D%7B15%7D)
From this we can say:
![\frac{dy}{dt} = -\frac{dx}{dt}](https://tex.z-dn.net/?f=%5Cfrac%7Bdy%7D%7Bdt%7D%20%3D%20-%5Cfrac%7Bdx%7D%7Bdt%7D)
![y = -x+C](https://tex.z-dn.net/?f=y%20%3D%20-x%2BC)
Plug this in for y in the dx/dt equation:
![\frac{dx}{dt} = \frac{-x+C}{15} -\frac{x}{10} = -\frac{x+C}{6}](https://tex.z-dn.net/?f=%5Cfrac%7Bdx%7D%7Bdt%7D%20%3D%20%5Cfrac%7B-x%2BC%7D%7B15%7D%20-%5Cfrac%7Bx%7D%7B10%7D%20%3D%20-%5Cfrac%7Bx%2BC%7D%7B6%7D%20)
Solving this differential equation gives:
![\int \frac{dx}{x+C} = \int -\frac{dt}{6}](https://tex.z-dn.net/?f=%20%5Cint%20%5Cfrac%7Bdx%7D%7Bx%2BC%7D%20%3D%20%5Cint%20-%5Cfrac%7Bdt%7D%7B6%7D%20)
![\ln (x+C) = -\frac{t}{6} +k](https://tex.z-dn.net/?f=%5Cln%20%28x%2BC%29%20%3D%20-%5Cfrac%7Bt%7D%7B6%7D%20%2Bk)
![x = k e^{-t/6} +C](https://tex.z-dn.net/?f=x%20%3D%20k%20e%5E%7B-t%2F6%7D%20%2BC)
The dy/dt equation is solved exactly the same way, so you have:
![y = k e^{-t/6} +C](https://tex.z-dn.net/?f=y%20%3D%20k%20e%5E%7B-t%2F6%7D%20%2BC)
All thats left is to apply initial and final conditions to get constants.
The final solution is:
![x(t) = -10e^{-t/6}+20](https://tex.z-dn.net/?f=x%28t%29%20%3D%20-10e%5E%7B-t%2F6%7D%2B20)