Number of marbles John has is x.
Given, John and Jivanti together have 45 marbles.
Number of marbles which Jivanti has = 45 – x
Now, both of them lost 5 marbles each, and the product of the number of marbles they now have is 128.
So John will have x - 5 marbles and Jivanti will have 45 - x - 5 = 40 - x marbles.
⇒ (x – 5)(40 – x) = 128
⇒ 40x – 200 + 5x – x2 = 128
⇒ 40x – 200 + 5x – x2 - 128 = 0
⇒ 45x – 328 – x2 = 0
⇒ x2 – 45x + 328 = 0