Skip to main content

Section 6.3 Integrals of Trigonometric Functions

In this section, we explore the integrals (antiderivatives) of various trigonometric functions. First, recall the antiderivative of sine and cosine,
\begin{align*} \int \sin{x} \,dx \amp= -\cos{x} + C\\ \text{and} \qquad \int \cos{x} \,dx \amp= \sin{x} + C \end{align*}
The integrals of the other trigonometric functions are somewhat more complicated, and require using substitution. First, here are all of them together,
\begin{equation*} \boxed{\begin{array}{ll} \int \sin{x} \,dx = -\cos{x} + C \amp \int \cos{x} \,dx = \sin{x} + C \\ \int \sec{x} \,dx = \ln{\abs{\sec{x} + \tan{x}}} + C \amp \int \csc{x} \,dx = -\ln{\abs{\csc{x} + \cot{x}}} + C \\ \int \tan{x} \,dx = -\ln{\abs{\cos{x}}} + C \amp \int \cot{x} \,dx = \ln{\abs{\sin{x}}} + C \end{array}} \end{equation*}
You may get a formula sheet on your final exam with these formulas, or you may be expected to memorize them (or derive them if needed).

Remark 6.3.1.

A pattern that can help you memorize these antiderivatives, is that the antiderivative of the “co” functions (cosine, cosecant, cotangent) are similar to their corresponding non-co functions (sine, secant, tangent), except,
  • They have the opposite sign (so if the non-co function has a positive sign, the co function has a negative sign, and vice versa).
  • They have similar function parts, but “flipped”, in that non-co functions become co functions, and co becomes non-co. In particular,
    integral of... non-co-function co-function
    \(\cos{x}\) \(\longleftrightarrow\) \(\sin{x}\)
    \(\ln{\abs{\sec{x}+\tan{x}}}\) \(\longleftrightarrow\) \(\ln{\abs{\csc{x}+\cot{x}}}\)
    \(\ln{\abs{\cos{x}}}\) \(\longleftrightarrow\) \(\ln{\abs{\sin{x}}}\)

Subsection 6.3.1 Integrals of Tangent, Secant, Cosecant, and Cotangent

Remark 6.3.3.

Note that these two antiderivatives are equivalent, because,
\begin{align*} -\ln{\abs{\cos{x}}} \amp= \ln{\brac{\abs{\cos{x}}^{-1}}} \amp\amp\text{by log laws}\\ \amp= \ln{\abs{\frac{1}{\cos{x}}}}\\ \amp= \ln{\abs{\sec{x}}} \end{align*}

Example 6.3.4. Deriving the Integral of Tangent.

To integrate \(\tan{x}\text{,}\) recall that \(\tan{x} = \frac{\sin{x}}{\cos{x}}\text{.}\) We can rewrite it as \(\frac{\sin{x}}{\cos{x}}\text{,}\) and use substitution,
\begin{equation*} \int \tan{x} \,dx = \int \frac{\sin{x}}{\cos{x}} \,dx \end{equation*}
Notice that there is \(\cos{x}\) in the denominator, and its derivative \(-\sin{x}\) is in the numerator (except with a negative sign), so we can use substitution. Then,
\begin{align*} u = \cos{x} \qquad du \amp= -\sin{x} \,dx\\ -du \amp= \sin{x} \,dx \end{align*}
Then,
\begin{align*} \amp= -\int \frac{1}{u} \,du\\ \amp= -\ln{\abs{u}} + C\\ \amp= -\ln{\abs{\cos{x}}} + C\\ \amp= \ln{\abs{(\cos{x})^{-1}}} + C\\ \amp= \ln{\abs{\sec{x}}} + C \end{align*}

Example 6.3.6. Deriving the Integral of Secant.

There are multiple ways to integrate \(\sec{x}\text{,}\) but the most common way is to use a very special trick, of multiplying the numerator and denominator by \(\sec{x} + \tan{x}\text{,}\)
\begin{equation*} \int \sec{x} \,dx = \int \frac{\sec{x}(\sec{x} + \tan{x})}{\sec{x} + \tan{x}} \,dx \end{equation*}
It turns out that this allows us to use substitution, because there is \(\sec{x}+\tan{x}\) in the denominator, and its derivative is \(\sec{x} \tan{x} + \sec^2{x}\text{,}\) which is exactly what is in the numerator. Then,
\begin{align*} u = \sec{x} + \tan{x} \qquad du \amp= (\sec{x} \tan{x} + \sec^2{x}) \,dx\\ \amp= \sec{x}(\sec{x} + \tan{x}) \,dx \end{align*}
Then,
\begin{align*} \amp= \int \frac{1}{u} \,du\\ \amp= \ln{\abs{u}} + C\\ \amp= \ln{\abs{\sec{x} + \tan{x}}} + C \end{align*}

Example 6.3.8. Deriving the Integral of Cosecant.

To integrate \(\csc{x}\text{,}\) we can use the same trick as secant, but this time multiplying the numerator and denominator by \(\csc{x} + \cot{x}\text{,}\)
\begin{equation*} \int \csc{x} \,dx = \int \frac{\csc{x}(\csc{x} + \cot{x})}{\csc{x} + \cot{x}} \,dx \end{equation*}
Again, this allows us to use substitution, because there is \(\csc{x} + \cot{x}\) in the denominator, and its derivative is \(-\csc{x} \cot{x} - \csc^2{x}\text{,}\) which is what is in the numerator (except with a negative sign). Then,
\begin{align*} u = \csc{x} + \cot{x} \qquad du \amp= -\csc{x} \cot{x} - \csc^2{x} \,dx\\ -du \amp= \csc{x} \cot{x} + \csc^2{x} \,dx \end{align*}
Then,
\begin{align*} \amp= -\int \frac{1}{u} \,du\\ \amp= -\ln{\abs{u}} + C\\ \amp= -\ln{\abs{\csc{x} + \cot{x}}} + C \end{align*}

Remark 6.3.10.

Note that these two antiderivatives are equivalent, because,
\begin{align*} \ln{\abs{\csc{x}}} \amp= \ln{\abs{\frac{1}{\sin{x}}}} \amp\amp\text{by definition of cosecant}\\ \amp= \ln{\abs{\sin{x}}^{-1}}\\ \amp= -\ln{\abs{\sin{x}}} \amp\amp\text{by log laws} \end{align*}

Example 6.3.11. Deriving the Integral of Cotangent.

To integrate \(\cot{x}\text{,}\) it is similar to \(\tan{x}\text{.}\) We can rewrite it as \(\frac{\cos{x}}{\sin{x}}\text{,}\) and use substitution,
\begin{equation*} \int \cot{x} \,dx = \int \frac{\cos{x}}{\sin{x}} \,dx \end{equation*}
Then,
\begin{align*} u = \sin{x} \qquad du \amp= \cos{x} \,dx \end{align*}
Then,
\begin{align*} \amp= \int \frac{1}{u} \,du\\ \amp= \ln{\abs{u}} + C\\ \amp= \ln{\abs{\sin{x}}} + C \end{align*}

Subsection 6.3.2 Integral of \(\sin^2{x}\) and \(\cos^2{x}\)

Two important trig integrals that come up often are \(\int \sin^2{x} \,dx\) and \(\int \cos^2{x} \,dx\text{.}\)
These integrals show up often enough that they are helpful to memorize, or at least memorize the method of deriving them.

Example 6.3.13. Integral of \(\cos^2{x}\).

Consider,
\begin{equation*} \int \cos^2{x} \,dx \end{equation*}
Solution.
Unfortunately, there is no simple substitution that can be used to evaluate this integral (like, for example, \(u=\cos{x}\)). Also, you can’t just integrate \(\cos^2{x}\) as if it were 2 \(\cos{x}\) functions multiplied together,,
\begin{align*} \int \cos^2{x} \,dx \amp\neq \int \cos{x} \,dx \cdot \int \cos{x} \,dx\\ \int \cos^2{x} \,dx \amp\neq \sin^2{x} + C \end{align*}
Instead, we have to use a particular trigonometric identity, called the power-reducing identities. There are 2 of them, one for cosine and one for sine,
\begin{equation*} \cos^2{x} = \frac{1+\cos{(2x)}}{2} \qquad \text{and} \qquad \sin^2{x} = \frac{1-\cos{(2x)}}{2} \end{equation*}
As their name suggests, these identities express \(\cos^2{x}\) and \(\sin^2{x}\) (cosine and sine to the 2nd power) in terms of \(\cos{(2x)}\text{,}\) which is to the 1st power.
These identities can be derived from the double-angle identities for cosine,
\begin{align*} \cos{(2x)} \amp= 2\cos^2{x} - 1\\ \cos{(2x)} \amp= 1 - 2\sin^2{x} \end{align*}
If you solve the first equation to isolate for \(\cos^2{x}\text{,}\) and the second equation for \(\sin^2{x}\text{,}\) you get the power-reducing identities.
Using these identities, we can evaluate the integral of \(\cos^2{x}\text{,}\)
\begin{align*} \int \cos^2{x} \,dx \amp= \int \frac{1 + \cos{(2x)}}{2} \,dx\\ \amp= \frac{1}{2} \int (1 + \cos{(2x)}) \,dx\\ \amp= \frac{1}{2} \brac{x + \frac{1}{2} \sin{(2x)}} + C \end{align*}
Further, the double-angle identity \(\sin{(2x)} = 2 \sin{x} \cos{x}\) can be used to rewrite the antiderivative in terms of only single angles \(x\text{,}\)
\begin{align*} \amp= \frac{1}{2} x + \frac{1}{2} \sin{x} \cos{x} + C\\ \amp= \frac{1}{2}(x + \sin{x} \cos{x}) + C \end{align*}
The integral of \(\sin^2{x}\) can be evaluated in the same way, using the other power-reducing identity,

Example 6.3.14. Integral of \(\sin^2{x}\).

Consider the integral,
\begin{equation*} \int \sin^2{x} \,dx \end{equation*}
Solution.
Use the power-reducing identity for sine \(\sin^2{x} = \frac{1-\cos{(2x)}}{2}\text{,}\)
\begin{align*} \int \sin^2{x} \,dx \amp= \int \frac{1 - \cos{(2x)}}{2} \,dx\\ \amp= \frac{1}{2} \int (1 - \cos{(2x)}) \,dx\\ \amp= \frac{1}{2} \brac{x - \frac{1}{2} \sin{(2x)}} + C \end{align*}
Again, we can use the double-angle identity \(\sin{(2x)} = 2 \sin{x} \cos{x}\) to rewrite the antiderivative in terms of only single angles \(x\text{,}\)
\begin{align*} \amp= \frac{1}{2} x - \frac{1}{2} \sin{x} \cos{x} + C\\ \amp= \frac{1}{2}(x - \sin{x} \cos{x}) + C \end{align*}
For reference, here are the power-reducing identities again,
\begin{equation*} \boxed{\begin{array}{rl} \cos^2{x} \amp= \frac{1+\cos{(2x)}}{2} \\[5pt] \sin^2{x} \amp= \frac{1-\cos{(2x)}}{2} \end{array}} \end{equation*}
You may get these identities on your formula sheet for your exams, or you may need to memorize them.

Subsection 6.3.3 Examples

Exercise Group 6.3.1. Basic Trigonometric Integrals Practice.

Evaluate each integral.
(a)
\(\int (\sec{x}+1)^2 \,dx\)
Hint.
Expand, and use the formula for \(\int \sec^2{x} \,dx\text{.}\)
Answer.
\(\tan{x} + 2\ln{\abs{\sec{x} + \tan{x}}} + x + C\)
(b)
\(\int \frac{1}{1-\sin{x}} \,dx\)
Hint.
Multiply the numerator and denominator by \(1+\sin{x}\text{,}\) and split the fraction.
Answer.
\(\tan{x} + \sec{x} + C\)
(c)
\(\int \frac{1+\sin{x}}{\cos^2{x}} \,dx\)
Hint.
Split the fraction into \(\sec^2{x} + \sec{x}\tan{x}\text{.}\)
Answer.
\(\tan{x} + \sec{x} + C\)
(d)
\(\int (\sec{x} - \tan{x})^2 \,dx\)
Hint.
Expand, and use \(\tan^2{x} = \sec^2{x} - 1\text{.}\)
Answer.
\(2\tan{x} - 2\sec{x} - x + C\)
(e)
\(\int (\csc{x} - \sec{x})(\sin{x} + \cos{x}) \,dx\)
Hint.
Distribute; use \(\csc{x} \sin{x} = 1\) and \(\sec{x} \cos{x} = 1\text{.}\)
Answer.
\(\ln{\abs{\sin{x}}} + \ln{\abs{\cos{x}}} + C\)
(f)
\(\int_{\pi/4}^{\pi/3} \frac{dx}{\cos^2{x}\tan{x}}\)
Hint.
Rewrite as \(\int \frac{\sec^2{x}}{\tan{x}} \,dx\) and use \(u = \tan{x}\text{.}\)
Answer.
\(\frac{1}{2}\ln{3}\)

Exercise Group 6.3.2. More Trigonometric Integrals Practice.

Evaluate each integral.
(a)
\(\int \frac{dx}{\cos{x} - 1}\)
Hint.
Multiply numerator and denominator by \(\cos{x} + 1\text{,}\) and use \(\cos^2{x} - 1 = -\sin^2{x}\text{.}\)
Answer.
\(\csc{x} + \cot{x} + C\)
(b)
\(\int \frac{dx}{\sec{x} + \tan{x}}\)
Hint.
Multiply numerator and denominator by \(\sec{x} - \tan{x}\text{,}\) and use \(\sec^2{x} - \tan^2{x} = 1\text{.}\)
Answer.
\(\ln{\abs{1 + \sin{x}}} + C\)
(c)
\(\int (\cos{x}\sin{2x} + \sin{x}\cos{2x}) \,dx\)
Hint.
Use the sine addition formula \(\sin{(A+B)} = \sin{A}\cos{B} + \cos{A}\sin{B}\text{.}\)
Answer.
\(-\frac{1}{3}\cos{3x} + C\)
(d)
\(\int \frac{dx}{1 - \sec{x}}\)
Hint.
Rewrite as \(\int \frac{\cos{x}}{\cos{x} - 1} \,dx\text{,}\) then multiply by the conjugate \(\frac{\cos{x}+1}{\cos{x}+1}\text{.}\)
Answer.
\(\cot{x} + \csc{x} + x + C\)
(e)
\(\int (\sec{x} + \cot{x})^2 \,dx\)
Hint.
Expand, and use \(\cot^2{x} = \csc^2{x} - 1\) and \(\sec{x}\cot{x} = \csc{x}\text{.}\)
Answer.
\(\tan{x} - 2\ln{\abs{\csc{x} + \cot{x}}} - \cot{x} - x + C\)