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
- 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
The integral of \sin x is -\cos x + C. Most mistakes with this integral come down to one thing: the minus sign.
Graph of sin x and its antiderivative
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
- Ask: which function has derivative \sin x?
- Recall the derivative of cos x: \frac{d}{dx}\cos x = -\sin x.
- That is the right shape but the wrong sign. Multiply by -1: \frac{d}{dx}(-\cos x) = \sin x.
- 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
Definite integrals
Using the Fundamental Theorem of Calculus:
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:
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:
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
- Writing \cos x + C. Check by differentiating: \frac{d}{dx}\cos x = -\sin x, so the sign is wrong.
- Forgetting to divide by a in \int\sin(ax)\,dx.
- Multiplying by a instead. \int\sin(3x)\,dx is not -3\cos(3x). That is what differentiating would do.
- 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