Point in the interior of a triangle Let $P$ be a point in the interior of triangle $ABC$. The lengths of $AP, BP,$ and $CP$ are $3, 4,$ and $5,$ respectively. Find the value of $AB^{2}$
if $AC = 7$ and $CB = 8.$
I tried using heron's formula but I ended up with a $4$th degree polynomial which was hard to solve.

We have two triangles $\triangle APC$ and $\triangle BPC$ sharing a common side $CP=5$. By the cosine rule we have
$$\cos\angle ACP=\frac{7^2+5^2-3^2}{2×7×5}=\frac{13}{14}$$
$$\cos\angle BCP=\frac{8^2+5^2-4^2}{2×8×5}=\frac{73}{80}$$
Now we need to compute $\cos\angle ACB=\cos(\angle ACP+\angle BCP)$:
$$\cos\angle ACB=\frac{13×73}{14×80}-\sqrt{\frac{14^2-13^2}{14^2} \frac{80^2-73^2}{80^2}}$$
$$=\frac{13×73-\sqrt{27×153×7}}{14×80}=\frac{949-9\sqrt{357}}{1120}$$
Then $AB^2$ follows by another application of the cosine rule as
$$7^2+8^2-2×7×8×\frac{949-9\sqrt{357}}{1120}=\frac{181+9\sqrt{357}}{10}$$
