12.180. A side of the triangle is equal to 15, the sum of the other two sides is 27. Find the cosine of the angle opposite the given side, if the radius of the inscribed circle in the triangle is 4.
## Solution.

Let $a$ be the given side of the triangle, $a=15$, $b$ and $c$ be the other two sides, $b+c=27$, $c=27-b$. For definiteness, we will assume that $b>c$. The semiperimeter of the triangle $p=\frac{a+b+c}{2}=21$, its area $S=p r=84$.

By Heron's formula $S=\sqrt{p(p-a)(p-b)(p-c)}$, thus

$$
\begin{aligned}
& \sqrt{21 \cdot(21-15)(21-b)(21-27+b)}=84 \Leftrightarrow \sqrt{21 \cdot 6(21-b)(b-6)}=84 \Leftrightarrow \\
& \Leftrightarrow(21-b)(b-6)=56 \Leftrightarrow b^{2}-27 b+182=0, \\
& b_{1}=14, b_{2}=13 . \\
& \text { We have } b=14, c=13 \text {. By the cosine rule }
\end{aligned}
$$

$$
\cos \alpha=\frac{b^{2}+c^{2}-a^{2}}{2 b c}=\frac{5}{13}
$$

Answer: $\frac{5}{13}$.