In xL of 20% solution we have 0.2x L of pure alcohol. If we add yL of a 40% solution we are adding 0.4y L of pure alcohol and we have x+y=15L. The total amount of pure alcohol is 0.2x+0.4y. Since y=15-x, this amount is 0.2x+0.4(15-x)=0.2x+6-0.4x=6-0.2x in terms of x.