Like sin²(x), integrating cos²(x) requires a half-angle identity to reduce it to something integrable. The result differs from the sin² case only by the sign of the oscillating term.
Result
\[ \int \cos^2(x)\,dx = \frac{x}{2} + \frac{\sin(2x)}{4} + C \]
Derivation
Apply the half-angle identity:
\[ \cos^2(x) = \frac{1 + \cos(2x)}{2} \]Substitute and integrate term by term:
\[ \int \cos^2(x)\,dx = \int \frac{1+\cos(2x)}{2}\,dx = \frac{x}{2} + \frac{\sin(2x)}{4} + C \]Verification: \(\dfrac{d}{dx}\!\left[\dfrac{x}{2} + \dfrac{\sin(2x)}{4}\right] = \dfrac{1}{2} + \dfrac{2\cos(2x)}{4} = \dfrac{1+\cos(2x)}{2} = \cos^2(x)\) ✓
Definite integral examples
\(\int_0^{\pi} \cos^2(x)\,dx\)
\[ \left[\frac{x}{2} + \frac{\sin(2x)}{4}\right]_0^{\pi} = \frac{\pi}{2} + 0 = \frac{\pi}{2} \]Equal to \(\int_0^{\pi}\sin^2(x)\,dx\) — both functions average \(\tfrac{1}{2}\) over a full period.
\(\int_0^{\pi/2} \cos^2(x)\,dx\)
\[ \left[\frac{x}{2} + \frac{\sin(2x)}{4}\right]_0^{\pi/2} = \frac{\pi}{4} + 0 = \frac{\pi}{4} \]Common variants
| Integral | Antiderivative | Notes |
|---|---|---|
| \(\int \sin^2(x)\,dx\) | \(\dfrac{x}{2} - \dfrac{\sin(2x)}{4} + C\) | Same method with \(\sin^2 x = \tfrac{1-\cos 2x}{2}\). |
| \(\int \cos^4(x)\,dx\) | \(\dfrac{3x}{8} + \dfrac{\sin(2x)}{4} + \dfrac{\sin(4x)}{32} + C\) | Apply the half-angle identity twice. |
Try it in the calculator
Paste any variant below into the step-by-step integral calculator for a full worked solution and graph.
Open in calculator →