Let <em>a(t)</em> and <em>b(t)</em> denote the amounts of salt in tanks A and B, respectively.
The volume of liquid in tanks A and B after <em>t</em> minutes are
A: 50 L + (5 L/min + 3 L/min - 8 L/min)<em>t</em> = 50 L
B: 40 L + (7 L/min + 8 L/min - 3 L/min - 12 L/min)<em>t</em> = 40 L
so the amount of solution in the tanks stays constant.
Salt flows into tank A at a rate of
(2 g/L)*(5 L/min) + (<em>b(t)</em>/40 g/L)*(3 L/min) = (10 + 3/40 <em>b(t)</em>) g/min
and out at a rate of
(<em>a(t)</em>/50 g/L)*(8 L/min) = 4/25 <em>a(t)</em> g/min
so the net flow rate is given by the differential equation

We do the same for tank B: salt flows in at a rate of
(3 g/L)*(7 L/min) + (<em>a(t)</em>/50 g/L)*(8 L/min) = (21 + 4/25 <em>a(t)</em>) g/min
and out at a rate of
(<em>b(t)</em>/40 g/L)*(3 L/min + 12 L/min) = 3/8 <em>b(t)</em> g/min
and hence with a net rate of

Replace <em>a(t)</em> and <em>b(t)</em> with <em>x</em> and <em>y</em>. Then the system is (in matrix form)

with initial conditions <em>x(0)</em> = 60 g and <em>y(0)</em> = 80 g.