Step 1: Logarithmic derivative:
If $\mu = e^{\int P}$ then $P = \frac{\mu'}{\mu}$.
Step 2: Compute:
With $\mu = \tan x$: $\mu' = \sec^2x$, so $P = \frac{\sec^2 x}{\tan x} = \frac{1}{\cos^2x}\cdot\frac{\cos x}{\sin x} = \frac{1}{\sin x\cos x}$.
Step 3: Double angle:
$\sin x\cos x = \frac12\sin 2x$, so $P = \frac{2}{\sin 2x} = 2\csc 2x$.
Final Answer:
P is 2 cosec 2x, option (D).
\[ \boxed{2\csc 2x} \]