A right-angled triangle forms the base of a prism. One of the legs of the triangle is as long as the height of the prism. The sum of the lengths of the other leg and the hypotenuse is $8 \mathrm{~cm}$. What is the maximum possible volume of the prism?
Solution. Let one of the legs of the right triangle and the height of the prism be denoted by $x$, the other leg be $b$, and the hypotenuse be $c$.

![](https://cdn.mathpix.com/cropped/2024_05_02_ca0d85140e87a9bda4e3g-1.jpg?height=371&width=328&top_left_y=259&top_left_x=888)

According to the problem, $b+c=8$, and from the Pythagorean theorem, $x^{2}=c^{2}-b^{2}$. The volume of the prism is:

$$
V=\frac{b x^{2}}{2}=\frac{b\left(c^{2}-b^{2}\right)}{2}=\frac{b\left((8-b)^{2}-b^{2}\right)}{2}=32 b-8 b^{2}
$$

We can determine the maximum of the quadratic function by completing the square. The function has a maximum because the coefficient of the quadratic term is negative:

$$
V=32 b-8 b^{2}=-8\left(b^{2}-4 b\right)=-8\left[(b-2)^{2}-4\right]
$$

The maximum value is 32; this is the maximum possible volume of the prism. This is possible if $b=2, c=6$, and $x=4 \sqrt{2}$.