Solution:
Concept: Sum-to-product: cosA+cosB=2cos2A+Bcos2A−B, sinA−sinB=2cos2A+Bsin2A−B, sinA+sinB=2sin2A+Bcos2A−B, cosA−cosB=−2sin2A+Bsin2A−B. Also (−1)n is 1 for even n and −1 for odd n.
Step 1 — Simplify the first fraction.
sinA−sinBcosA+cosB=2cos2A+Bsin2A−B2cos2A+Bcos2A−B=cot2A−B
Step 2 — Simplify the second fraction.
Note the minus sign from cosA−cosB.
cosA−cosBsinA+sinB=−2sin2A+Bsin2A−B2sin2A+Bcos2A−B=−cot2A−B
Step 3 — Raise to the power n and add.
L.H.S.=cotn2A−B+(−1)ncotn2A−B
For even n, (−1)n=1, so the sum is 2cotn(2A−B). For odd n, (−1)n=−1, so the sum is 0.
Hence proved.