It is desired to draw off a part of 10 gallons of 30% solution of alcohol and to replace it by pure alcohol so as to produce a 50% solution. How many gallons should be drawn off?
Let us assume x gallons is drawn off and replaced with x gal of pure alcohol.
After drawing of x gallons of the 30% mix, what is left is (10 - x) gallons of
30% mix.
Since it is a 30% mix, volume of alcohol in it = (10 - x)*30% = (10 - x)*0.3
= 3 - 0.3*x
After adding x gallons of pure alcohol, the total volume of the mix is again
back to 10 gallons.
In this new mix, the volume of alcohol is = original alcohol + x gallons =
(3 - 0.3*x) + x = 3 + 0.7*x
Now, this is given to be a 50% mix. i.e. ratio of alcohol in the mix is 0.5
Therefore,

gallons
Hope you got it :)