\(\int\displaystyle\frac{dx}{1+\tan x}\) is equal to:
Answer & explanation
Correct answer: option 2
The correct answer is Option (2) → \(\displaystyle\frac{x}{2}+\displaystyle\frac{1}{2}\log|\cos x+\sin x|+C\), C is an arbitrary constant
Writing tan x as sin x / cos x:
\(\displaystyle \int\frac{dx}{1+\tan x} = \int\frac{\cos x}{\cos x+\sin x}\,dx\)
The numerator is half of (denominator + its derivative). The derivative of \(\cos x+\sin x\) is \(\cos x-\sin x\), and
\(\displaystyle \cos x = \frac{1}{2}\left[(\cos x+\sin x)+(\cos x-\sin x)\right]\)
So
\(\displaystyle \int\frac{\cos x}{\cos x+\sin x}\,dx = \frac{1}{2}\int 1\,dx+\frac{1}{2}\int\frac{\cos x-\sin x}{\cos x+\sin x}\,dx\)
The second integral has the form \(\int\frac{g'(x)}{g(x)}\,dx = \log|g(x)|\), the derivative-over-function rule:
\(\displaystyle = \frac{x}{2}+\frac{1}{2}\log|\cos x+\sin x|+C\)
NCERT (2026-27 edition):
Integration by Substitution
