In the triangle OAB, OA = a and OB= b. Show that (a-b) times (a-b) = (a times a) + (b times b) - (2 times a times b). Hence prove the cosine rule

Specifically the Cosine Rule part of question is difficult

Thanks

Let's say that θ = angle AOB, and that θ is acute.

Drop an altitude from B to OA. Let h be its length
Using the Pythagorean Theorem,
(b cosθ)^2 + h^2 = b^2

Let c be the length of side AB
(a - bcosθ)^2 + h^2 = c^2

Eliminating h, we have

b^2 - (b cosθ)^2 = c^2 - (a - bcosθ)^2
b^2 - b^2 cos^2θ = c^2 - a^2 + 2ab cosθ - b^2 cos^2θ
c^2 = a^2 + b^2 - 2ab cosθ

You can do similar gymnastics if θ is obtuse.

To prove the cosine rule, let's first verify the equation (a-b)² = a² + b² - 2ab step by step:

1. Start with the left-hand side of the equation, (a-b)²:
(a-b)² = (a-b)(a-b) // Expanding the binomial using the distributive property
= a(a-b) - b(a-b) // Apply the distributive property to both terms
= a² - ab - ab + b² // Simplify further
= a² - 2ab + b² // Combine like terms

2. Now, let's look at the right-hand side of the equation, a² + b² - 2ab:
a² + b² - 2ab // No further simplification required

By comparing the left-hand side and the right-hand side of the equation, we can see that they are equal, both being a² - 2ab + b². Thus, we have shown that (a-b)² = a² + b² - 2ab.

Now, using this result, we can prove the cosine rule. In a triangle ABC, where sides BC, AC, and AB have lengths a, b, and c respectively, and opposite angles are denoted by angles A, B, and C:

Using the Law of Cosines, which is a re-arranged form of the above equation, we have:
c² = a² + b² - 2ab·cos(C)

To prove this, we need to show that angles A, B, and C are opposite to sides a, b, and c respectively.

1. Start with the given triangle ABC.

2. Draw a line segment from point A to a point D on line BC such that AD is perpendicular to BC.

3. Now, we have two right triangles, ABD and ACD, with sides AD, DB, AB, AC, and angles ABD, ACD as right angles.

4. Using the Pythagorean Theorem for triangle ABD, we have:
AB² = AD² + DB²
AB² = h² + b² // Since AD = h (height from A to BC)

5. Similarly, from triangle ACD, we have:
AC² = AD² + DC²
AC² = h² + a² // Since AD = h (height from A to BC)

6. Adding the two equations from steps 4 and 5 together, we get:
AB² + AC² = h² + b² + h² + a²
AB² + AC² = 2h² + a² + b²

7. Since h² + a² + b² = c² (Pythagorean Theorem for triangle ABC), we can substitute this in step 6:
AB² + AC² = 2c²

8. Observe that AB + AC = BC, so we have:
BC = AB + AC
BC² = (AB + AC)²
BC² = AB² + AC² + 2AB·AC

9. Substitute the value from step 7 into step 8:
BC² = 2c² + 2AB·AC

10. Rearrange the equation and divide everything by 2:
BC²/2 = c² + AB·AC

11. Substitute AB·AC = ab·cos(C) (from the definition of the dot product):
BC²/2 = c² + ab·cos(C)

12. Finally, multiply both sides by 2 to eliminate the fraction:
BC² = 2c² + 2ab·cos(C)

13. Now, we can compare this equation with the one derived using the Law of Cosines:
BC² = a² + b² - 2ab·cos(C)

By comparing the two equations in step 13, we can see that they are equal. Thus, we have proven the cosine rule:

c² = a² + b² - 2ab·cos(C)

I hope this explanation helps in understanding the proof of the cosine rule. Let me know if you have any further questions!