Step 1: Substitution check
Test $x=\dfrac{\pi}{6}$: $\tan=\dfrac{1}{\sqrt{3}}$, $\sec=\dfrac{2}{\sqrt{3}}$, sum $=\sqrt{3}$.
Right side: $2\cos\dfrac{\pi}{6}=\sqrt{3}$. It works.
Step 2: Test other angles
$x=\dfrac{\pi}{3}$ gives $\sqrt{3}+2\ne 1$, and $x=\dfrac{\pi}{4}$ gives $1+\sqrt{2}\ne\sqrt{2}$.
Step 3: Select
Only $\dfrac{\pi}{6}$ satisfies the equation, so the general solution uses $\dfrac{\pi}{6}$.
Final Answer:
Only pi/6 satisfies the equation among the options.
\[ \boxed{\text{(D) }x=n\pi +(-1)^{n}\left(\dfrac{\pi }{6}\right),n\in Z} \]