The given function is \( \displaystyle \cos^{2}x \) and we need to compute the integral of this function with respect to \( x \), i.e., compute \(\int \cos^{2} x \, dx\).
Solution:
We know that \(\displaystyle \cos^{2} x = \frac{1 + \cos(2x)}{2} \).
Therefore,
\( \begin{aligned} \int \cos^{2} x \, dx &= \int \frac{1 + \cos(2x)}{2} \, dx \\ &= \frac{1}{2} \int \left( 1 + \cos(2x) \right) \, dx \\ &= \frac{1}{2} \left[ \int 1 \, dx + \int \cos(2x) \, dx \right] \\ &= \frac{1}{2} \left[ x + \frac{1}{2} \sin(2x) \right] + C, \quad \text{C is a constant} \\ &= \frac{1}{2} x + \frac{1}{4} \sin(2x) + C \\ \end{aligned} \)Thus, the integral of the given function is
\( \boxed{ \int \cos^{2} x \, dx = \frac{x}{2} + \frac{\sin(2x)}{4} + C } \\ \)Please let me know in the comments if you find any errors in this solution.