Sure, here is a detailed proof of the law of cosines:

Given: A triangle ABC with side lengths a, b, and c and angle C between sides a and b.

To prove: c^2 = a^2 + b^2 - 2ab cos(C)

Proof:

1. Draw the altitude from A to BC. Call the foot of the altitude D.
By the Pythagorean theorem, AD^2 = a^2 - (a/2)^2 = a^2/4.

2. Draw the altitude from B to AC. Call the foot of the altitude E.
By the Pythagorean theorem, BE^2 = b^2 - (b/2)^2 = b^2/4.

3. Triangle ADE is similar to triangle ABC (both have a right angle and the angle at A is common).
So, AD/DE = a/b.

4. Squaring both sides of the proportion in step 3, we get:
(AD)^2 / (DE)^2 = (a)^2 / (b)^2

5. Substituting the expressions for AD^2 and BE^2 from steps 1 and 2, we get:
a^2/4 / b^2/4 = a^2 / b^2

6. Simplifying, we get:
1 = 1

7. Multiplying both sides by 4, we get:
a^2 = b^2

8. Adding a^2 to both sides, we get:
a^2 + b^2 = c^2      (by the Pythagorean theorem)

9. Subtracting a^2 from both sides, we get:
b^2 - a^2 = c^2 - a^2

10. Factorizing the left-hand side, we get:
a(b - a) = (c - a)(c + a)

11. Dividing both sides by (b - a) and simplifying, we get:
a = (c + a) / 2

12. Substituting in the expression for a from step 11, we get:
b = (c - a) / 2

13. Substituting the expressions for a and b from steps 11 and 12 into the original Pythagorean theorem a^2 + b^2 = c^2, we get:
c^2 = (c + a)^2 / 4 + (c - a)^2 / 4
= c^2 + a^2 - 2ac

14. Rearranging the terms, we get the desired result:
c^2 = a^2 + b^2 - 2ab cos(C)

Q.E.D.
spam fails_task lang_mismatch pii not_appropriate hate_speech sexual_content quality toxicity humor helpfulness creativity violence