Concept:
Calculus - Integration using Trigonometric Identities.
Step 1: Simplify the trigonometric expression.
Rewrite $\tan\left(\frac{\theta}{2}\right)$ in terms of sine and cosine:
$$ \tan\left(\frac{\theta}{2}\right) = \frac{\sin(\theta/2)}{\cos(\theta/2)} $$
Apply the double-angle identity to $\sin\theta$:
$$ \sin\theta = 2\sin\left(\frac{\theta}{2}\right)\cos\left(\frac{\theta}{2}\right) $$
Step 2: Substitute and cancel terms.
Multiply the rewritten terms:
$$ \tan\left(\frac{\theta}{2}\right) \sin\theta = \frac{\sin(\theta/2)}{\cos(\theta/2)} \cdot 2\sin\left(\frac{\theta}{2}\right)\cos\left(\frac{\theta}{2}\right) $$
$$ = 2\sin^2\left(\frac{\theta}{2}\right) $$
Use the half-angle identity $2\sin^2\left(\frac{\theta}{2}\right) = 1 - \cos\theta$:
$$ \tan\left(\frac{\theta}{2}\right) \sin\theta = 1 - \cos\theta $$
Step 3: Construct the simplified integral.
Substitute this simplified expression back into the original integral:
$$ \int (1 - \cos\theta) \cos\theta \,d\theta $$
$$ = \int (\cos\theta - \cos^2\theta) \,d\theta $$
Step 4: Apply the power-reduction formula.
Rewrite $\cos^2\theta$ using the identity $\cos^2\theta = \frac{1 + \cos(2\theta)}{2}$:
$$ \int \left( \cos\theta - \frac{1}{2} - \frac{\cos(2\theta)}{2} \right) d\theta $$
Step 5: Integrate term by term.
$$ = \sin\theta - \frac{1}{2}\theta - \frac{\sin(2\theta)}{2 \times 2} + C $$
$$ = \sin\theta - \frac{1}{2}\theta - \frac{\sin(2\theta)}{4} + C $$