Antiderivatives of Trig Functions: sin, cos, tan, sec, csc, cot

Quick answer

The antiderivatives of the six trig functions are: \(\int\sin x\,dx = -\cos x + C\), \(\int\cos x\,dx = \sin x + C\), \(\int\tan x\,dx = -\ln|\cos x| + C\), \(\int\cot x\,dx = \ln|\sin x| + C\), \(\int\sec x\,dx = \ln|\sec x + \tan x| + C\) and \(\int\csc x\,dx = -\ln|\csc x + \cot x| + C\).

Sine and cosine are easy to remember. Tangent, secant and their partners are not, because their antiderivatives involve logarithms. Instead of one big table, this guide goes through the functions one at a time. For each one you get the answer, a short reason it is true, and an example, so you understand the formulas instead of just memorizing them.

Antiderivative of sin x

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

Why: \(\frac{d}{dx}(-\cos x) = \sin x\). The minus sign is the part people forget.

Example: \(\int 4\sin x\,dx = -4\cos x + C\). Full guide: antiderivative of sin x.

Antiderivative of cos x

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

Why: \(\frac{d}{dx}\sin x = \cos x\). No minus sign this time.

Example: \(\int \cos 3x\,dx = \frac13\sin 3x + C\). The \(\frac13\) undoes the 3 that the chain rule would create. Full guide: antiderivative of cos x.

Antiderivative of tan x

\[\int \tan x\,dx = -\ln|\cos x| + C = \ln|\sec x| + C\]

Why: Write \(\tan x = \frac{\sin x}{\cos x}\) and let \(u = \cos x\), so \(du = -\sin x\,dx\):

\[\int \frac{\sin x}{\cos x}\,dx = -\int \frac{du}{u} = -\ln|\cos x| + C.\]

Because \(-\ln|\cos x| = \ln\left|\frac{1}{\cos x}\right|\), the two forms are the same. Your textbook may use either one. Full guide, including \(\tan^2 x\), \(\tan^3 x\) and \(\arctan x\): antiderivative of tan x.

Antiderivative of cot x

\[\int \cot x\,dx = \ln|\sin x| + C\]

Why: \(\cot x = \frac{\cos x}{\sin x}\), and the top is the derivative of the bottom, so the answer is the log of the bottom. See u-substitution for this pattern.

Antiderivative of sec x

\[\int \sec x\,dx = \ln|\sec x + \tan x| + C\]

Why: This one uses a clever trick. Multiply the top and bottom by \(\sec x + \tan x\):

\[\int \sec x\cdot\frac{\sec x + \tan x}{\sec x + \tan x}\,dx = \int \frac{\sec^2 x + \sec x\tan x}{\sec x + \tan x}\,dx.\]

The top is now exactly the derivative of the bottom, so the answer is \(\ln|\sec x + \tan x| + C\).

Antiderivative of csc x

\[\int \csc x\,dx = -\ln|\csc x + \cot x| + C\]

Why: The same trick, multiplying by \(\csc x + \cot x\). Another correct form is \(\ln|\csc x – \cot x| + C\).

The “Derivative Pairs”: sec², csc², sec tan and csc cot

These four come straight from the derivative table read backward:

FunctionAntiderivativeBecause
\(\sec^2 x\)\(\tan x + C\)\(\frac{d}{dx}\tan x = \sec^2 x\)
\(\csc^2 x\)\(-\cot x + C\)\(\frac{d}{dx}\cot x = -\csc^2 x\)
\(\sec x\tan x\)\(\sec x + C\)\(\frac{d}{dx}\sec x = \sec x\tan x\)
\(\csc x\cot x\)\(-\csc x + C\)\(\frac{d}{dx}\csc x = -\csc x\cot x\)

Powers of Trig Functions

Squares and cubes do not have their own simple rules. You rewrite them with an identity first.

\(\int \sin^2 x\,dx\) and \(\int \cos^2 x\,dx\)

Use the half-angle identities \(\sin^2 x = \frac{1 – \cos 2x}{2}\) and \(\cos^2 x = \frac{1 + \cos 2x}{2}\):

\[\int \sin^2 x\,dx = \frac{x}{2} – \frac{\sin 2x}{4} + C, \qquad \int \cos^2 x\,dx = \frac{x}{2} + \frac{\sin 2x}{4} + C.\]

\(\int \tan^2 x\,dx\)

Use \(\tan^2 x = \sec^2 x – 1\):

\[\int \tan^2 x\,dx = \tan x – x + C.\]

\(\int \sin^3 x\,dx\)

Save one \(\sin x\) and change the rest to cosines: \(\sin^3 x = (1 – \cos^2 x)\sin x\). With \(u = \cos x\):

\[\int \sin^3 x\,dx = -\cos x + \frac{\cos^3 x}{3} + C.\]

\(\int \sin x\cos x\,dx\)

Let \(u = \sin x\): the answer is \(\frac{\sin^2 x}{2} + C\).

Trig Functions With an Inside Function

For a straight-line inside \(ax + b\), divide by \(a\):

  • \(\int \sin(2x)\,dx = -\frac12\cos 2x + C\)
  • \(\int \sec^2(4x)\,dx = \frac14\tan 4x + C\)
  • \(\int \tan\left(\frac{x}{2}\right)dx = -2\ln\left|\cos\frac{x}{2}\right| + C\)

For a curved inside, you need the inside’s derivative as a factor: \(\int 2x\cos(x^2)\,dx = \sin(x^2) + C\).

Definite Integrals to Try

  • \(\int_0^{\pi/2} \cos x\,dx = \sin\frac{\pi}{2} – \sin 0 = 1\)
  • \(\int_0^{\pi/4} \sec^2 x\,dx = \tan\frac{\pi}{4} – \tan 0 = 1\)
  • \(\int_0^{\pi/3} \tan x\,dx = -\ln\left(\cos\frac{\pi}{3}\right) = \ln 2 \approx 0.693\)

Check them in the definite integral calculator, which also shades the area.

Always use radians. Every formula on this page assumes \(x\) is in radians. With degrees, extra factors of \(\frac{\pi}{180}\) appear.

Frequently Asked Questions

What is the antiderivative of tan x?

It is \(-\ln|\cos x| + C\), which is the same as \(\ln|\sec x| + C\).

What is the antiderivative of cos x?

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

What is the antiderivative of sec x?

It is \(\ln|\sec x + \tan x| + C\). It is found by multiplying the top and bottom by \(\sec x + \tan x\).

What is the antiderivative of sec² x?

It is \(\tan x + C\), because the derivative of \(\tan x\) is \(\sec^2 x\).

Why do some trig antiderivatives have ln in them?

Tangent, cotangent, secant and cosecant are fractions of sine and cosine. When the top of a fraction is the derivative of the bottom, the antiderivative is the natural log of the bottom.

Keep Learning

Leave a Comment