Solution:
Key idea: In the numerator, 1−sin2θ can be replaced by cos2θ. The numerator then has the factor 1+cosθ, which cancels with the same factor in the denominator.
Step 1 — Regroup the numerator.
We bring 1 and −sin2θ together, because together they make cos2θ.
1+cosθ−sin2θ=(1−sin2θ)+cosθ
=cos2θ+cosθ
Step 2 — Factorise the numerator.
Both terms contain cosθ, so we take it out as a common factor.
cos2θ+cosθ=cosθ(cosθ+1)
Step 3 — Cancel 1+cosθ.
The same factor 1+cosθ is in the numerator and the denominator (it is not zero, since the denominator must be non-zero).
LHS=sinθ(1+cosθ)cosθ(1+cosθ)
=sinθcosθ
Step 4 — Name the ratio.
The ratio of cosine to sine is the cotangent.
LHS=cotθ
This is the right side.
Hence proved: sinθ(1+cosθ)1+cosθ−sin2θ=cotθ.