Step 1: Understanding the Concept
Put \(t=\tan\frac{x}{2}\); then \(\cos x=\dfrac{1-t^{2}}{1+t^{2}}\) and \(dx=\dfrac{2\,dt}{1+t^{2}}\).
Step 2: Substitute
\(2+\cos x=\dfrac{2(1+t^{2})+1-t^{2}}{1+t^{2}}=\dfrac{3+t^{2}}{1+t^{2}}\).
Step 3: Simplify the integral
\(\displaystyle\int\frac{2\,dt}{3+t^{2}}=\frac{2}{\sqrt{3}}\tan^{-1}\frac{t}{\sqrt{3}}+C\).
Step 4: Replace t
\(=\dfrac{2}{\sqrt{3}}\tan^{-1}\left(\dfrac{\tan(x/2)}{\sqrt{3}}\right)+C\), option (D).
Final Answer:
The integral is \(\frac{2}{\sqrt{3}}\tan^{-1}\left(\frac{\tan(x/2)}{\sqrt{3}}\right)+C\).
\[ \boxed{\text{(D) }\frac{2}{\sqrt{3}}\tan ^{-1}\left(\frac{\tan \left(\frac{x}{2}\right)}{\sqrt{3}}\right)+C} \]