
Stewart's theorem is a nice extension of the Pythagorean lemma.
Please see the next picture:
The triangle has sides a,b and c.
Point D splits line AB in parts c_{1} and c_{2}.
AE = p, CD = x
We find a calculation for x given lengths a, b, c, c_{1} and c_{2}.
Pythagoras lemma in ΔEDC
h^{2} = x^{2}  (c_{1}  p)^{2}.........1)
Pythagoras lemma in ΔAEC
h^{2} = b^{2}  p^{2}...................2)
...1) en ...2) combined:
x^{2}  c_{1}^{2} + 2.c_{1}.p  p^{2} = b^{2}  p^{2}
x^{2} = b^{2} + c_{1}^{2}  2.c_{1}.p......................3)
Pythagoras lemma in DEBC
h^{2} = a^{2}  (c  p)^{2}.................4)
...2) and ...4) combined:
a^{2}  c^{2} +2c.p  p^{2} = b^{2}  p^{2}
a^{2} = b^{2} + c^{2}  2c.p...............5)
...3) and ...5) combined:
x^{2} = b^{2} + c_{1}^{2}  2.c_{1}.p ........................x c
a^{2} = b^{2} + c^{2}  2c.p.............................x c_{1}
c.x^{2} = c.b^{2} + c.c_{1}^{2}  2.c.c_{1}.p.........................6)
c_{1}.a^{2} = c_{1}.b^{2} + c_{1}.c^{2}  2c_{1}c.p........................7)
.........6)  .......7) yields:
c.x^{2}  c_{1}.a^{2} = c.b^{2} + c.c_{1}^{2}  c_{1}.b^{2}  c_{1}.c^{2}
c.x^{2}  c_{1}.a^{2} = b^{2}(c  c_{1})  c.c_{1}(c  c_{1})
c.x^{2} = c_{1}.a^{2} + c_{2}b^{2}  c.c_{1}.c_{2}
This is Stewart's theorem.
This theorem may be applied for the bisector or median of a triangle:
If x is a median:
x^{2} = 1/2 a^{2} + 1/2 b^{2}  1/4 c^{2}
If x is bisector:

