Let x represent the side length of the base.
The area of the base and roof are each x^2, so their cost together will be
.. (8 +9)x^2 = 17x^2
The height of the shed will be 125/x^2, so the area of one side will be
.. (125/x^2)*x*8.50
and the area of all four sides will be
.. 4*125/x*8.50 = 4250/x
So, the total cost is the cost of top and bottom together with the cost of the sides:
.. cost = 17x^2 +4250/x
This is minimized when its derivative with respect to x is zero.
.. d(cost)/dx = 0 = 2*17x -4250/x^2
.. 4250/34 = x^3
.. x = ∛125 = 5
The most economical shed is a 5 ft cube.