# Optimization, two numbers

The sum of two nonnegative numbers is 36. Find the numbers if A) the difference of their square roots is to be as large as possible. B) the sum of their square roots is to be as large as possible.

EDIT: For part B, the derivative of $\sqrt{x} + \sqrt{36-x} \Rightarrow 1/(2\sqrt{x}) - 1/(2\sqrt{36-x})$, then set equal to $0$. I can't seem to find the solution from there... I get $x = 36/5$. What am I doing wrong?

EDIT: I redid the problem and found x=18 for part B! Thanks for the help.

-
What have you tried already? If you don't know where to start, that's fine, but it's better if you say so. That way, we can gauge how much detail to put in the answer. –  anorton Feb 5 '13 at 23:55
There's nothing wrong with ${1\over2\sqrt x}-{1\over2\sqrt{36-x}}=0$, but $x=36/5$ is wrong, so there must be something wrong with the algebra that you have done but have not showed us. Hard to tell you what you're doing wrong when you don't show what you're doing. –  Gerry Myerson Feb 6 '13 at 4:30

Hint: If $A+B = 36$, then $(\sqrt{A} - \sqrt{B})^2 = A+B - 2 \sqrt{AB} = 36 - \sqrt{AB}$, so we seek to minimize $AB$ subject to constraints. Similarly, $(\sqrt{A} + \sqrt{B} )^2 = A+B + 2 \sqrt{AB}$, and now we seek to maximize $AB$ subject to constraints.
Hint: Set $\frac {d}{dA} ( \sqrt{A} - \sqrt{36 - A}) = 0$ and check end points. Same for other question.