Antiderivative of cos x: sin x + C (Plus cos 2x, cos² x and More)

Quick answer

The antiderivative of \(\cos x\) is \(\sin x + C\). In symbols, \(\int \cos x\,dx = \sin x + C\). It is correct because the derivative of \(\sin x\) is \(\cos x\). Unlike sine, there is no minus sign. For \(\cos(ax)\), divide by \(a\): \(\int \cos 2x\,dx = \frac12\sin 2x + C\).

Cosine has the friendliest antiderivative in all of trigonometry: just switch to sine. But homework rarely stops at plain \(\cos x\). You will also see \(\cos 2x\), \(\cos^2 x\), \(x\cos x\) and cosine hiding inside fractions. This guide starts with three quick ways to be sure the basic answer is right, then climbs a ladder of harder cosine integrals, one rung at a time.

Three Ways to Know \(\int \cos x\,dx = \sin x + C\)

1. Differentiate the answer

\[\frac{d}{dx}\big(\sin x + C\big) = \cos x + 0 = \cos x. \;✓\]

This is the official test for any antiderivative. If the derivative of your answer is the function you started with, you are done. See how to check an antiderivative.

2. Read the graphs

An antiderivative rises where the original function is positive and falls where it is negative. On \(\left(-\frac{\pi}{2}, \frac{\pi}{2}\right)\), \(\cos x > 0\), and \(\sin x\) climbs from \(-1\) to \(1\). On \(\left(\frac{\pi}{2}, \frac{3\pi}{2}\right)\), \(\cos x < 0\), and \(\sin x\) falls. The peaks of \(\sin x\) sit exactly where \(\cos x = 0\). The two curves fit together perfectly.

3. Check an area

The area under one half-hump of cosine, from \(0\) to \(\frac{\pi}{2}\), should be a little less than the rectangle \(\frac{\pi}{2} \times 1 \approx 1.57\) around it. The antiderivative gives

\[\int_0^{\pi/2} \cos x\,dx = \sin\frac{\pi}{2} – \sin 0 = 1.\]

An area of 1 is less than 1.57, as expected. ✓

Sine vs Cosine: Where Does the Minus Sign Go?

This is the part students mix up most, so here it is side by side:

DerivativeAntiderivative
\(\sin x\)\(\cos x\)\(-\cos x + C\)
\(\cos x\)\(-\sin x\)\(\sin x + C\)

Memory trick: ask “what did I differentiate to get this?” The derivative of \(\sin x\) is a plain, positive \(\cos x\), so integrating cosine needs no minus sign. Only the derivative of cosine, \(-\sin x\), has one. The full sine story is in the antiderivative of sin x guide.

The Cosine Ladder: From Easy to Tricky

Each rung adds one new idea. Try to say the answer before you read it.

Rung 1: A number in front

\[\int 4\cos x\,dx = 4\sin x + C\]

Constants just ride along (the constant multiple rule).

Rung 2: A number inside

\[\int \cos 2x\,dx = \frac12\sin 2x + C \qquad \int \cos\frac{x}{2}\,dx = 2\sin\frac{x}{2} + C\]

For \(\cos(ax + b)\), divide by \(a\). The reason: differentiating \(\sin 2x\) creates an extra factor of 2 (chain rule), so the antiderivative needs a \(\frac12\) to cancel it. Likewise \(\int \cos(3x + 1)\,dx = \frac13\sin(3x + 1) + C\).

Rung 3: The inside’s derivative is already there

\[\int 2x\cos(x^2)\,dx = \sin(x^2) + C\]

Let \(u = x^2\), so \(du = 2x\,dx\), and the integral becomes \(\int \cos u\,du\). This is u-substitution. If only \(x\) is there instead of \(2x\), the answer is \(\frac12\sin(x^2) + C\).

Rung 4: Cosine as the “du” of something

Because \(\frac{d}{dx}\sin x = \cos x\), a \(\cos x\,dx\) next to a function of \(\sin x\) is a gift. Let \(u = \sin x\):

  • \(\int \sin^2 x\cos x\,dx = \frac{\sin^3 x}{3} + C\)
  • \(\int e^{\sin x}\cos x\,dx = e^{\sin x} + C\)
  • \(\int \frac{\cos x}{\sin x}\,dx = \ln|\sin x| + C\) (this is \(\int \cot x\,dx\))
  • \(\int \frac{\cos x}{1 + \sin x}\,dx = \ln(1 + \sin x) + C\)

Rung 5: A power of cosine

\(\cos^2 x\): there is no power rule for this. Use the identity \(\cos^2 x = \frac{1 + \cos 2x}{2}\):

\[\int \cos^2 x\,dx = \int\left(\frac12 + \frac12\cos 2x\right)dx = \frac{x}{2} + \frac{\sin 2x}{4} + C.\]

\(\cos^3 x\): save one \(\cos x\) and turn the rest into sines with \(\cos^2 x = 1 – \sin^2 x\). Then let \(u = \sin x\):

\[\int \cos^3 x\,dx = \int (1 – \sin^2 x)\cos x\,dx = \sin x – \frac{\sin^3 x}{3} + C.\]

\(\int \cos^2 x\,dx\) is not \(\frac{\cos^3 x}{3} + C\). The power rule only works on \(x^n\), not on \((\cos x)^n\). Differentiate \(\frac{\cos^3 x}{3}\) and you get \(-\cos^2 x\sin x\), which is wrong.

Rung 6: Cosine times something else

\(x\cos x\): use integration by parts with \(u = x\) and \(dv = \cos x\,dx\), so \(du = dx\) and \(v = \sin x\):

\[\int x\cos x\,dx = x\sin x – \int \sin x\,dx = x\sin x + \cos x + C.\]

\(e^x\cos x\): integrate by parts twice and solve for the integral, which appears again on the right side:

\[\int e^x\cos x\,dx = \frac{e^x(\sin x + \cos x)}{2} + C.\]

Quick Reference Table

IntegralAnswerIdea used
\(\int \cos x\,dx\)\(\sin x + C\)Basic rule
\(\int -\cos x\,dx\)\(-\sin x + C\)Constant multiple
\(\int \cos 5x\,dx\)\(\frac15\sin 5x + C\)Divide by inside slope
\(\int \cos^2 x\,dx\)\(\frac{x}{2} + \frac{\sin 2x}{4} + C\)Half-angle identity
\(\int \cos^3 x\,dx\)\(\sin x – \frac{\sin^3 x}{3} + C\)Pythagorean identity + sub
\(\int \sin x\cos x\,dx\)\(\frac{\sin^2 x}{2} + C\)\(u = \sin x\)
\(\int x\cos x\,dx\)\(x\sin x + \cos x + C\)By parts
\(\int e^x\cos x\,dx\)\(\frac{e^x(\sin x + \cos x)}{2} + C\)By parts twice

Definite Integrals of Cosine

IntegralValueWhat it means
\(\int_0^{\pi/2} \cos x\,dx\)\(1\)Area of one half-hump
\(\int_{-\pi/2}^{\pi/2} \cos x\,dx\)\(2\)Area of one full hump
\(\int_0^{\pi} \cos x\,dx\)\(0\)Area above and below the axis cancel
\(\int_0^{2\pi} |\cos x|\,dx\)\(4\)Total area, counting every part as positive

Notice the difference between the signed answer (0) and the total area (4). A definite integral counts area below the axis as negative. Try these in the definite integral calculator to see the shaded regions.

Where You Meet This in Real Life

Anything that swings back and forth, like a mass on a spring, a pendulum or the voltage in a wall outlet, is described with sine and cosine. Suppose a weight on a spring has velocity \(v(t) = 3\cos 2t\) m/s. Its position is the antiderivative:

\[s(t) = \int 3\cos 2t\,dt = \frac32\sin 2t + C.\]

If the weight starts at \(s(0) = 0\), then \(C = 0\), and the weight swings between \(-1.5\) m and \(1.5\) m. Finding \(C\) from a starting value is explained in the constant of integration guide.

Practice: Try These Yourself

1. \(\int 6\cos 3x\,dx\)

\(2\sin 3x + C\). Divide 6 by the inside slope 3.

2. \(\int (\cos x – 2x)\,dx\)

\(\sin x – x^2 + C\). Integrate each term separately.

3. \(\int \cos^2(3x)\,dx\)

Use \(\cos^2(3x) = \frac{1 + \cos 6x}{2}\). Answer: \(\frac{x}{2} + \frac{\sin 6x}{12} + C\).

4. \(\int x^2\cos(x^3)\,dx\)

Let \(u = x^3\), \(du = 3x^2\,dx\). Answer: \(\frac13\sin(x^3) + C\).

5. \(\int_0^{\pi/6} \cos x\,dx\)

\(\sin\frac{\pi}{6} – \sin 0 = \frac12\).

Check your answers with the antiderivative calculator, which shows every step and differentiates the result for you.

Calculators for This Topic

Practice what you just read. Each tool shows full steps and checks its own answer.

Frequently Asked Questions

What is the antiderivative of cos x?

The antiderivative of \(\cos x\) is \(\sin x + C\), because the derivative of \(\sin x\) is \(\cos x\).

What is the antiderivative of cos 2x?

It is \(\frac12\sin 2x + C\). Because the inside is \(2x\), you divide by 2.

What is the antiderivative of cos squared x?

Use the identity \(\cos^2 x = \frac{1 + \cos 2x}{2}\). The answer is \(\frac{x}{2} + \frac{\sin 2x}{4} + C\).

What is the antiderivative of −cos x?

It is \(-\sin x + C\). The minus sign simply stays in front.

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

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

Related Guides

Leave a Comment