Step 1: Combine $\cos x+\sqrt{3}\sin x$ into a single trigonometric function.
\[
\cos x+\sqrt{3}\sin x = 2\cos\left(x-\frac{\pi}{3}\right)
\]
Step 2: Substitute in the integral:
\[
\int \frac{dx}{\cos x+\sqrt{3}\sin x}
= \frac{1}{2}\int \sec\left(x-\frac{\pi}{3}\right)\,dx
\]
Step 3: Use the standard integral:
\[
\int \sec u\,du = \log \tan\left(\frac{u}{2}+\frac{\pi}{4}\right)+c
\]
Step 4: Here, $u=x-\dfrac{\pi}{3}$.
\[
\frac{u}{2}+\frac{\pi}{4}
= \frac{x}{2}-\frac{\pi}{6}+\frac{\pi}{4}
= \frac{x}{2}+\frac{\pi}{12}
\]
Step 5: Therefore,
\[
\int \frac{dx}{\cos x+\sqrt{3}\sin x}
= \frac{1}{2}\log \tan\left(\frac{x}{2}+\frac{\pi}{12}\right)+c
\]