Concept: The question tests on the application in Mixture & Average problems
Solution:
Average Concentration = (C1Q1 + C2Q2) / (Q1 + Q2)
Total volume = 6 gallons. Let Amount of Y = a, then X = 6 - a
40 = [30 * (6 - a) + 60a] / 6
240 = 180 - 30a + 60a
30a = 60
a = 2 gallons
Option B