Salt flows in at a rate of (5 g/L)*(3 L/min) = 15 g/min.
Salt flows out at a rate of (x/10 g/L)*(3 L/min) = 3x/10 g/min.
So the net flow rate of salt, given by [tex]x(t)[/tex] in grams, is governed by the differential equation,
[tex]x'(t)=15-\dfrac{3x(t)}{10}[/tex]
which is linear. Move the [tex]x[/tex] term to the right side, then multiply both sides by [tex]e^{3t/10}[/tex]:
[tex]e^{3t/10}x'+\dfrac{3e^{t/10}}{10}x=15e^{3t/10}[/tex]
[tex]\implies\left(e^{3t/10}x\right)'=15e^{3t/10}[/tex]
Integrate both sides, then solve for [tex]x[/tex]:
[tex]e^{3t/10}x=50e^{3t/10}+C[/tex]
[tex]\implies x(t)=50+Ce^{-3t/10}[/tex]
Since the tank starts with 5 g of salt at time [tex]t=0[/tex], we have
[tex]5=50+C\implies C=-45[/tex]
[tex]\implies\boxed{x(t)=50-45e^{-3t/10}}[/tex]
The time it takes for the tank to hold 20 g of salt is [tex]t[/tex] such that
[tex]20=50-45e^{-3t/10}\implies t=\dfrac{20}3\ln\dfrac32\approx2.7031\,\mathrm{min}[/tex]