<s>[INST] How to solve this exercise given:
$\triangle ABC$
$P=20$ Note: P is perimeter
$\cos \alpha = -\frac{1}{3}$
$\cos \beta = \frac{7}{9}$
Find the sides of the triangle
I'm totally lost on this one. I have no idea from where to begin.
The answer given in my textbook is: $a = 9 b = 6 c = 5$
I managed to solve the problem, I case somebody needs to know how:
Find $\sin\alpha$ and $sin \beta$
Then $\gamma = 180 - (\alpha + \beta)$ => $sin \gamma = sin(\alpha + \beta)$ From sin law => a : b : c = $\sin \alpha : \sin \beta : \sin \gamma$ and a + b + c =20 from here it's just arithmetic operations
 [/INST] I'll assume that $a$ is the side opposite to $\alpha$ and similarly for $b$ and $c$, opposite to $\beta$ and $\gamma$.
The cosine law tells you that
$$
a^2=b^2+c^2-2bc\cos\alpha
$$
so
$$
2bc+2bc\cos\alpha=b^2+2bc+c^2-a^2=(b+c)^2-a^2=(a+b+c)(b+c-a)
$$
which means
$$
\frac{1}{15}bc=b+c-a
$$
Similarly,
$$
2ac(1+\cos\beta)=(a+b+c)(a+c-b)
$$
that is
$$
\frac{8}{45}ac=a+c-b
$$
Summing the two relations we get
$$
\frac{c}{45}(8a+3b)=2c
$$
that implies $8a+3b=90$ (because we assume $c\ne0$ in a triangle).
The sine law tells you that
$$
\frac{a}{\sin\alpha}=\frac{b}{\sin\beta}
$$
Since
$$
\sin\alpha=\sqrt{1-\frac{1}{9}}=\frac{2}{3}\sqrt{2}
$$
and
$$
\sin\beta=\sqrt{1-\frac{49}{81}}=\frac{4}{9}\sqrt{2}
$$
we have
$$
\frac{3a}{2\sqrt{2}}=\frac{9b}{4\sqrt{2}}
$$
that simplifies to $2a=3b$.
Now we have
\begin{cases}
8a+3b=90\\[3px]
2a=3b\\[3px]
a+b+c=20
\end{cases}
</s>