practicecalculus
Trigonometric integrals

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.

Trigonometric integrals Updated 3 min read

At a glance

\int \sin x\,dx = -\cos x + C
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
On this page
  1. Graph of sin x and its antiderivative
  2. Derivation, step by step
  3. Check by differentiating
  4. Definite integrals
  5. Substitution variants
  6. Worked examples
  7. Common mistakes

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

Area under y = sin x from 0 to π, with the antiderivative y = -cos x
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.

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: \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:

\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.

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, or practise with trig integral problems.

Practice it now

Sine, cosine, eˣ and 1/x

Solve real problems on this topic with instant feedback, hints and a step-by-step walkthrough for every answer. Free, no sign-up needed to start.

Practice this lesson

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.

Written by the PracticeCalculus team

We build interactive calculus lessons and write every page to be clear and correct. Spotted something off? Tell us and we will fix it.