I didn’t understand this approach… Could you simplify it?
what if we take both x and y as 100 ml …i tired it did not work
We cannot take that … because ratio of their proportion is given as 3:2
It’s the shortcut method that @prakithgre has used which Greg has supported as well in the mixtures class.

You can use a visual representation of the avg milk % in the middle (40 ) and then have the individual %s of X (2a%) and Y (a%) on either side. (up to you whether you wish to put bigger % on left side and smaller % on right, in this instance the vice versa is done).

Then you have to take the difference of each individual % (a & 2a) and the average (40). Which will give you 40  a for Y and 2a  40 for X. (fyi  since we are using a bit of algebra, we need to do the subtractions properly i.e. to know that a is smaller than avg and 2a is bigger than avg).

Also make sure to flip the ratio for X & Y (that’s what prakithgre has done with the arrows) as that’s the trick of the formula to get it right… Basically this is the ratio of the percentages that get combined to make the average of 40. It just works and so don’t bother figuring out why we flip etc.
Finally, the same ratio is also equal to 300 ml vs 200 ml as that is the final volume ratio of X and Y.
Hence X/Y= 3/2 = (40a)/(2a40) = 25 % for a = milk % in Y.
I know its a lengthy explanation, but do some practice questions like this one and you’ll save a lot of time eventually.
Thanks
jeet
Since it asks for percentage we can do ‘choosing number’ here as well.
X = 1, Y = 1, %Milk = A/100
Given that X:Y = 3:2 and %Milk X:& %Milk Y = 2A: A
3*(2A/100) + 2*(A/100) = 40/100*(3+2)
(6A + 2A)/100 = 2
8A = 200, A = 25