I'm not sure what you mean by "isn't the box supposed to be a square". The box is three dimensional so can't be a square which is two dimensional. Do you mean a cube? It could theoretically be but then 20- 2x would have to be the same as x: 20- 2x= x is the same as 3x= 20 or x= 20/3. Then the volume of the box would be (20/3)^3= 8000/27= 297.29... cubic inches, not 500.

Solving a general cubic can be very difficult but you titled this 'rational roots'. If this equationhasa rational root, it must be an integer divisor of the constant term, -50. Trying x= 5 we have 5^3- 20(5^2)+ 100(5)- 125= 125- 500+ 500- 125= 0. Yes, x= 5 is a root. The other two roots are, as you say, irrational numbers around 1.9 and 13.

However, the roots are NOT all lengths of sides. x is a side of the square cut off and the height of the box. Its base is a square with sides of length 20- 2x. Taking x= 5, 20-2x= 20- 10= 10 so the box has a "10 by 10 base" with height 5 so volume 5(10)(10)= 500 as desired. Taking x= 1.9, 20- 2x= 20- 3.8= 16.2. The volume would be 1.9(16.2)(16.2)= 498.636, approximately 500 because we rounded the irrational sides to one decimal place. Taking x= 13 would give base length 20- 26= -6 which is impossible.

There are, in fact, two solutions to this problem: cut 5 cm from each corner to get a 5 by 10 by 10 cm box with volume 500 cc or cut cm (approximately 1.9 cm) from each side to get a by by (approximately 1.9 by 16.2 by 16.2).