Let the two numbers be x and y.
Then x + y = 15
∴ y = 15 – x
Let P is the product of square of y and cube of x.


In both cases, product x3y2 is zero, which is not maximum.

∴ P is maximum when x = 6
If x = 6, then y = 15 – 6 = 9
Hence, the required numbers are 6 and 9.