Stewart's Theorem

Theorem
Let $a, b, c$ be the sides of a triangle.

Let $CP$ be any cevian from $C$ to $P$.

Then:


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


 * [[File:Stewart's Theorem.png]]

Proof
There are two cases to consider:


 * 1) When the cevian is an altitude, the result follows directly from the law of cosines on $\triangle APC$ and $\triangle CPB$.
 * 2) When the cevian is not an altitude, we proceed as follows.

We note from Two Angles on a Straight Line make Two Right Angles that $\angle APC$ and $\angle BPC$ are supplementary.

So one of $\angle APC$ and $\angle BPC$ must be acute and the other must be obtuse.

WLOG let $\angle APC$ be acute and $\angle BPC$ be obtuse.

Then we have:


 * We multiply the first by $PB$ and the second by $AP$:


 * $b^2 \cdot PB = AP^2 \cdot PB + CP^2 \cdot PB - 2 PB \cdot AP \cdot CP \cdot \cos \left({\angle APC}\right)$


 * $a^2 \cdot AP = PB^2 \cdot AP + CP^2 \cdot AP + 2 AP \cdot CP \cdot PB \cdot \cos \left({\angle APC}\right)$


 * Now we add the two equations:

It is also known as Apollonius's Theorem after Apollonius of Perga.