The dimensions of the box formed will be:
width: 20 - 2x
length: 40 - 2x
height: x
Volume = width x length x height
1500 = x(20 - 2x)(40 - 2x)
1500 = x(800 + 4x² - 120x)
1500 = 4x³ - 120x² + 800x
0 = 4x³ - 120x² + 800x - 1500
0 = x³ - 30x² + 200x - 375
Solving the cubic equation:
x = 5 (only integer root)
Length = 30 cm
Width = 10 cm
Height = 5 cm