how much of each solution should be used if 21 gallons of 4% solution are needed?

a mixture of 4% disinfectant solution is to be made from 5% and 2% disinfectant solutions. how much of each solution should be used if 21 gallons of 4% solution are needed?

let x = number of gal of 2% solution
 
so, 21 - x = number of gal of 5% solution
 
0.02x + 0.05(21 - x) = 0.04(21)
 
0.02x + 1.05 - 0.05x = 0.84
 
                     -0.03x = -0.21
 
                             x = 7
 
use 7 gal of 2% solution and 14 gal of 5% solution to obtain 21 gal of 4% solution.