Stewart's Theorem

Theorem
Let a, b, c be the sides of a triangle. Let be any cevian from C to P them

$$a^2 \cdot AP+b^2 \cdot BP=CP^2 \cdot c+AP \cdot PB \cdot c$$



Proof
We exclude when the cevian is a altitude, then we use the law of cosines on $$\triangle APC$$ and $$\triangle CPB$$.

In this case, $$\angle APC < 90$$º and $$\angle BPC > 90$$º and $$\angle APC$$ ,$$\angle BPC$$ are supplementary.

Then we have,

$$ $$


 * We Multiply by $$PB$$ in the first and the second $$AP$$:

$$b^2\cdot PB= AP^2\cdot PB+CP^2\cdot PB-2PB \cdot AP \cdot CP \cdot cos(\angle APC) $$

$$a^2\cdot AP= PB^2\cdot AP+CP^2\cdot AP+2AP \cdot CP \cdot PB \cdot cos(\angle APC)$$


 * Now we add the two equations:

$$ $$ $$