9. In $\triangle \mathrm{ABC}$, side $\mathrm{BC}=\mathrm{a}, \mathrm{AB}=\mathrm{c}$, altitudes are $\mathbf{A D}$ and $\mathbf{C E}$. If $\frac{\mathrm{DE}}{\mathrm{AC}}=k$, find $\mathrm{A} \mathbf{C}$.
9. Let's first consider: $\triangle A B C \sim \triangle D \bar{D} E$, and if $\angle B$ is acute, the ratio of areas is $\cos B$; if $\angle B$ is obtuse, the similarity ratio is $-\cos B$. We only examine the case where $\angle B$ is acute (as shown in Figure 9), and the case where $\angle B$ is obtuse is completely analogous.
$\triangle \mathrm{ABC}$ and $\triangle \mathrm{DBE}$ share the common angle $\angle \mathrm{B}$. From the right triangles $\mathrm{ADB}$ and $\mathrm{BEC}$, we observe:
$$
\cos \mathrm{B}=\frac{\mathrm{BD}}{\mathrm{AB}}=-\frac{\mathrm{BE}}{\mathrm{BC}} .
$$

Thus, $\triangle \mathrm{ABC} \sim \triangle \mathrm{DBE}$. Given that $\frac{\mathrm{DE}}{\mathrm{AC}}=\mathrm{k}$, we have $|\cos \mathrm{B}|=\mathrm{k}$. By the Law of Cosines, we can obtain:
$$
A C=\sqrt{a^{2}+c^{2} \pm 2 a c k} .
$$

The sign, either - or +, depends on whether $\angle \mathrm{B}$ is acute or obtuse.