The order for the solution is: g, c, f, a, d, h, e, b.
This is because 'g' is the very start (a+b+c=12), and 'c' is rearranging the equation by putting c on the other side (a+b=12−c).
Next, 'f' is just a reminder of the Pythagoras Theorem (a²+b²=c²), and 'a' is to square both sides: (a+b)²=(12-c)² -> (a+b)(a+b)=(12-c)(12-c) -> a²+ab+ba+b²=144-12c-12c+c² -> a²+2ab+b²=144-24c+c².
For 'd', since a²+b²=c², you can remove a², b², and c² from the equation, hence becoming 2ab=144-24c. For 'h' you just divide it all by 2, becoming ab=72-12c.
'e' is a reminder for the area of a triangle (ab/2), so one more time in 'b' you have to divide it by two, which makes the area of the triangle (ab/2) 36-6c.
Doing the same thing for a triangle with a perimeter of 30, you do:
a+b=30-c
(a+b)²=(30-c)² (Squaring both sides again)
a²+2ab+b²=900-60c+c²
2ab=900-60c (removing a²+b²=c²
ab=450-30c
ab/2=225-15c (You divide it by 2 to get the area)
For the extension, you have to use ‘p’ to create a general expression. You start by doing the exact same with, except with p instead of a known perimeter.
You first start with a+b=p-c, then following the exact same pattern as before, square both sides, ending up with a²+2ab+b²=p²-2pc+c². After taking away the a²+b²=c² again (2ab=p²-2pc), simplify the equation into ab=p²/2-pc. To get the final equation, divide it by two once more, getting ab/2=p²/4+pc/2.