A question about an equilateral triangle Suppose that $\triangle ABC$ is an equilateral triangle. Let $D$ be a point inside the triangle so that $\overline{DA}=13$, $\overline{DB}=12$, and $\overline{DC}=5$. Find the length of $\overline{AB}$.


Let s be the side of the equilateral triangle
Using cosine formula for the triangle
$$\frac{13^2 + 5^2 - s^2}{2.5.13} = \cos\alpha\tag1$$
$$\frac{12^2 + 5^2 - s^2}{2.5.12} = \cos\beta\tag2$$
$$\frac{12^2 + 13^2 - s^2}{2.13.12} = \cos\gamma\tag3$$
Now we have $\gamma + \alpha + \beta = \pi$
$$\cos\gamma = \cos(\pi - \alpha - \beta)$$
Knowing $\cos(\pi - \theta) = \cos(\theta)$
$$\Rightarrow \cos\gamma = \cos(\alpha + \beta)$$
$$\Rightarrow \cos\gamma = \cos\alpha\cos\beta - \sin\alpha\sin\beta$$
$$\Rightarrow (\cos\gamma - \cos\alpha\cos\beta)^2 = \sin^2\alpha\sin^2\beta$$
$$\Rightarrow (\cos\gamma - \cos\alpha\cos\beta)^2 = (1 - \cos^2\alpha)(1 - \cos^2\beta)$$
$$\Rightarrow \cos^2\alpha + \cos^2\beta + \cos^2\gamma - 2.\cos\alpha.\cos\beta.\cos\gamma -1 = 0\tag4$$
Applying $(1)$, $(2)$, $(3)$ to $(4)$ and simplifying we have 
$$s^4 - 338.s^2 + 17761 = 0$$
using Heron's formula we have
$$\Rightarrow s^2  = \pm 60 . \sqrt3 + 169$$
$$\Rightarrow s = \pm\sqrt{\pm 60 . \sqrt3 + 169}$$
as Area of a triangle is real and positive
$$s = \sqrt{60 . \sqrt3 + 169}$$
