Find the dimensions of a right triangle that maximizes the area when the perimeter is 10 cm

This is an optimization problem:

maximize 1/2 b*h
subject to the constraint
b+h+sqrt(b^2+h^2)=10
now for the maximization function, you need it in one variable.
b+h+sqrt(b^2+h^2)=10
sqrt(b^2+h^2)=(10-b-h)
now square both sides, (it is a bit messy), solve for b in terms of h.
Then substiture in the area equation
A=1/2 h*(b in terms of h)
then
dA/dh=0=..... solve for h, then substitute back in the b in terms of h, and you have b.