Week 10 Discussion Notes
Table of Contents
Integration Techniques
As a quick summary, here are the main techniques we learned in the past week:
Integration by parts
Trig integrals (essentially just trig identities and integration by parts)
Trig substitution (basically a u u u -substitution combined with trig integrals)
Partial fractions
From this list, the only real new one this week is the method of partial fractions.
Partial Fractions
You usually want to use partial fractions when you want to integrate a rational function, i.e., a function of the form
P ( x ) Q ( x ) , \frac{P\p{x}}{Q\p{x}}, Q ( x ) P ( x ) ,
where P P P and Q Q Q are polynomials such that deg P < deg Q \deg{P} < \deg{Q} deg P < deg Q (if this isn't the case, then you have to do long division first). For example, the result of partial fractions looks something like
1 ( x − 1 ) ( x − 2 ) = 1 x − 2 − 1 x − 1 . \frac{1}{\p{x - 1}\p{x - 2}} = \frac{1}{x - 2} - \frac{1}{x - 1}. ( x − 1 ) ( x − 2 ) 1 = x − 2 1 − x − 1 1 .
As you can imagine, the left side is hard to integrate, but the right side is a lot easier to integrate.
Process
When setting up the partial fractions, you want to look at the factors of q q q . Here're the rules for the setup:
Linear Factors
For every factor of Q Q Q of the form ( x + a ) n \p{x + a}^n ( x + a ) n , you need to include the following terns:
A 1 x + a + A 2 ( x + a ) 2 + ⋯ + A N ( x + a ) N . \frac{A_1}{x + a} + \frac{A_2}{\p{x + a}^2} + \cdots + \frac{A_N}{\p{x + a}^N}. x + a A 1 + ( x + a ) 2 A 2 + ⋯ + ( x + a ) N A N .
Quadratic Factors
For factors of the form ( x 2 + a x + b ) M \p{x^2 + ax + b}^M ( x 2 + a x + b ) M , you need
A 1 x + B 1 x 2 + a x + b + A 2 x + B 2 ( x 2 + a x + b ) 2 + ⋯ + A M x + B M ( x 2 + a x + b ) M . \frac{A_1x + B_1}{x^2 + ax + b} + \frac{A_2x + B_2}{\p{x^2 + ax + b}^2} + \cdots + \frac{A_Mx + B_M}{\p{x^2 + ax + b}^M}. x 2 + a x + b A 1 x + B 1 + ( x 2 + a x + b ) 2 A 2 x + B 2 + ⋯ + ( x 2 + a x + b ) M A M x + B M .
Once you have the setup, you need to solve for all the constants.
Example 1.
Calculate ∫ x 2 ( x + 1 ) ( x 2 + 1 ) d x \displaystyle \int \frac{x^2}{\p{x+1}\p{x^2+1}} \,\diff{x} ∫ ( x + 1 ) ( x 2 + 1 ) x 2 d x .
Solution.
As you might guess, we're going to want to perform partial fractions first before integrating. We have a factor of ( x + 1 ) \p{x + 1} ( x + 1 ) and ( x 2 + 1 ) \p{x^2 + 1} ( x 2 + 1 ) , so our decomposition looks like
x 2 ( x + 1 ) ( x 2 + 1 ) = A x + 1 + B x + C x 2 + 1 x 2 = A ( x 2 + 1 ) + ( B x + C ) ( x + 1 ) . \begin{gathered}
\frac{x^2}{\p{x+1}\p{x^2+1}}
= \frac{A}{x+1} + \frac{Bx+C}{x^2+1} \\
x^2 = A\p{x^2 + 1} + \p{Bx + C}\p{x + 1}.
\end{gathered} ( x + 1 ) ( x 2 + 1 ) x 2 = x + 1 A + x 2 + 1 B x + C x 2 = A ( x 2 + 1 ) + ( B x + C ) ( x + 1 ) .
I multiplied both sides by ( x + 1 ) ( x 2 + 1 ) \p{x+1}\p{x^2+1} ( x + 1 ) ( x 2 + 1 ) to get to the second line. From here, there are two main ways to solve for the coefficients:
Method 1: Expand and match coefficients.
If you expand the right-hand side and collect like terms, you get
x 2 = A x 2 + A + B x 2 + B x + C x + C x 2 + 0 x + 0 = ( A + B ) x 2 + ( B + C ) x + A + C . \begin{aligned}
x^2
&= Ax^2 + A + Bx^2 + Bx + Cx + C \\
x^2 + 0x + 0
&= \p{A + B}x^2 + \p{B + C}x + A + C.
\end{aligned} x 2 x 2 + 0 x + 0 = A x 2 + A + B x 2 + B x + C x + C = ( A + B ) x 2 + ( B + C ) x + A + C .
The equation is true for every value of x x x , and this means that the coefficients have to be the same, so you get the system
{ A + B = 1 B + C = 0 A + C = 0 \begin{cases}
A + B = 1 \\
B + C = 0 \\
A + C = 0
\end{cases} ⎩ ⎨ ⎧ A + B = 1 B + C = 0 A + C = 0
and you can solve for A , B , C A, B, C A , B , C from here.
Method 2: Plug in values for x x x .
Like before, the equation is true for any x x x , so you can plug in convenient values to get equations for your coefficients:
x = − 1 ⟹ 1 = 2 A ⟹ A = 1 2 x = 0 ⟹ 0 = A + C ⟹ C = − 1 2 x = 1 ⟹ 1 = 2 A + 2 ( B + C ) ⟹ B = 1 2 . \begin{aligned}
x = -1
&\implies 1 = 2A \\
&\implies A = \frac{1}{2} \\
x = 0
&\implies 0 = A + C \\
&\implies C = -\frac{1}{2} \\
x = 1
&\implies 1 = 2A + 2\p{B + C} \\
&\implies B = \frac{1}{2}.
\end{aligned} x = − 1 x = 0 x = 1 ⟹ 1 = 2 A ⟹ A = 2 1 ⟹ 0 = A + C ⟹ C = − 2 1 ⟹ 1 = 2 A + 2 ( B + C ) ⟹ B = 2 1 .
You can use either method (or even both at the same time), and you should get the same numbers each time. Our calculations tell us that
x 2 ( x + 1 ) ( x 2 + 1 ) = 1 2 x + 1 + 1 2 x − 1 2 x 2 + 1 . \frac{x^2}{\p{x+1}\p{x^2+1}}
= \frac{\frac{1}{2}}{x+1} + \frac{\frac{1}{2}x - \frac{1}{2}}{x^2+1}. ( x + 1 ) ( x 2 + 1 ) x 2 = x + 1 2 1 + x 2 + 1 2 1 x − 2 1 .
Now, to integrate this, we just have to integrate all the terms on the right. You'll usually want to split things up at this point:
∫ 1 2 x + 1 d x = 1 2 ln ∣ x + 1 ∣ + C . \int \frac{\frac{1}{2}}{x+1} \,\diff{x}
= \frac{1}{2} \ln{\abs{x+1}} + C. ∫ x + 1 2 1 d x = 2 1 ln ∣ x + 1 ∣ + C .
For the second one, we can use the substitution u = x 2 + 1 u = x^2 + 1 u = x 2 + 1 , which gives d u = 2 x d x \diff{u} = 2x \,\diff{x} d u = 2 x d x . Then
∫ 1 2 x x 2 + 1 d x = 1 4 ∫ 2 x x 2 + 1 d x = 1 4 ∫ d u u = 1 4 ln ∣ u ∣ + C = 1 4 ln ∣ x 2 + 1 ∣ + C . \begin{aligned}
\int \frac{\frac{1}{2}x}{x^2 + 1} \,\diff{x}
&= \frac{1}{4} \int \frac{2x}{x^2 + 1} \,\diff{x} \\
&= \frac{1}{4} \int \frac{\diff{u}}{u} \\
&= \frac{1}{4} \ln{\abs{u}} + C \\
&= \frac{1}{4} \ln{\abs{x^2+1}} + C.
\end{aligned} ∫ x 2 + 1 2 1 x d x = 4 1 ∫ x 2 + 1 2 x d x = 4 1 ∫ u d u = 4 1 ln ∣ u ∣ + C = 4 1 ln ∣ ∣ x 2 + 1 ∣ ∣ + C .
Finally, the third one is
∫ − 1 2 x 2 + 1 d x = − 1 2 arctan x + C . \int \frac{-\frac{1}{2}}{x^2+1} \,\diff{x}
= -\frac{1}{2} \arctan{x} + C. ∫ x 2 + 1 − 2 1 d x = − 2 1 arctan x + C .
Putting these all together, you get
∫ x 2 ( x + 1 ) ( x 2 + 1 ) d x = 1 2 ln ∣ x + 1 ∣ + 1 4 ln ∣ x 2 + 1 ∣ − 1 2 arctan x + C . \int \frac{x^2}{\p{x+1}\p{x^2+1}} \,\diff{x}
= \boxed{\frac{1}{2}\ln{\abs{x+1}} + \frac{1}{4}\ln{\abs{x^2+1}} - \frac{1}{2}\arctan{x} + C}. ∫ ( x + 1 ) ( x 2 + 1 ) x 2 d x = 2 1 ln ∣ x + 1 ∣ + 4 1 ln ∣ ∣ x 2 + 1 ∣ ∣ − 2 1 arctan x + C .
Examples
Example 2.
Calculate ∫ x 3 x d x \displaystyle\int x3^x \,\diff{x} ∫ x 3 x d x .
Solution.
When you see two "unrelated" functions multiplied with each other, usually integration by parts is the way to go. Here, we'll use u = x u = x u = x and d v = 3 x d x \diff{v} = 3^x \,\diff{x} d v = 3 x d x . Then
d u = d x and v = 3 x ln 3 , \diff{u} = \diff{x}
\quad\text{and}\quad
v = \frac{3^x}{\ln{3}}, d u = d x and v = ln 3 3 x ,
so we get
∫ x 3 x d x = x 3 x ln 3 − ∫ 3 x ln 3 d x = x 3 x ln 3 − 3 x ( ln 3 ) 2 + C . \begin{aligned}
\int x3^x \,\diff{x}
&= \frac{x3^x}{\ln{3}} - \int \frac{3^x}{\ln{3}} \,\diff{x} \\
&= \boxed{\frac{x3^x}{\ln{3}} - \frac{3^x}{\p{\ln{3}}^2} + C}.
\end{aligned} ∫ x 3 x d x = ln 3 x 3 x − ∫ ln 3 3 x d x = ln 3 x 3 x − ( ln 3 ) 2 3 x + C .
Example 3.
Calculate ∫ 0 π / 4 tan 5 x d x \displaystyle\int_0^{\pi/4} \tan^5{x} \,\diff{x} ∫ 0 π /4 tan 5 x d x .
Solution.
If you have a definite integral, I recommend just calculating the indefinite integral first, and then applying the bounds at the end.
Usually, it's a good idea to use the identity tan 2 x + 1 = sec 2 x \tan^2{x} + 1 = \sec^2{x} tan 2 x + 1 = sec 2 x and see what happens:
∫ tan 5 x d x = ∫ ( sec 2 x − 1 ) tan 3 x d x = ∫ tan 3 x sec 2 x d x − ∫ tan 3 x d x . \begin{aligned}
\int \tan^5{x} \,\diff{x}
&= \int \p{\sec^2{x} - 1}\tan^3{x} \,\diff{x} \\
&= \int \tan^3{x}\sec^2{x} \,\diff{x} - \int \tan^3{x} \,\diff{x}.
\end{aligned} ∫ tan 5 x d x = ∫ ( sec 2 x − 1 ) tan 3 x d x = ∫ tan 3 x sec 2 x d x − ∫ tan 3 x d x .
We can take care of the first integral with the substitution u = tan x u = \tan{x} u = tan x , which gives d u = sec 2 x d x \diff{u} = \sec^2{x} \,\diff{x} d u = sec 2 x d x , so
∫ tan 3 x sec 2 x d x = ∫ u 3 d u = u 4 4 + C = tan 4 x 4 + C . \int \tan^3{x} \sec^2{x} \,\diff{x}
= \int u^3 \,\diff{u}
= \frac{u^4}{4} + C
= \frac{\tan^4{x}}{4} + C. ∫ tan 3 x sec 2 x d x = ∫ u 3 d u = 4 u 4 + C = 4 tan 4 x + C .
For the second integral, we can use the trig identity again to get
∫ tan 3 x d x = ∫ ( sec 2 x − 1 ) tan x d x = ∫ tan x sec 2 x d x − ∫ tan x d x . \begin{aligned}
\int \tan^3{x} \,\diff{x}
&= \int \p{\sec^2{x} - 1}\tan{x} \,\diff{x} \\
&= \int \tan{x}\sec^2{x} \,\diff{x} - \int \tan{x} \,\diff{x}.
\end{aligned} ∫ tan 3 x d x = ∫ ( sec 2 x − 1 ) tan x d x = ∫ tan x sec 2 x d x − ∫ tan x d x .
We can use u = tan x u = \tan{x} u = tan x again for the first term, and we already know the second one:
∫ tan x sec 2 x d x = tan 2 x 2 + C ∫ tan x d x = ln ∣ sec x ∣ + C . \begin{aligned}
\int \tan{x}\sec^2{x} \,\diff{x}
&= \frac{\tan^2{x}}{2} + C \\
\int \tan{x} \,\diff{x}
&= \ln{\abs{\sec{x}}} + C.
\end{aligned} ∫ tan x sec 2 x d x ∫ tan x d x = 2 tan 2 x + C = ln ∣ sec x ∣ + C .
Putting these all together, we get
∫ tan 5 x d x = tan 4 x 4 − tan 2 x 2 + ln ∣ sec x ∣ + C . \int \tan^5{x} \,\diff{x}
= \frac{\tan^4{x}}{4} - \frac{\tan^2{x}}{2} + \ln{\abs{\sec{x}}} + C. ∫ tan 5 x d x = 4 tan 4 x − 2 tan 2 x + ln ∣ sec x ∣ + C .
Now we can apply the bounds. When x = π 4 x = \frac{\pi}{4} x = 4 π , we get
tan 4 π 4 4 − tan 2 π 4 2 + ln ∣ sec π 4 ∣ = 1 4 − 1 2 + ln 2 = − 1 4 + ln 2 . \begin{aligned}
\frac{\tan^4{\frac{\pi}{4}}}{4} - \frac{\tan^2{\frac{\pi}{4}}}{2} + \ln{\abs{\sec{\frac{\pi}{4}}}}
&= \frac{1}{4} - \frac{1}{2} + \ln{\sqrt{2}} \\
&= -\frac{1}{4} + \ln{\sqrt{2}}.
\end{aligned} 4 tan 4 4 π − 2 tan 2 4 π + ln ∣ ∣ sec 4 π ∣ ∣ = 4 1 − 2 1 + ln 2 = − 4 1 + ln 2 .
When x = 0 x = 0 x = 0 , we get
tan 4 0 4 − tan 2 0 2 + ln ∣ sec 0 ∣ = ln 1 = 0. \frac{\tan^4{0}}{4} - \frac{\tan^2{0}}{2} + \ln{\abs{\sec{0}}}
= \ln{1}
= 0. 4 tan 4 0 − 2 tan 2 0 + ln ∣ sec 0 ∣ = ln 1 = 0.
Thus,
∫ 0 π / 4 tan 5 x d x = − 1 4 + ln 2 . \int_0^{\pi/4} \tan^5{x} \,\diff{x}
= \boxed{-\frac{1}{4} + \ln{\sqrt{2}}}. ∫ 0 π /4 tan 5 x d x = − 4 1 + ln 2 .
Example 4.
Calculate ∫ x 7 cos ( x 4 ) d x \displaystyle\int x^7\cos{\p{x^4}} \,\diff{x} ∫ x 7 cos ( x 4 ) d x .
Solution.
Like in the first example, we should integrate by parts. However, if you try it right away, it might get a little complicated. What you can do instead is start with a substitution: let w = x 4 w = x^4 w = x 4 so d w = 4 x 3 d x \diff{w} = 4x^3 \,\diff{x} d w = 4 x 3 d x and
∫ x 7 cos ( x 4 ) d x = 1 4 ∫ x 4 cos ( x 4 ) 4 x 3 d x = 1 4 ∫ w cos w d w . \begin{aligned}
\int x^7 \cos{\p{x^4}} \,\diff{x}
&= \frac{1}{4} \int x^4 \cos{\p{x^4}} 4x^3 \,\diff{x} \\
&= \frac{1}{4} \int w\cos{w} \,\diff{w}.
\end{aligned} ∫ x 7 cos ( x 4 ) d x = 4 1 ∫ x 4 cos ( x 4 ) 4 x 3 d x = 4 1 ∫ w cos w d w .
Now it's more clear what parts we should use: u = w u = w u = w and d v = cos w d w \diff{v} = \cos{w} \,\diff{w} d v = cos w d w , which gives d u = d w \diff{u} = \diff{w} d u = d w and v = sin w v = \sin{w} v = sin w , so
1 4 ∫ w cos w d w = w sin w 4 − 1 4 ∫ sin w d w = w sin w 4 + cos w 4 + C . \frac{1}{4} \int w\cos{w} \,\diff{w}
= \frac{w\sin{w}}{4} - \frac{1}{4} \int \sin{w} \,\diff{w}
= \frac{w\sin{w}}{4} + \frac{\cos{w}}{4} + C. 4 1 ∫ w cos w d w = 4 w sin w − 4 1 ∫ sin w d w = 4 w sin w + 4 cos w + C .
Undoing the substitution,
∫ x 7 cos ( x 4 ) d x = x 4 sin ( x 4 ) 4 + cos ( x 4 ) 4 + C . \int x^7 \cos{\p{x^4}} \,\diff{x}
= \boxed{\frac{x^4\sin{\p{x^4}}}{4} + \frac{\cos{\p{x^4}}}{4} + C}. ∫ x 7 cos ( x 4 ) d x = 4 x 4 sin ( x 4 ) + 4 cos ( x 4 ) + C .
Example 5.
Calculate ∫ e x tan 2 ( e x ) d x \displaystyle\int e^x\tan^2{\p{e^x}} \,\diff{x} ∫ e x tan 2 ( e x ) d x .
Solution.
Hopefully, your first instinct is to do u = e x u = e^x u = e x , which gives us d u = e x d x \diff{u} = e^x \,\diff{x} d u = e x d x , so
∫ e x tan 2 ( e x ) d x = ∫ tan 2 u d u = ∫ sec 2 u − 1 d u = tan u − u + C = tan ( e x ) − e x + C . \begin{aligned}
\int e^x\tan^2{\p{e^x}} \,\diff{x}
&= \int \tan^2{u} \,\diff{u} \\
&= \int \sec^2{u} - 1 \,\diff{u} \\
&= \tan{u} - u + C \\
&= \boxed{\tan{\p{e^x}} - e^x + C}.
\end{aligned} ∫ e x tan 2 ( e x ) d x = ∫ tan 2 u d u = ∫ sec 2 u − 1 d u = tan u − u + C = tan ( e x ) − e x + C .
Example 6.
Calculate ∫ d x x 2 − 4 x + 8 \displaystyle\int \frac{\diff{x}}{\sqrt{x^2 - 4x + 8}} ∫ x 2 − 4 x + 8 d x .
Solution.
When you see a quadratic under a square root, you will usually want to use a trig substitution. However, right now, it's not clear what substitution to make, but it'll be more clear after completing the square:
x 2 − 4 x + 8 = ( x − 2 ) 2 + 4. x^2 - 4x + 8
= \p{x - 2}^2 + 4. x 2 − 4 x + 8 = ( x − 2 ) 2 + 4.
With this, we get
∫ d x x 2 − 4 x + 8 = ∫ d x ( x − 2 ) 2 + 4 = ∫ d x 4 ( ( x − 2 ) 2 4 + 1 ) = ∫ d x 2 ( x − 2 2 ) 2 + 1 . \begin{aligned}
\int \frac{\diff{x}}{\sqrt{x^2 - 4x + 8}}
&= \int \frac{\diff{x}}{\sqrt{\p{x-2}^2 + 4}} \\
&= \int \frac{\diff{x}}{\sqrt{4\p{\frac{\p{x-2}^2}{4} + 1}}} \\
&= \int \frac{\diff{x}}{2\sqrt{\p{\frac{x-2}{2}}^2 + 1}}.
\end{aligned} ∫ x 2 − 4 x + 8 d x = ∫ ( x − 2 ) 2 + 4 d x = ∫ 4 ( 4 ( x − 2 ) 2 + 1 ) d x = ∫ 2 ( 2 x − 2 ) 2 + 1 d x .
The thing in the square root looks like the trig identity tan 2 θ + 1 = sec 2 θ \tan^2{\theta} + 1 = \sec^2{\theta} tan 2 θ + 1 = sec 2 θ , which suggests the substitution
x − 2 2 = tan θ ⟹ d x 2 = sec 2 θ d θ . \frac{x-2}{2} = \tan{\theta}
\implies \frac{\diff{x}}{2} = \sec^2{\theta} \,\diff{\theta}. 2 x − 2 = tan θ ⟹ 2 d x = sec 2 θ d θ .
We get
∫ d x 2 ( x − 2 2 ) 2 + 1 = ∫ sec 2 θ tan 2 θ + 1 d θ = ∫ sec 2 θ sec θ d θ = ∫ sec θ d θ = ln ∣ sec θ + tan θ ∣ + C . \begin{aligned}
\int \frac{\diff{x}}{2\sqrt{\p{\frac{x-2}{2}}^2 + 1}}
&= \int \frac{\sec^2{\theta}}{\sqrt{\tan^2{\theta} + 1}} \,\diff{\theta} \\
&= \int \frac{\sec^2{\theta}}{\sec{\theta}} \,\diff{\theta} \\
&= \int \sec{\theta} \,\diff{\theta} \\
&= \ln{\abs{\sec{\theta} + \tan{\theta}}} + C.
\end{aligned} ∫ 2 ( 2 x − 2 ) 2 + 1 d x = ∫ tan 2 θ + 1 sec 2 θ d θ = ∫ sec θ sec 2 θ d θ = ∫ sec θ d θ = ln ∣ sec θ + tan θ ∣ + C .
(∫ sec θ d θ \int \sec{\theta} \,\diff{\theta} ∫ sec θ d θ is an integral you should just know.)
To finish up, we need to undo the substitution. We already know that tan θ = x − 2 2 \tan{\theta} = \frac{x-2}{2} tan θ = 2 x − 2 , and for sec θ \sec{\theta} sec θ , we can use the trig identity
sec 2 θ = tan 2 θ + 1 ⟹ sec θ = tan 2 θ + 1 = ( x − 2 2 ) 2 + 1 . \begin{aligned}
\sec^2{\theta}
&= \tan^2{\theta} + 1 \\
\implies
\sec{\theta}
&= \sqrt{\tan^2{\theta} + 1} \\
&= \sqrt{\p{\frac{x-2}{2}}^2 + 1}.
\end{aligned} sec 2 θ ⟹ sec θ = tan 2 θ + 1 = tan 2 θ + 1 = ( 2 x − 2 ) 2 + 1 .
Plugging everything in, we get
ln ∣ sec θ + tan θ ∣ + C = ln ∣ ( x − 2 2 ) 2 + 1 + x − 2 2 ∣ + C . \ln{\abs{\sec{\theta} + \tan{\theta}}} + C
= \boxed{\ln{\abs{\sqrt{\p{\frac{x-2}{2}}^2 + 1} + \frac{x-2}{2}}} + C}. ln ∣ sec θ + tan θ ∣ + C = ln ∣ ∣ ( 2 x − 2 ) 2 + 1 + 2 x − 2 ∣ ∣ + C .