A general problem-solving technique video — not a specific exam question.
Problem
Express $\tan^{-1}\left(\dfrac{\cos x}{1-\sin x}\right)$, where $x\in\left(-\dfrac{3\pi}{2},\dfrac{\pi}{2}\right)$, in its simplest form.
Key insight. Writing $\cos x$ and $1-\sin x$ using half-angle substitutions ($x/2$) reveals a shared factor that cancels, collapsing the whole fraction into $\tan\left(\dfrac{\pi}{4}+\dfrac{x}{2}\right)$. The given domain for $x$ turns out to map exactly onto the principal range of $\tan^{-1}$, so no branch corrections are needed anywhere in that domain.
Watch this explained step by step → · More on the Shiwam’s Classes channel
Approach
Rewrite $\cos x$ and $1-\sin x$ in terms of $\sin(x/2)$ and $\cos(x/2)$, factor, and simplify the ratio to $\tan\left(\dfrac{\pi}{4}+\dfrac{x}{2}\right)$. Then check where $\dfrac{\pi}{4}+\dfrac{x}{2}$ falls as $x$ ranges over the given interval, confirming it stays within the principal range of $\tan^{-1}$ throughout, so the identity $\tan^{-1}(\tan\theta)=\theta$ applies directly.
Solution
Step 1 — Rewrite cos x using half-angle identities
$$\cos x = \cos^2\frac{x}{2}-\sin^2\frac{x}{2} = \left(\cos\frac{x}{2}-\sin\frac{x}{2}\right)\left(\cos\frac{x}{2}+\sin\frac{x}{2}\right)$$
Step 2 — Rewrite 1 − sin x using half-angle identities
$$1-\sin x = \cos^2\frac{x}{2}+\sin^2\frac{x}{2}-2\sin\frac{x}{2}\cos\frac{x}{2} = \left(\cos\frac{x}{2}-\sin\frac{x}{2}\right)^2$$
Step 3 — Form the ratio and cancel the common factor
$$\frac{\cos x}{1-\sin x} = \frac{\left(\cos\frac{x}{2}-\sin\frac{x}{2}\right)\left(\cos\frac{x}{2}+\sin\frac{x}{2}\right)}{\left(\cos\frac{x}{2}-\sin\frac{x}{2}\right)^2} = \frac{\cos\frac{x}{2}+\sin\frac{x}{2}}{\cos\frac{x}{2}-\sin\frac{x}{2}}$$
Step 4 — Divide numerator and denominator by cos(x/2)
$$= \frac{1+\tan\frac{x}{2}}{1-\tan\frac{x}{2}}$$
Step 5 — Recognise the tangent addition formula
$$\frac{1+\tan\frac{x}{2}}{1-\tan\frac{x}{2}} = \tan\left(\frac{\pi}{4}+\frac{x}{2}\right)$$
Step 6 — Check the range of π/4 + x/2 over the given domain
As $x$ ranges over $\left(-\dfrac{3\pi}{2},\dfrac{\pi}{2}\right)$, let $\theta=\dfrac{\pi}{4}+\dfrac{x}{2}$:
At $x=-\dfrac{3\pi}{2}$: $\theta = \dfrac{\pi}{4}-\dfrac{3\pi}{4} = -\dfrac{\pi}{2}$
At $x=\dfrac{\pi}{2}$: $\theta = \dfrac{\pi}{4}+\dfrac{\pi}{4} = \dfrac{\pi}{2}$
So $\theta$ ranges over exactly $\left(-\dfrac{\pi}{2},\dfrac{\pi}{2}\right)$ — precisely the principal range of $\tan^{-1}$.
Step 7 — Apply tan⁻¹(tan θ) = θ
Since $\theta$ stays within the principal range throughout the given domain, no adjustment is needed:
$$\tan^{-1}\left(\frac{\cos x}{1-\sin x}\right) = \frac{\pi}{4}+\frac{x}{2}$$
Answer
$$\frac{\pi}{4}+\frac{x}{2}$$
Common mistakes
- Assuming $\tan^{-1}(\tan\theta)=\theta$ holds for any $\theta$ without checking the range. This identity is only automatic when $\theta$ lies within $\left(-\dfrac{\pi}{2},\dfrac{\pi}{2}\right)$ — for a domain where $\theta$ leaves this range, a correction term (adding or subtracting $\pi$) would be needed.
- Making a sign error when rewriting $1-\sin x$ as a perfect square. The identity $1-\sin x = \left(\cos\frac{x}{2}-\sin\frac{x}{2}\right)^2$ (not $\left(\cos\frac{x}{2}+\sin\frac{x}{2}\right)^2$, which instead equals $1+\sin x$) is what allows the common factor to cancel correctly in Step 3.
Practise next
- Express $\tan^{-1}\left(\dfrac{1+\sin x}{\cos x}\right)$ for $x\in\left(-\dfrac{\pi}{2},\dfrac{\pi}{2}\right)$ in its simplest form, using the same half-angle substitution approach.
Show answer
$\dfrac{\pi}{4}+\dfrac{x}{2}$. Write everything in terms of $\tfrac{x}{2}$: $1+\sin x=\left(\cos\tfrac x2+\sin\tfrac x2\right)^2$ and $\cos x=\left(\cos\tfrac x2-\sin\tfrac x2\right)\left(\cos\tfrac x2+\sin\tfrac x2\right)$.
Cancelling one factor and dividing top and bottom by $\cos\tfrac x2$,
$$\frac{1+\sin x}{\cos x}=\frac{1+\tan\frac x2}{1-\tan\frac x2}=\tan\left(\frac{\pi}{4}+\frac{x}{2}\right).$$
For $x\in\left(-\tfrac\pi2,\tfrac\pi2\right)$ the angle $\tfrac\pi4+\tfrac x2$ lies in $\left(0,\tfrac\pi2\right)$, inside the principal range of $\tan^{-1}$, so the inverse undoes it exactly.

Doubts are answered by Shiwam, usually within a day. Ask about this question specifically — a general question about the chapter is better asked in class.