3. Let $A M$ and $B N$ be the medians in triangle $A B C$ and $T$ be their intersection point. If $\overline{B C}=a$ and $\overline{A C}=b$ and the points $M, T, N, C$ lie on the same circle, find the length of the segment $A B$.
Solution. Let $\overline{A B}=c$. We apply the cosine theorem to triangles $A B C$ and $A B T$:

$$
\begin{gathered}
c^{2}=a^{2}+b^{2}-2 a \cdot b \cdot \cos \gamma \\
c^{2}=\overline{A T}^{2}+\overline{B T}^{2}-2 \overline{A T} \cdot \overline{B T} \cdot \cos \varphi
\end{gathered}
$$

Since quadrilateral $N T M C$ is cyclic, it follows that $\gamma+\varphi=\pi$, and thus $\cos \varphi=-\cos \gamma$. From (2) we get

![](https://cdn.mathpix.com/cropped/2024_06_05_5122104380b1afd5c770g-10.jpg?height=367&width=406&top_left_y=1595&top_left_x=1056)

$$
c^{2}=\overline{A T}^{2}+\overline{B T}^{2}+2 \overline{A T} \cdot \overline{B T} \cdot \cos \gamma
$$

Triangles ATN and AMC are similar (the angle at vertex A is common and $\angle A T N=\gamma=\angle A C M$), so we have:

$$
\overline{A N}: \overline{A T}=\overline{A M}: \overline{A C}
$$

Since $\overline{A T}=\frac{2}{3} \overline{A M}, \overline{A N}=\frac{b}{2}, \overline{A C}=b$, we get $\overline{A T}=\frac{b}{\sqrt{3}}$. Similarly, $\overline{B T}=\frac{a}{\sqrt{3}}$.

Substituting these values into (3) we get

$$
c^{2}=\frac{b^{2}}{3}+\frac{a^{2}}{3}+2 \frac{a b}{3} \cos \gamma
$$

From (1) and (4) we get $\cos \gamma=\frac{a^{2}+b^{2}}{4 a b}$, and substituting back into (1), $c=\sqrt{\frac{a^{2}+b^{2}}{2}}$.