This derivation proof of the cosine formula involves introducing the angles at the very last stage, which eliminates the sine squared and cosine squared terms.
In triangle XYZ, a perpendicular line OZ makes two triangles, XOZ, and YOZ. As you can see, they both share the same side OZ. Sharing of this side is where the trick is because this is where you will be equating two different expressions for the common side.
If the side XO is length p, then side OY is length (c – p) obviously. From this point onwards, we can use Pythagoras’s Theorem.
For triangle YOZ, we use Pythagoras’s Theorem. This expression is simply the sum of the sides squared for triangle YOZ, and we simply re-arrange it for the h term.
We do the same thing for triangle XOZ, and rearrange for the h term.
Since the h2 terms are the same for both triangles, it is common sense to equate the two expressions to give us this one large expression. This also eliminates the h term from our equations, which is even better.
Generally, at some point in mathematics it all comes down to expansion and simplification. In this case we expand out the binomial, and cancel out the like terms p2 on both sides. In addition, a little bit of re-arranging and tidying up does not hurt. We took two expressions belonging to different triangles and mixed them up to create this large formula.
However, cos A is simply adjacent over hypotenuse, as shown by the expression above, and therefore we re-arrange it to give an expression for p. All you then have to do is to use this expression to substitute for p in the expression above.
Simply, substitute the expression for p in the equation gives us the familiar cosine rule. There are many ways to show this proof, and I could do it using vectors as well but this is just a simple way to show kids and GCSE students.