JEE Main 2024 — 8 April, Shift 2. Previous Year Question.
Problem
The sum of all possible values of $\theta \in [-\pi, 2\pi]$, for which
$$\frac{1+i\cos\theta}{1-2i\cos\theta}$$
is purely imaginary, is equal to:
Key insight. “Purely imaginary” is a condition on the real part of the expression, not the whole thing — so the fastest route is to rationalise the denominator, set the real part to zero, and only then worry about how many values of $\theta$ satisfy that condition inside the given interval.
Watch this explained step by step → · More on the Shiwam’s Classes channel
Approach
Multiply numerator and denominator by the conjugate of the denominator to turn the expression into standard $a+ib$ form. Setting the real part $a=0$ gives an equation purely in $\cos\theta$. Solving that equation over $[-\pi, 2\pi]$ (an interval spanning $3\pi$, so trigonometric solutions repeat) requires carefully tracking every value of $\theta$ in range, not just the “principal” ones.
Solution
Step 1 — Rationalise the denominator
Multiply top and bottom by the conjugate of the denominator, $1+2i\cos\theta$:
$$\frac{1+i\cos\theta}{1-2i\cos\theta}\cdot\frac{1+2i\cos\theta}{1+2i\cos\theta} = \frac{(1+i\cos\theta)(1+2i\cos\theta)}{1+4\cos^2\theta}$$
Expanding the numerator:
$$(1+i\cos\theta)(1+2i\cos\theta) = 1 + 2i\cos\theta + i\cos\theta + 2i^2\cos^2\theta = (1-2\cos^2\theta) + i(3\cos\theta)$$
So the expression becomes
$$\frac{(1-2\cos^2\theta) + 3i\cos\theta}{1+4\cos^2\theta}$$
Step 2 — Set the real part to zero
For the expression to be purely imaginary, its real part must vanish:
$$\frac{1-2\cos^2\theta}{1+4\cos^2\theta} = 0 \implies 1-2\cos^2\theta = 0 \implies \cos^2\theta = \frac12 \implies \cos\theta = \pm\frac{1}{\sqrt2}$$
(The denominator $1+4\cos^2\theta$ is never zero, so it never causes trouble.)
Step 3 — Find every θ in [-π, 2π] with cos θ = ±1/√2
The reference angle is $\dfrac{\pi}{4}$. Walking through the interval $[-\pi, 2\pi]$ (a span of $3\pi$, i.e. one and a half full rotations), the solutions are:
$$\theta = -\frac{3\pi}{4},\ -\frac{\pi}{4},\ \frac{\pi}{4},\ \frac{3\pi}{4},\ \frac{5\pi}{4},\ \frac{7\pi}{4}$$
These are exactly the six points where $\cos\theta = \pm\dfrac{1}{\sqrt2}$ as $\theta$ sweeps from $-\pi$ through $0$, $\pi$, and up to $2\pi$.
Step 4 — Sum the values
$$-\frac{3\pi}{4} – \frac{\pi}{4} + \frac{\pi}{4} + \frac{3\pi}{4} + \frac{5\pi}{4} + \frac{7\pi}{4}$$
The first four terms cancel in pairs ($-\tfrac{3\pi}{4}+\tfrac{3\pi}{4}=0$ and $-\tfrac{\pi}{4}+\tfrac{\pi}{4}=0$), leaving
$$\frac{5\pi}{4} + \frac{7\pi}{4} = \frac{12\pi}{4} = 3\pi$$
Answer
$$3\pi$$
Common mistakes
- Only listing the solutions in $(0, 2\pi)$ or $(-\pi, \pi)$ and missing the overlap region. Because the interval $[-\pi, 2\pi]$ spans one and a half periods of cosine, several values of $\theta$ appear that a student solving on a single standard period would miss.
- Forgetting to check that the denominator of the real part can never be zero. $1+4\cos^2\theta \geq 1$ always, so the only way the real part vanishes is through the numerator — but it’s worth confirming this rather than assuming it.
- Sign errors when expanding $(1+i\cos\theta)(1+2i\cos\theta)$. The $i^2\cos^2\theta$ term flips sign to become $-2\cos^2\theta$, which is easy to miss if the expansion is rushed.
Practise next
- Find the sum of all $\theta \in [0, 2\pi]$ for which $\dfrac{1+2i\sin\theta}{1-i\sin\theta}$ is purely imaginary.
Show answer
$4\pi$. Write $s=\sin\theta$ and multiply top and bottom by $1+is$: the numerator becomes $(1+2is)(1+is)=1-2s^2+3is$.
Purely imaginary means the real part vanishes: $1-2s^2=0$, so $\sin\theta=\pm\tfrac{1}{\sqrt2}$. (The imaginary part $3s$ is then non-zero, so the value is not $0$.)
In $[0,2\pi]$ that gives $\tfrac\pi4,\tfrac{3\pi}4,\tfrac{5\pi}4,\tfrac{7\pi}4$, summing to $4\pi$.

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.