Explanation:
while the other answer is correct, let me try to explain this in a different optical way :
50% means 50/100 = 1/2 = 5/10 of the substance is acid.
20% means 20/100 = 1/5 = 2/10 of the substance is acid.
40% means 40/100 = 2/5 = 4/10 of the substance is acid.
now, we want to find the quantity of x quarts that satisfies the desired balance :
x × 50% + 20 × 20% = (x + 20) × 40%
x × 5/10 + 20 × 2/10 = (x + 20) × 4/10
5x/10 + 4 = 4x/10 + 8
x/10 = 4
x = 40
so, yes, we need to add 40 quarts of the 50% solution.
that gives us 60 quarts, with 40% = 40/100 = 4/10 = 2/5 = being acid : 60 × 2/5 = 120/5 = 24 quarts