# Maximizing the length of a right-triangle hypotenuse

Given different continuous ranges of values for the legs, how can I find the values that maximize the length pf the hypotenuse of the right triangle? In other words, given that A lies between X and Y and B lies between C and D, how can I find the values that result in the highest possible value of sqrt (c^2)?

You want to maximize the function $\;f(a,b):=\sqrt{a^2+b^2}\;$ given that $\;a\in[X,Y]\;,\;\;b\in[C,D]\;$ . But it's easy to see this happens when $\;a=\max\{|X|,|Y|\}\,,\,b=\max\{|C|,|D|\}\;$ as we have a sum of squares within that square root...