# Integral of cos² x: Formula, Derivation and Examples

> The integral of cos² x is x/2 + sin(2x)/4 + C. See the power-reducing identity, a check, cos²(ax) and the area of a circle.

Source: https://practicecalculus.com/integrals/cos-squared-x
Updated: 2026-11-06

$$ \int \cos^2 x\,dx = \frac{x}{2} + \frac{\sin 2x}{4} + C $$

## At a glance

- **Antiderivative:** $\dfrac{x}{2} + \dfrac{\sin 2x}{4} + C$
- **Identity used:** $\cos^2 x = \dfrac{1 + \cos 2x}{2}$
- **Equivalent form:** $\dfrac{x + \sin x\cos x}{2} + C$
- **From 0 to 2π:** $\pi$
- **Check with sin²:** $\int(\sin^2 x + \cos^2 x)\,dx = x + C$

## Key takeaways

- The integral of $\cos^2 x$ is $\frac{x}{2} + \frac{\sin 2x}{4} + C$.
- Rewrite with $\cos^2 x = \frac{1 + \cos 2x}{2}$ before integrating.
- Adding it to the integral of $\sin^2 x$ gives $x + C$, a quick way to check your signs.
- This integral appears whenever a trig substitution meets $\sqrt{1 - x^2}$, such as the area of a circle.

The **integral of $\cos^2 x$ is $\dfrac{x}{2} + \dfrac{\sin 2x}{4} + C$**. Like $\sin^2 x$, it needs a power-reducing identity before you integrate.

$$\int \cos^2 x\,dx = \frac{x}{2} + \frac{\sin 2x}{4} + C$$

## Graph of cos² x and its antiderivative

```graph
title: 'Area under y = cos² x from -π/2 to π/2, with the antiderivative y = x/2 + sin(2x)/4'
caption: 'The shaded area is $\frac{\pi}{2} \approx 1.571$. The dashed antiderivative rises fastest at $x = 0$, where $\cos^2 x = 1$, and flattens where $\cos^2 x = 0$.'
x: [-3.5, 3.5]
y: [-2, 2]
functions:
  - expr: cos(x)^2
    label: y = cos² x
  - expr: x/2 + sin(2x)/4
    label: y = x/2 + sin(2x)/4 (antiderivative)
    dashed: true
shade: {expr: cos(x)^2, from: -1.5708, to: 1.5708}
points:
  - [0, 1, '(0, 1)']
```

## Derivation, step by step

1. Start from $\cos 2x = 2\cos^2 x - 1$.
2. Solve for $\cos^2 x$: $\cos^2 x = \dfrac{1 + \cos 2x}{2}$.
3. Substitute: $\displaystyle\int\cos^2 x\,dx = \frac{1}{2}\int(1 + \cos 2x)\,dx$.
4. Integrate: $\frac{1}{2}\left(x + \frac{\sin 2x}{2}\right) + C$.
5. Simplify: $\frac{x}{2} + \frac{\sin 2x}{4} + C$.

Step 4 uses the [integral of cos x](/integrals/cos-x) with a factor of $\frac{1}{2}$ from the inside $2x$.

## Check by differentiating

$$\frac{d}{dx}\left(\frac{x}{2} + \frac{\sin 2x}{4}\right) = \frac{1}{2} + \frac{\cos 2x}{2} = \cos^2 x \checkmark$$

A second check: add this answer to the [integral of sin² x](/integrals/sin-squared-x):

$$\left(\frac{x}{2} + \frac{\sin 2x}{4}\right) + \left(\frac{x}{2} - \frac{\sin 2x}{4}\right) = x$$

That matches $\int(\sin^2 x + \cos^2 x)\,dx = \int 1\,dx = x$. The forward direction is on the [derivative of cos² x](/derivatives/cos-squared-x) page.

## Definite integrals

$$\int_0^{\pi/2}\cos^2 x\,dx = \frac{\pi}{4}, \qquad \int_0^{\pi}\cos^2 x\,dx = \frac{\pi}{2}, \qquad \int_0^{2\pi}\cos^2 x\,dx = \pi$$

$$\int_0^{\pi/6}\cos^2 x\,dx = \frac{\pi}{12} + \frac{\sin(\pi/3)}{4} = \frac{\pi}{12} + \frac{\sqrt{3}}{8} \approx 0.478$$

## Substitution variants

$$\int\cos^2(ax)\,dx = \frac{x}{2} + \frac{\sin(2ax)}{4a} + C$$

**Example 1.** $\int\cos^2(5x)\,dx = \frac{x}{2} + \frac{\sin 10x}{20} + C$.

**Example 2.** $\int\cos^2\frac{x}{2}\,dx = \int\frac{1 + \cos x}{2}\,dx = \frac{x}{2} + \frac{\sin x}{2} + C$.

**Example 3: with a sin x factor.** $\int\cos^2 x\sin x\,dx = -\frac{\cos^3 x}{3} + C$, using $u = \cos x$. No identity needed.

## Where it shows up: the area of a circle

The area of a circle of radius $1$ is $4\int_0^1\sqrt{1 - x^2}\,dx$. Substitute $x = \sin\theta$, $dx = \cos\theta\,d\theta$:

$$4\int_0^{\pi/2}\cos\theta\cdot\cos\theta\,d\theta = 4\int_0^{\pi/2}\cos^2\theta\,d\theta = 4\cdot\frac{\pi}{4} = \pi$$

The same steps give the [integral of √(1 - x²)](/integrals/sqrt-1-minus-x-squared). See [trig substitution](/blog/trig-substitution) for the method.

## Worked example: cos² x sin² x

Use $\sin x\cos x = \frac{\sin 2x}{2}$, so $\sin^2 x\cos^2 x = \frac{\sin^2 2x}{4} = \frac{1 - \cos 4x}{8}$. Then

$$\int\sin^2 x\cos^2 x\,dx = \frac{x}{8} - \frac{\sin 4x}{32} + C$$

## Common mistakes

1. **Answering $\sin^2 x$.** Its derivative is $2\sin x\cos x$.
2. **Answering $\frac{\cos^3 x}{3}$.** That would need a $-\sin x$ factor.
3. **Using $1 - \cos 2x$.** That identity is for $\sin^2 x$. A quick test: at $x = 0$, $\cos^2 x = 1$, and $\frac{1 + \cos 0}{2} = 1$.
4. **Writing $\frac{\sin 2x}{2}$ instead of $\frac{\sin 2x}{4}$.** Remember both halvings: one from the identity, one from the inside $2x$.

Practise on [trig integral problems](/practice-problems/trig-integrals).

## Frequently asked questions

### What is the integral of cos² x?

It is $\frac{x}{2} + \frac{\sin 2x}{4} + C$, or equivalently $\frac{1}{2}(x + \sin x\cos x) + C$.

### What is the integral of cos² x from 0 to 2π?

It is $\pi$. The $\sin 2x$ term is $0$ at both ends, leaving $\frac{2\pi}{2}$.

### What is the integral of cos²(x/2)?

Since $\cos^2\frac{x}{2} = \frac{1 + \cos x}{2}$, the integral is $\frac{x}{2} + \frac{\sin x}{2} + C$.

### What is the integral of cos² x sin x?

Use $u = \cos x$, $du = -\sin x\,dx$. The answer is $-\frac{\cos^3 x}{3} + C$.
