Let the tub contain 5x litres of P and 3x litres of Q. total = 8x litres of mixture. When are taken out, (8x-16) litres will be left
The mixture will now contain 58(8x−16)=5(x−2) litres of P and 3(x-2) litres of Q.
Given that 16 litres of Q are added.
Ratio is given as
5(x−2)3(x−2)+16=35
Solving we get x-2=3 ; x=5
Tub will hold 8x = 40 litres