3. The perimeter of a right-angled triangle is $2 p$ ( $p>0$ ), and its height dropped to the hypotenuse has a length of $h$. Determine its sides.
Solution. From the condition of the problem, we have $a+b+c=2 p$, where $a$ and $b$ are the lengths of the legs, and $c$ is the length of the hypotenuse. Therefore,

$$
a+b=2 p-c
$$

We square the last equality to get $a^{2}+2 a b+b^{2}=(2 p-c)^{2}$. Using the Pythagorean theorem, we get $c^{2}+2 a b=(2 p-c)^{2}$, from which it follows that

$$
a b=2 p^{2}-2 p c
$$

Since $a b=c h$, if we substitute in (2), we get $c h+2 p c=2 p^{2}$, i.e., $c=\frac{2 p^{2}}{h+2 p}$.

If we substitute the obtained into (1) and (2), we get

$$
\left\{\begin{array}{l}
a+b=\frac{2 p(h+p)}{h+2 p} \\
a \cdot b=\frac{2 p^{2} h}{h+2 p}
\end{array}\right.
$$

Therefore, $a$ and $b$ are the roots of the quadratic equation

$$
x^{2}-\frac{2 p(h+p)}{h+2 p} x+\frac{2 p^{2} h}{h+2 p}=0
$$

Thus,

$$
\begin{aligned}
& a=\frac{p}{h+2 p}\left(h+p+\sqrt{(p-h)^{2}-2 h^{2}}\right), \\
& b=\frac{p}{h+2 p}\left(h+p-\sqrt{(p-h)^{2}-2 h^{2}}\right) \text { and } \\
& c=\frac{2 p^{2}}{h+2 p} .
\end{aligned}
$$