1 Integration by Substitution (Change of Variables) : 1.1 Example Problems
1 Integration by Substitution (Change of Variables) : 1.1 Example Problems
3. Rewrite the integral by replacing all instances of x with the new variable and compute the integral
or definite integral.
4. If you computed the indefinite integral, then make sure to write your final answer back in terms
of the original variables.
Solution 1.
du
= − sin(x) ⇒ du = − sin(x) dx.
dx
Step 2: We can now evaluate the integral under this change of variables,
Z Z Z
sin(x) 1
tan(x) dx = dx = − du = − ln |u| + C = − ln | cos(x)| + C.
cos(x) u
Page 1 of 11
June 12, 2019 MAT136 – Week 3 Justin Ko
Solution 2.
2
Step 1: We will use the change of variables u = − x2 ,
du 1
= −x ⇒ du = −x dx, x = 0 → u = 0, x=1→u=− .
dx 2
Step 2: We can now evaluate the integral under this change of variables,
Z Z − 12 u=− 12
−x2 1
xe dx = − eu du = −eu = −e− 2 + 1.
2
0 u=0
Remark: Instead of changing the bounds of integration, we can first find the indefinite integral,
Z
x2 x2
xe− 2 dx = −e− 2 ,
Solution 3.
e − e−x
Z x Z
du
dx = = ln |u| + C
ex + e−x u
= ln |ex + e−x | + C. u = ex + e−x
Since ex + e−x > 0, we can remove the absolute values if we wish giving the final answer
Z
tanh(x) dx = ln(ex + e−x ) + C.
This form of the indefinite integral may be easier to remember since it mirrors the fact that
Z
tan(x) dx = − ln | cos(x)| + C.
Page 2 of 11
June 12, 2019 MAT136 – Week 3 Justin Ko
Solution 4.
Solution 5.
√
Step 1: We will use the change of variables u = x,
du 1 √
= √ ⇒ 2 xdu = dx ⇒ 2u du = dx.
dx 2 x
Step 2: We can now evaluate the integral under this change of variables,
Z Z
1 2u
√ dx = du.
1+ x 1+u
This integral is a bit tricky to compute, so we have to use algebra to simplify it first. Using long
division to first simplify the integrand, we get
Z Z Z
2u u 1
du = 2 du = 2 1 − du
1+u 1+u 1+u
= 2u − 2 ln |1 + u| + C
√ √ √
= 2 x − 2 ln |1 + x| + C. u = x.
Page 3 of 11
June 12, 2019 MAT136 – Week 3 Justin Ko
Step 2: We can now evaluate the integral under this change of variables,
Z Z Z
1 2u 2u
√ dx = √ du = du.
1+ x 1+ u 2 1+u
Solution 6. We first do a trick by multiplying the numerator and denominator by sec(x) + tan(x),
du
= sec(x) tan(x) + sec2 (x) ⇒ du = (sec(x) tan(x) + sec2 (x)) dx.
dx
Step 2: We can now evaluate the integral under this change of variables,
Solution 7.
Page 4 of 11
June 12, 2019 MAT136 – Week 3 Justin Ko
Using the change of variables u = −x on the first integral, for even function f ,
Z −a Z a
f (x) dx = − f (−u) du u = −x, du = −dx, x = 0 → u = 0, x = −a → u = a
0
Z0 a
=− f (u) du f (−x) = f (x)
0
Z a
=− f (x) dx.
0
Using the change of variables u = −x on the first integral, for odd functions f ,
Z −a Z a
f (x) dx = − f (−u) du u = −x, du = −dx, x = 0 → u = 0, x = −a → u = a
0 0
Z a
= f (u) du f (−x) = −f (x)
0
Z a
= f (x) dx.
0
Page 5 of 11
June 12, 2019 MAT136 – Week 3 Justin Ko
Problem 3. (??) Suppose f (x) is even (f (−x) = f (x)). Show that the function
Z x
F (x) = f (t) dt
0
is an odd function.
Solution 3. It suffices to show F (−x) = −F (x). Using the change of variables u = −t,
du = −dt, t = 0 → u = 0, t = −x → u = x
we have
Z −x Z x
F (−x) = f (t) dt = − f (−u) du
0 0
Z x
=− f (u) du f (−u) = f (u)
0
= −F (x).
Problem 4. (??) Suppose f (x) is odd (f (−x) = −f (x)). Show that the function
Z x
F (x) = f (t) dt
a
is an even function.
Solution 4. It suffices to show F (−x) = F (x). Using the change of variables u = −t,
du = −dt, t = a → u = −a, t = −x → u = x
we have
Z −x Z x Z x
F (−x) = f (t) dt = − f (−u) du = f (u) du. f (−u) = −f (u)
a −a −a
It may appear that the last term is not of the same form as the term F (x) because the lower bounds of
integration are different. However, we can split the region of integration and use a change of variables
to conclude that
Z x Z 0 Z x
f (u) du = f (u) du + f (u) du
−a −a 0
Z 0 Z x Z 0 Z 0
=− f (−ũ) dũ + f (u) du ũ = −u, dũ = −du, du → dũ
a 0 −a a
Z 0 Z x
= f (ũ) dũ + f (u) du f (−u) = −f (u)
a 0
Z x
= f (t) dt = F (x).
a
Remark: If we use the result from Problem 2 on Page 5, then we have the shorter proof,
Z −x Z x Z x Z a Z x
F (−x) = f (t) dt = − f (−u) du = f (u) du = f (u) du + f (u) du = F (x).
a −a −a −a a
| {z }
=0
Page 6 of 11
June 12, 2019 MAT136 – Week 3 Justin Ko
2 Integration By Parts
We can think of integration by substitution as the counterpart of the product rule for differentiation.
Suppose that u(x) and v(x) are continuously differentiable functions. Integration by parts is given by
the following formulas:
The integral can be recovered by multiplying diagonally across the rows of the table adding up all
terms with alternating signs. The last term in the table is integrated across.
± D I
+ u v 000
+
− u0 v 00
−
+ u00 v0
+
u000
R
− R v
−
Solution 1.
Page 7 of 11
June 12, 2019 MAT136 – Week 3 Justin Ko
± D I
+ x ex
− 1 ex
ex
R
+ 0
Solution 2.
± D I
+ x6 ex
− 6x5 ex
+ 30x4 ex
− 120x3 ex
+ 360x2 ex
− 720x ex
+ 720 ex
ex
R
− 0
Solution 3.
Page 8 of 11
June 12, 2019 MAT136 – Week 3 Justin Ko
± D I
+ x4 sin x
− 4x3 − cos x
2
+ 12x − sin x
− 24x cos x
+ 24 sin x
R
− 0 − cos x
Step 2: From the table, we have
Z
x4 sin x dx = −x4 cos x + 4x3 sin x + 12x2 cos x − 24x sin x − 24 cos x + C.
Solution 4.
± D I
+ sin x ex
− cos x ex
ex
R
+ − sin x
Step 2: From the table, we have
Z Z
ex sin x dx = ex sin x − ex cos x − ex sin x dx + D.
Moving all the ex sin x dx to one side and simplifying, we can conclude
R
Z Z
x x x 1 1
2 e sin x dx = e sin x − e cos x + D =⇒ ex sin x dx = ex sin x − ex cos x + C.
2 2
Problem 5. (? ? ?) Find Z
xex cos(x) dx.
Solution 5.
± D I
+ x cos x ex
− cos x − x sin x ex
ex
R
+ −2 sin x − x cos x
Page 9 of 11
June 12, 2019 MAT136 – Week 3 Justin Ko
Moving all the xex cos x dx to one side and simplifying, we can conclude
R
Z Z
2 xe cos x dx = xe cos x − e cos x + xe sin x − 2 ex sin x dx
x x x x
Solution 6.
± D I
+ ln(x) 1
1
R
− x x
Step 2: From the table, we have
Z Z
ln(x) dx = x ln(x) − 1 dx = x ln(x) − x + C.
Solution 7.
± D I
+ ln x x3
1 1 4
R
− x 4x
Page 10 of 11
June 12, 2019 MAT136 – Week 3 Justin Ko
Solution 8.
± D I
± D I
+ erf(x) 1
d
R
− dx erf(x) x
2
Since d √2 e−x
dx erf(x) = π
by the fundamental theorem, we have
Z Z
2x 2
erf(x) dx = xerf(x) − √ e−x dx.
π
The second integral can be solved using the substitution u = −x2 , du = −2xdx which gives us
Z Z
1 1 2
erf(x) dx = xerf(x) + √ eu du = xerf(x) + √ · e−x + C.
π π
−x2
Remark: It is easy to check that the xerf(x) + e√π + C is an antiderivative by simply differentiating.
Page 11 of 11