Let x be the length (in cm) of one of the legs Let y be the length (in cm) of the other leg
The area is computed by A = ½bh
where:b – baseh - height For a right triangle, the legs can function as base and height. Since it's a right triangle and the hypotenuse is 5, we have (from Pythagorean theorem)
25 = x² + y²
Solve this for, say, y in terms of x:
25 - x² = y² (25 - x²) ^½ = y
We select the positive square root because y is a length, and so is integrally positive.
Put this in the equation for area:
A = ½x(25 - x²)^½
dA/dx = ½[(25 - x²)^½ + x*½(25 - x²)^(-½)(-2x)] = ½[(25 - x²)^½ - x²(25 - x²)^(-½)] = ½[25 - x² - x²] / [(25 - x²)^½]
dA/dx = 0 ⇒ 2x² = 25 ⇒ x = 5/√2 = 5 √2 / 2
Once more, we reject the negative solution. If you substitute this into the calculation we got for y in terms of x, you will discover that y = x = 5 √2 / 2
For x = y = 5 √2 / 2, A = 25/4 cm²
Since 0 ≤ x ≤ 5, you can use the Extreme Value theorem to show that x = 5 √2 / 2 gives an absolute maximum for A.