Differential equations can also be used to model mixing or dilution problems. If we call $y$ the quantity of a given substance in a solution, then its rate of change with respect to time $t$ will be given by
$$
\frac{dy}{dt}=\text{ flow in }-\text{ flow out}.
$$
On the other hand,
$$
\text{ flow }= \text{ concentration } \times \text{ velocity},
$$
and
$$
\text{ concentration } = \frac{ \text{ quantity } }{\text{ volume }}.
$$
(Notice that the volume might depend on $t$ as well, such as in case the velocities of flow in and flow out are different.)
This gives us

$$
\frac{dy}{dt} =\frac{y \text{ coming in }}{\text{ volume }}\times \text{ velocity in }
-\frac{y \text{ going out }}{\text{ volume }}\times \text{ velocity out}.
$$

Example: Lake Pristine holds 50,000 m$^3$ of water. An accident at a nearby factory dumps 10 tons of toxic waste into the lake, where it dissolves. Every day, 5,000 m$^3$ of clean water flows into the lake and 5,000 m$^3$ of lake water flows out. How much waste will remain in the lake in 30 days?