Explanation:
tan(2x) = sin(2x)/cos(2x) = 2sinxcosx/(cos^2x - sin^2x).
Dividing the num- and denominator by sinxcosx, we get
2/(cosx/sinx - sinx/cosx) = 2/(cotx - tanx)
cotA + cotB = cosA/sinA + cosB/sinB
We just add them like fractions, with a common denominator of sinAsinB
(cosAsinB + sinAcosB)/sinAsinB
Note that sinAcosB + sinBcosA = sin(A+B)
Therefore we have
sin(A+B)/sinAsinB