Find the largest possible value of 2x + y if x and y are the lengths of the sides of a right triangle whose hypotenuse is 5 units long.

we have

x^2+y^2 = 25
and we want to maximize
f(x,y) = 2x+y
Or,
f(x) = 2x + √(25-x^2)
f'(x) = 2 - x/√(25-x^2)
This is a maximum when x = 2√5 and y=√5
2(2√5) + √5 = 3√5