Let ,in the mixture $x$ litre water and $y$ litre milk was present at first.
Now we added 1 litre of water in the mixture.
Now ,the in the mixture $(x+1)$ litre water and $y$ litre milk present .
Now percentage of milk is $\large =\frac{y}{x+1+y}$
Now it is given as $25$% .
$\large \frac{y}{x+1+y}=\frac{1}{4}$
or, $\large x-3y=-1$ ……………………….(1)
Now we added again 1 litre of milk in this mixture.
Now ,the in the mixture $(x+1)$ litre water and $(y+1)$ litre milk present .
Now percentage of milk is $\large =\frac{y+1}{x+1+y+1}$
Now it is given as $40$% .
$\large \frac{y+1}{x+1+y+1}=\frac{2}{5}$
or, $\large 2x-3y=1$ ……………………….(2)
Now $(2)-(1)$
$\large 2x-3y-x+3y=1-(-1)$
so , $x=2$
Putting value of $x$ in $(2)$ we get,
$y=1$
So, initially in the mixture 2 litre water and 1 litre milk was present .
So percentage of milk initialy is=$\large \frac{1}{2+1}*100%$=$\large 33\frac{1}{3}%$%