<s>[INST] Radius of a circle inscribed in a right triangle is given, the hypotenuse is given, find the legs? The radius of the circle inscribed in the right triangle is 4, the hypotenuse is 20cm. How do I find the legs? Any help would be appreciated!
 [/INST] For the right triangle $ABC$
with 
the hypotenuse $|AB|=c=20$ and
the radius of inscribed circle $r=4$,
the radius of circumscribed circle is known to be
found as
\begin{align}
R&=\tfrac{c}2=10
, 
\end{align}
and the semiperimeter 
\begin{align} 
\rho&=\tfrac12(a+b+c)
=r+c
,
\end{align}  
Considering the side lengths of the triangle
as the roots of a general cubic polynomial
in terms of semiperimeter $\rho$,
inradius $r$ and circumradius $R$,
\begin{align}
x^3-2\rho\,x^2+(\rho^2+r^2+4\,r\,R)\,x-4\,r\rho\,R
,
\end{align}
we can first simplify this cubic using the information given to
\begin{align}
x^3-2(r+c) x^2+((r+c)^2+r^2+2r c) x-2(r+c)r c
&=
(x-c)(x^2-(2r+c)x+2(r+c)r)
\\
\text{and find the legs as }\quad
a,b&=r+\tfrac{c}2\pm\tfrac12\sqrt{c^2-4r(r+c)}
=16,12
.
\end{align}

</s>