Integral of cos x: Formula, Derivation and Examples
The integral of cos x is sin x + C. See why there is no minus sign, the area of one hump, cos(ax + b) by substitution and worked definite integral examples.
Trigonometric integrals Updated 2 min read
At a glance
- Antiderivative
- \sin x + C
- Area of one hump
- \int_{-\pi/2}^{\pi/2}\cos x\,dx = 2
- Full period
- \int_0^{2\pi}\cos x\,dx = 0
- Linear form
- \int\cos(ax + b)\,dx = \dfrac{1}{a}\sin(ax + b) + C
- Check
- \dfrac{d}{dx}\sin x = \cos x
On this page
The integral of \cos x is \sin x + C. Because the derivative of \sin x is exactly \cos x, this is one of the cleanest integrals there is.
Graph of cos x and its antiderivative
The antiderivative \sin x peaks at x = \frac{\pi}{2}, exactly where \cos x crosses zero from positive to negative.
Derivation, step by step
- Ask: which function has derivative \cos x?
- The derivative of sin x is \cos x.
- So \sin x is an antiderivative of \cos x.
- Add C to include every antiderivative: \sin x + C.
No sign fix is needed here, unlike the integral of sin x.
Check by differentiating
Definite integrals
| Integral | Value |
|---|---|
| \int_0^{\pi/2}\cos x\,dx | \sin\frac{\pi}{2} - \sin 0 = 1 |
| \int_0^{\pi/6}\cos x\,dx | \frac{1}{2} |
| \int_0^{\pi}\cos x\,dx | 0 |
| \int_{-\pi/2}^{\pi/2}\cos x\,dx | 2 |
Since \cos x is even, \int_{-a}^{a}\cos x\,dx = 2\int_0^a\cos x\,dx = 2\sin a.
Substitution variants
With u = ax + b:
For example, \int\cos(4x - 1)\,dx = \frac{1}{4}\sin(4x - 1) + C, and \int\cos(\pi x)\,dx = \frac{1}{\pi}\sin(\pi x) + C.
When the inside derivative appears as a factor, use u-substitution:
For the last one, du = \frac{1}{2\sqrt{x}}dx, so \frac{dx}{\sqrt{x}} = 2\,du.
Worked examples
Example 1. \int(2\cos x - 3\sin x)\,dx = 2\sin x + 3\cos x + C. Note how the minus in front of \sin combines with the minus in -\cos x to give +3\cos x.
Example 2. \int_0^{\pi/4}\cos(2x)\,dx = \left[\frac{1}{2}\sin(2x)\right]_0^{\pi/4} = \frac{1}{2}\sin\frac{\pi}{2} = \frac{1}{2}.
Example 3: an initial value problem. If f'(x) = \cos x and f(0) = 3, then f(x) = \sin x + C and f(0) = C = 3, so f(x) = \sin x + 3.
Example 4: simple harmonic motion. If a spring has velocity v(t) = 4\cos(2t) and position s(0) = 0, then s(t) = 2\sin(2t). The amplitude is 2.
Common mistakes
- Writing -\sin x. That is the derivative of \cos x, not the integral.
- Forgetting to divide by a. \int\cos(3x)\,dx = \frac{1}{3}\sin(3x) + C, not \sin(3x) + C.
- Integrating \cos^2 x as \sin^2 x or \frac{\cos^3 x}{3}. Powers of trig functions need identities. See the integral of cos² x.
- Integrating \cos(x^2) as \frac{\sin(x^2)}{2x}. You cannot divide by a variable inside derivative. \int\cos(x^2)\,dx has no elementary antiderivative.
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