A
/|\
/ | \
/ | \
/ | \
c h b
/ | \
/ | \
B /___a1__|___a2__\ C
Given a triangle ABC as shown above. By using the Pythagoras theorem, a1= { c^2-b^2+(a1+a2)^2 } / 2(a1+a2) . How can I express h using a1+a2, b, and c?
By Heron's formula(It has algebraic proof using the Pythagorean theorem), we have $$ S = \sqrt{p(p-(a_1+a_2))(p-b)(p-c)}, \text{ where } p = \dfrac{a_1+a_2+b+c}{2}. $$ Also, $$ S = \dfrac{1}{2} (a_1+a_2)\times h $$ Can you proceed from here?
$$ \dfrac{1}{2} a\times h = \sqrt{p(p-a)(p-b)(p-c)}\\ \dfrac{1}{4}a^2 h^2= p(p-a)(p-b)(p-c)\\ h^2=4p(p-a)(p-b)(p-c)/a^2 $$