Step 1: Substitution check
Put $x=\frac{\pi}{4}$: $\cos x=\frac{1}{\sqrt2}$, so $2\tan^{-1}\frac{1}{\sqrt2}=\tan^{-1}\frac{2/\sqrt2}{1-1/2}=\tan^{-1}2\sqrt2$.
Step 2: Right side
$\tan^{-1}(2\operatorname{cosec}x)=\tan^{-1}(2\sqrt2)$, which is equal.
Step 3: Other options
For $x=0$, $\operatorname{cosec}x$ is undefined, and $x=-\frac{\pi}{4}$ makes the right side negative while the left side is positive.
Final Answer:
$x=\frac{\pi}{4}$ satisfies the equation.
\[ \boxed{\text{(D) }\dfrac{\pi}{4}} \]