## Task B-3.2.

Vectors $\vec{a}$ and $\vec{b}$ are unit vectors that form an angle of $60^{\circ}$. If $\overrightarrow{A B}=-\vec{a}+4 \vec{b}$ and $\overrightarrow{A C}=-3 \vec{a}+2 \vec{b}$, calculate the cosine of the angle between the altitude and the median from vertex $A$ in triangle $A B C$.
## First Solution.

If $\overrightarrow{A B}=-\vec{a}+4 \vec{b}$ and $\overrightarrow{A C}=-3 \vec{a}+2 \vec{b}$, then

$$
\begin{aligned}
& \overrightarrow{C B}=\overrightarrow{A B}-\overrightarrow{A C}=(-\vec{a}+4 \vec{b})-(-3 \vec{a}+2 \vec{b})=2 \vec{a}+2 \vec{b} \\
& \overrightarrow{A P}=\overrightarrow{A C}+\frac{1}{2} \overrightarrow{C B}=(-3 \vec{a}+2 \vec{b})+(\vec{a}+\vec{b})=-2 \vec{a}+3 \vec{b}
\end{aligned}
$$

![](https://cdn.mathpix.com/cropped/2024_05_30_1ebddb66d71be8305afcg-11.jpg?height=477&width=780&top_left_y=824&top_left_x=638)

Let's calculate the lengths of these vectors, i.e., the lengths of the sides of triangle $A B C$ and the length of the median $\overline{A P}$. We will use the fact that $\vec{a}^{2}=|\vec{a}|^{2}=1, \vec{b}^{2}=|\vec{b}|^{2}=1$ and $\vec{a} \cdot \vec{b}=|\vec{a}||\vec{b}| \cos 60^{\circ}=\frac{1}{2}$.

It follows that

$$
\begin{aligned}
& |\overrightarrow{A C}|^{2}=(-3 \vec{a}+2 \vec{b})^{2}=9|\vec{a}|^{2}-12 \vec{a} \cdot \vec{b}+4|\vec{b}|^{2}=9-12 \cdot \frac{1}{2}+4=7 \\
& |\overrightarrow{C B}|^{2}=(2 \vec{a}+2 \vec{b})^{2}=4|\vec{a}|^{2}+8 \vec{a} \cdot \vec{b}+4|\vec{b}|^{2}=4+8 \cdot \frac{1}{2}+4=12 \\
& |\overrightarrow{A P}|^{2}=(-2 \vec{a}+3 \vec{b})^{2}=4|\vec{a}|^{2}-12 \vec{a} \cdot \vec{b}+9|\vec{b}|^{2}=4-12 \cdot \frac{1}{2}+9=7
\end{aligned}
$$

Thus, $|A C|=|A P|=\sqrt{7},|C B|=2 \sqrt{3}$.

Since triangle $A P C$ is isosceles, we have

$|A D|^{2}=|A P|^{2}-\left(\frac{1}{4}|B C|\right)^{2}=7-\frac{12}{16}=\frac{25}{4}$, so $|A D|=\frac{5}{2}$.

Therefore, $\cos \varphi=\frac{|A D|}{|A P|}=\frac{5}{2 \sqrt{7}}=\frac{5 \sqrt{7}}{14}$.