Let x = amount of 30% salt solution.
Then, 40 - x = amount of 20% salt solution
Salt content of first solution + salt content of second solution =
salt content of the mixture
So, 0.30x + 0.20(40 - x) = 0.25(40)
0.30x + 8 - 0.20x = 10
0.10x = 2
x = 20
ANSWER: mix 20L of 30% solution with 20L of 20% solution to obtain 40L of 25% solution