Let one number be x. Then, the other number is y = (35 − x).
Let P(x) = x2y5. Then, we have


When x = 35, y = 35 – 35 = 0 and the product x2y5 will be equal to 0.
When x = 0, y = 35 − 0 = 35 and the product x2y5 will be 0.
∴ x = 0 and x = 35 cannot be the possible values of x. When x = 10, we have

∴ By second derivative test, P(x) will be the maximum when
x = 10 and y = 35 − 10 = 25.
Hence, the required numbers are 10 and 25.