Math Help - Word problem help please...

I need to solve this question by finding the maximum using differentiation. But word problems are my major weakness. I can't seem to construct an equation/graph based on the given data.

The sum of two real numbers x and y is 12. Find the maximum value of their product xy.

2. Given that:
$x+y = 12 \implies y = 12-x$
$xy = k$, for some value k.

$k = xy = x(12-x) = 12x - x^2$

$\frac{dk}{dx} = 12 - 2x$

Can you continue?

3. Alright, thank you. Solved the rest.

Now another word problem that I cannot solve.

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.

4. No problem, glad to help.