# Integral of sin x: Formula, Derivation and Examples

> The integral of sin x is -cos x + C. See where the minus sign comes from, the area of one arch, sin(ax + b) by substitution and worked definite integrals.

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

$$ \int \sin x\,dx = -\cos x + C $$

## At a glance

- **Antiderivative:** $-\cos x + C$
- **Area of one arch:** $\int_0^\pi \sin x\,dx = 2$
- **Full period:** $\int_0^{2\pi}\sin x\,dx = 0$
- **Linear form:** $\int\sin(ax + b)\,dx = -\dfrac{1}{a}\cos(ax + b) + C$
- **Check:** $\dfrac{d}{dx}(-\cos x) = \sin x$

## Key takeaways

- The integral of $\sin x$ is $-\cos x + C$. The minus sign is essential.
- One arch of the sine curve, from $0$ to $\pi$, has area exactly $2$.
- Over a full period the integral of $\sin x$ is $0$, because the arch below the axis cancels the arch above.
- For $\sin(ax + b)$, divide by $a$: $\int\sin(3x)\,dx = -\frac{1}{3}\cos(3x) + C$.

The **integral of $\sin x$ is $-\cos x + C$**. Most mistakes with this integral come down to one thing: the minus sign.

$$\int \sin x\,dx = -\cos x + C$$

## Graph of sin x and its antiderivative

```graph
title: 'Area under y = sin x from 0 to π, with the antiderivative y = -cos x'
caption: 'The shaded arch has area exactly $2$. The dashed curve $y = -\cos x$ rises from $-1$ at $x = 0$ to $1$ at $x = \pi$, a change of $2$.'
x: [-1, 7]
y: [-1.6, 1.6]
functions:
  - expr: sin(x)
    label: y = sin x
  - expr: -cos(x)
    label: y = -cos x (antiderivative)
    dashed: true
shade: {expr: sin(x), from: 0, to: 3.14159}
points:
  - [0, -1, '(0, -1)']
  - [3.14159, 1, '(π, 1)']
```

Where $\sin x > 0$ (from $0$ to $\pi$), the antiderivative $-\cos x$ climbs. Where $\sin x < 0$ (from $\pi$ to $2\pi$), it falls back down.

## Derivation, step by step

1. Ask: which function has derivative $\sin x$?
2. Recall the [derivative of cos x](/derivatives/cos-x): $\frac{d}{dx}\cos x = -\sin x$.
3. That is the right shape but the wrong sign. Multiply by $-1$: $\frac{d}{dx}(-\cos x) = \sin x$.
4. So $-\cos x$ is an antiderivative, and adding $C$ gives all of them.

A memory trick: going around the cycle $\sin \to \cos \to -\sin \to -\cos \to \sin$ is differentiating. Going backwards is integrating.

## Check by differentiating

$$\frac{d}{dx}(-\cos x + C) = -(-\sin x) = \sin x \checkmark$$

## Definite integrals

Using the [Fundamental Theorem of Calculus](/theorems/fundamental-theorem-of-calculus-part-2):

$$\int_0^\pi \sin x\,dx = \Big[-\cos x\Big]_0^\pi = -\cos\pi + \cos 0 = 1 + 1 = 2$$

Other useful values:

| Integral | Value | Why |
| --- | --- | --- |
| $\int_0^{\pi/2}\sin x\,dx$ | $1$ | $-\cos\frac{\pi}{2} + \cos 0 = 0 + 1$ |
| $\int_0^{\pi}\sin x\,dx$ | $2$ | one full arch |
| $\int_0^{2\pi}\sin x\,dx$ | $0$ | the two arches cancel |
| $\int_{-a}^{a}\sin x\,dx$ | $0$ | $\sin x$ is odd |

If you want total area over $[0, 2\pi]$ rather than signed area, integrate $\lvert\sin x\rvert$ and get $4$.

## Substitution variants

With $u = ax + b$, $du = a\,dx$:

$$\int\sin(ax + b)\,dx = -\frac{1}{a}\cos(ax + b) + C$$

So $\int\sin(5x)\,dx = -\frac{1}{5}\cos(5x) + C$ and $\int\sin\left(\frac{x}{2}\right)dx = -2\cos\left(\frac{x}{2}\right) + C$. For $\sin(2x)$ there is a whole page: the [integral of sin 2x](/integrals/sin-2x).

When a matching inside derivative is present, substitute:

$$\int x\sin(x^2)\,dx = -\frac{1}{2}\cos(x^2) + C \quad (u = x^2)$$

$$\int \sin x\,e^{\cos x}\,dx = -e^{\cos x} + C \quad (u = \cos x)$$

## Worked examples

**Example 1.** $\int(3\sin x + 2x)\,dx = -3\cos x + x^2 + C$.

**Example 2.** $\int_0^{\pi/3}\sin x\,dx = -\cos\frac{\pi}{3} + \cos 0 = -\frac{1}{2} + 1 = \frac{1}{2}$.

**Example 3: position from velocity.** A particle has $v(t) = \sin t$ and starts at $s(0) = 0$. Then $s(t) = -\cos t + C$, and $s(0) = -1 + C = 0$ gives $C = 1$, so $s(t) = 1 - \cos t$.

**Example 4: average value.** The average of $\sin x$ on $[0, \pi]$ is $\frac{1}{\pi}\cdot 2 = \frac{2}{\pi} \approx 0.637$.

## Common mistakes

1. **Writing $\cos x + C$.** Check by differentiating: $\frac{d}{dx}\cos x = -\sin x$, so the sign is wrong.
2. **Forgetting to divide by $a$** in $\int\sin(ax)\,dx$.
3. **Multiplying by $a$ instead.** $\int\sin(3x)\,dx$ is not $-3\cos(3x)$. That is what differentiating would do.
4. **Sign errors in definite integrals.** Write out $[-\cos x]$ with brackets and subtract carefully: $-\cos\pi = +1$.

Next, see the [integral of cos x](/integrals/cos-x), or practise with [trig integral problems](/practice-problems/trig-integrals).

## Frequently asked questions

### What is the integral of sin x?

The integral of $\sin x$ is $-\cos x + C$.

### Why is the integral of sin x negative cos x?

Because the derivative of $\cos x$ is $-\sin x$. To get $+\sin x$ you need the derivative of $-\cos x$.

### What is the integral of sin x from 0 to π?

It is $-\cos\pi - (-\cos 0) = 1 + 1 = 2$.

### What is the integral of sin(2x)?

It is $-\frac{1}{2}\cos(2x) + C$. The factor $\frac{1}{2}$ undoes the $2$ that the chain rule would produce.
