Example 28. In a right triangle $A B C$, from the vertex $C$ of the right angle, the bisector $C K$ and the median $C M$ are drawn. Find the legs of triangle $A B C$ if $|K M|=a,|C M|=m$.
Solution (Fig. 32). This is a problem of type $F$. We will solve it algebraically by setting up a system of equations with respect to $|A C|=x$ and $|B C|=y$. For definiteness, let's assume that $|A C| \leqslant|B C|$.

Since $\triangle A B C$ is a right triangle and $[C M]$ is the median to the hypotenuse $A B$, then $|C M|=\frac{1}{2}|A B|$ and, consequently, $|A B|=2 m$ and $|A M|=|B M|=m$. Then $|A K|=m-a$ and $|B K|=$ $=m+a$.

Since $[C K)$ is the angle bisector of $\angle A C B$, we have

$$
\frac{|A K|}{|B K|}=\frac{|A C|}{|B C|}
$$

which gives

$$
\frac{m-a}{m+a}=\frac{x}{y}
$$

Moreover, by the Pythagorean theorem,

$$
|A C|^{2}+|B C|^{2}=|A B|^{2} \text {, or } x^{2}+y^{2}=4 m^{2} \text {. }
$$

Thus, we have the system of equations:

$$
\left\{\begin{array}{l}
\frac{x}{y}=\frac{m-a}{m+a} \\
x^{2}+y^{2}=4 m^{2}
\end{array}\right.
$$

Solving this system, we find:

$$
x=\frac{m(m-a) \sqrt{2}}{\sqrt{m^{2}+a^{2}}}, y=\frac{m(m+a) \sqrt{2}}{\sqrt{m^{2}+a^{2}}} .
$$

Investigation. By the problem's conditions, $x>0$ and $y>0$. Since $[C K)$ is the angle bisector of $\angle A C B$,

![](https://cdn.mathpix.com/cropped/2024_05_21_318d1c34bf6979fc9790g-051.jpg?height=294&width=460&top_left_y=2055&top_left_x=358)

Fig. 32 then point $K$ is an interior point of segment $A B$. Since $|A C| \leqslant|B C|$, then $|A K| \leqslant$ $\leqslant|B K|$ and therefore either $K=M$ or $K$ is an interior point of segment $A M$. But then $|A M|>|K M|$, or $m>a \geqslant 0$, and thus $x>0$ and $y>0$, i.e., the found values of $x$ and $y$ satisfy the problem's conditions.

50

If we assume that $|A C|>|B C|$, then from the system of equations

$$
\left\{\begin{array}{l}
\frac{x}{y}=\frac{m+a}{m-a} \\
x^{2}+y^{2}=4 m^{2}
\end{array}\right.
$$

we find the values

![](https://cdn.mathpix.com/cropped/2024_05_21_318d1c34bf6979fc9790g-052.jpg?height=274&width=466&top_left_y=246&top_left_x=1246)

Fig. 33

$$
x=\frac{m(m+a) \sqrt{2}}{\sqrt{m^{2}+a^{2}}}, y=\frac{m(m-a) \sqrt{2}}{\sqrt{m^{2}+a^{2}}}
$$

which also satisfy the problem's conditions. Therefore, the legs of triangle $A B C$ are:

$$
\frac{m(m-a) \sqrt{2}}{\sqrt{m^{2}+a^{2}}} \text { and } \frac{m(m+a) \sqrt{2}}{\sqrt{m^{2}+a^{2}}}
$$