practicecalculus
Trigonometric integrals

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

\int \cos x\,dx = \sin x + C
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
  1. Graph of cos 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 \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.

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

Graph of cos x and its antiderivative

Area under y = cos x from -π/2 to π/2, with the antiderivative y = sin x
The shaded hump has area \sin\frac{\pi}{2} - \sin\left(-\frac{\pi}{2}\right) = 2. The dashed curve y = \sin x climbs from -1 to 1 across the same interval.

The antiderivative \sin x peaks at x = \frac{\pi}{2}, exactly where \cos x crosses zero from positive to negative.

Derivation, step by step

  1. Ask: which function has derivative \cos x?
  2. The derivative of sin x is \cos x.
  3. So \sin x is an antiderivative of \cos x.
  4. Add C to include every antiderivative: \sin x + C.

No sign fix is needed here, unlike the integral of sin x.

Check by differentiating

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

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:

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

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:

\int \cos x\,e^{\sin x}\,dx = e^{\sin x} + C \quad (u = \sin x)
\int \cos x\,\sin^3 x\,dx = \frac{\sin^4 x}{4} + C \quad (u = \sin x)
\int \frac{\cos(\sqrt{x})}{\sqrt{x}}\,dx = 2\sin(\sqrt{x}) + C \quad (u = \sqrt{x})

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

  1. Writing -\sin x. That is the derivative of \cos x, not the integral.
  2. Forgetting to divide by a. \int\cos(3x)\,dx = \frac{1}{3}\sin(3x) + C, not \sin(3x) + C.
  3. 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.
  4. 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

Frequently asked questions

What is the integral of cos x?

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

What is the integral of cos(2x)?

It is \frac{1}{2}\sin(2x) + C. Check: the derivative of \frac{1}{2}\sin(2x) is \frac{1}{2}\cdot 2\cos(2x) = \cos(2x).

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

It is \sin\pi - \sin 0 = 0. The area above the axis on \left[0, \frac{\pi}{2}\right] cancels the area below on \left[\frac{\pi}{2}, \pi\right].

Is the integral of cos x equal to -sin x?

No. -\sin x is the derivative of \cos x. The integral is +\sin x + C.

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.