Answer:
30 gallons of 20% acid solution should be mixed.
Step-by-step explanation:
Let x gallons of a 20% acid solution was mixed with 30 gallons of a 40% solution, to obtain a mixture of 30% acid solution.
Therefore, final volume of the solution will be (x + 30) gallons.
Now concept to solve this question is
20%.(x) + 40%.(30) = 30%.(x + 30)
0.20(x) + 0.40(30) = 0.30(x + 30)
0.20x + 12 = 0.30x + 9
0.30x - 0.20x = 12 - 9
.10x = 3
x = 
x = 30 gallons
Therefore, 30 gallons of the 20% acid solution should be mixed.