Step 1: Convert using the identity written the other way round, $2\cos^2x=1+\cos2x$:
This gives $\cos^2 x = \dfrac{1}{2} + \dfrac{\cos 2x}{2}$, the same rewritten integrand as before but arrived at from the double-angle expansion of cosine directly.
Step 2: Integrate term by term, treating $2x$ as the inner variable:
$\displaystyle\int \dfrac12\,dx = \dfrac{x}{2}$. For $\displaystyle\int\dfrac{\cos 2x}{2}\,dx$, substitute $u=2x$, $du=2\,dx$, giving $\dfrac12\int\cos u \cdot \dfrac{du}{2} = \dfrac{\sin u}{4} = \dfrac{\sin 2x}{4}$.
Step 3: Combine both results:
Adding the two pieces gives the full antiderivative.
Final Answer:
$\displaystyle\int\cos^2x\,dx = \dfrac{x}{2}+\dfrac{\sin2x}{4}+C$.
\[ \boxed{\dfrac{x}{2}+\dfrac{\sin2x}{4}+C} \]