Let x=number of litres of 40% alcohol solution. The amount of alcohol is 0.4x litres.
20 litres of 80% alcohol contains 20×0.8=16 litres of alcohol.
The amount of mixture is 20+x litres and it contains 0.6(20+x) litres of alcohol.
So 0.4x+16=0.6(20+x)=12+0.6x.
Therefore 16-12=0.2x, 0.2x=4 and x=4/0.2=40/2=20 litres.
We need 20 litres of 40% alcohol solution.