# 009B Sample Midterm 2, Problem 5 Detailed Solution

Evaluate the integral:

${\displaystyle \int \tan ^{4}x~dx}$

Background Information:
1. Recall the trig identity
${\displaystyle \sec ^{2}x=\tan ^{2}x+1}$
2. Recall
${\displaystyle \int \sec ^{2}x~dx=\tan x+C}$
3. How would you integrate  ${\displaystyle \int \sec ^{2}(x)\tan(x)~dx?}$

You can use  ${\displaystyle u}$-substitution.

Let  ${\displaystyle u=\tan x.}$
Then,  ${\displaystyle du=\sec ^{2}(x)dx.}$

Thus,

${\displaystyle {\begin{array}{rcl}\displaystyle {\int \sec ^{2}(x)\tan(x)~dx}&=&\displaystyle {\int u~du}\\&&\\&=&\displaystyle {{\frac {u^{2}}{2}}+C}\\&&\\&=&\displaystyle {{\frac {\tan ^{2}x}{2}}+C.}\end{array}}}$

Solution:

Step 1:
First, we write
${\displaystyle \int \tan ^{4}(x)~dx=\int \tan ^{2}(x)\tan ^{2}(x)~dx.}$
Using the trig identity  ${\displaystyle \sec ^{2}(x)=\tan ^{2}(x)+1,}$
we have
${\displaystyle \tan ^{2}(x)=\sec ^{2}(x)-1.}$
Plugging in the last identity into one of the  ${\displaystyle \tan ^{2}(x),}$  we get

${\displaystyle {\begin{array}{rcl}\displaystyle {\int \tan ^{4}(x)~dx}&=&\displaystyle {\int \tan ^{2}(x)(\sec ^{2}(x)-1)~dx}\\&&\\&=&\displaystyle {\int \tan ^{2}(x)\sec ^{2}(x)~dx-\int \tan ^{2}(x)~dx}\\&&\\&=&\displaystyle {\int \tan ^{2}(x)\sec ^{2}(x)~dx-\int (\sec ^{2}x-1)~dx}\end{array}}}$

by using the identity again on the last equality.
Step 2:
So, we have
${\displaystyle \int \tan ^{4}(x)~dx=\int \tan ^{2}(x)\sec ^{2}(x)~dx-\int (\sec ^{2}x-1)~dx.}$
For the first integral, we need to use  ${\displaystyle u}$-substitution.
Let  ${\displaystyle u=\tan(x).}$
Then,  ${\displaystyle du=\sec ^{2}(x)dx.}$
So, we have
${\displaystyle \int \tan ^{4}(x)~dx=\int u^{2}~du-\int (\sec ^{2}(x)-1)~dx.}$
Step 3:
We integrate to get

${\displaystyle {\begin{array}{rcl}\displaystyle {\int \tan ^{4}(x)~dx}&=&\displaystyle {{\frac {u^{3}}{3}}-(\tan(x)-x)+C}\\&&\\&=&\displaystyle {{\frac {\tan ^{3}(x)}{3}}-\tan(x)+x+C.}\end{array}}}$

${\displaystyle {\frac {\tan ^{3}(x)}{3}}-\tan(x)+x+C}$