A rectangular sheet of metal measures 50cm by 40cm. Equal squares of side x cm are cut from each corner and discarded. The sheet is then folded up to make a tray of depth x cm. What is the domain of possible values of x? Find the value of x which maximizes the capacity of the tray.

I can handle the differentiation part. Just need the equation (Talking)