MATH 1231 S2 2010: For use in Dr Chris Tisdell’s lectures

Section 2: Techniques of integration.

Created and compiled by Chris Tisdell

S1: Motivation

S2: What you should already know

S3: of trig functions

S4: Reduction formulae

S5: Trig & hyperbolic substitutions

S6: Partial fractions

S7: Rationalising substitutions

S8: Weierstrass substitutions

S9: Appendix (more on what you should already know) Images from“Thomas’ calculus”by Thomas, Wier, Hass & Giordano, 2008, Pearson Education, Inc. 1 1. Motivation.

Why study integration?

The theory of integration is a cornerstone of calculus. In- tegration finds a useful place in many disciplines, such as: engineering; physics; biology; economics and beyond.

Where are we going?

We will develop a number of important integration techniques that will be useful in the study of applied problems.

Throughout our discussions we will see HOW integration nat- urally arises in the analysis of applied problems and in mod- elling. This is critical to motivate the ideas and also to build the intuition.

2 2. What you should already know.

You studied integration at school and in MATH 1131. You should be comfortable with:

• using a table of integrals

• integrating by inspection

• integration by simple substitution.

Just in case you’ve forgotten these techniques, I have included some examples to refresh your memory and to test your skills in the Appendix.

You will find this course much easier if you can integrate with ease. Your hard work will pay–off later in the session!!

3 4 5 3. Integrals of trig functions.

You should be familiar with:

The above integrals are derived by using the “double angle formulas”:

cos 2x = cos2 x − sin2 x = 2 cos2 x − 1 = 1 − 2 sin2 x and for future reference

sin 2x = 2 sin x cos x.

6 Integrals of products of sin and/or cos.

We first discuss how such integrals naturally arise.

Applications matter! So–called “Fourier ” play an important role in the study of heat flow.

A finite Fourier series of a function f is given by the sum N X f(x) := an sin nx (1) n=1 = a1 sin x + a2 sin 2x + ··· aN sin Nx where the an are some numbers that are to be determined. That is, we aim to write f(x) as a sum of sin functions.

7 We now see how integration of trig functions is central to the method.

We claim that the mth coefficient am is given by 1 Z π am = f(x) sin mx dx. (2) π −π If we multiply both sides of (1) by sin mx and then integrate over [−π, π] we obtain

N Z Z π X f(x) sin mx dx = an sin nx sin mx dx −π n=1 N X Z π  = an sin nx sin mx dx . n=1 −π Thus we have obtained an that involves a product of sin functions.

How do we evaulate such an integral?

8 Integrals of products of sin and/or cos

These are done using the so–called product to sum formulae:

sin A cos B = [sin(A − B) + sin(A + B)]/2 sin A sin B = [cos(A − B) − cos(A + B)]/2 cos A cos B = [cos(A − B) + cos(A + B)]/2 Ex: R sin 4x cos 2x dx =

Independent learning ex: Now return to, and prove, (2).

9 Integrals of the form R cosm x sinn x dx

If m or n are odd then our aim is to transform the integral into one of the types: Z 1 sink x cos x dx = sink+1 x + C k + 1 Z 1 cosk x sin x dx = − cosk+1 x + C. k + 1 At the heart of the approach is to factor out a sin x or cos x from the odd power term and then use the identity

cos2 x + sin2 x = 1 to transform the integral into one which can be directly eva- lutated.

Q: How can you verify the above integrals?

10 Ex. Evaluate Z I := cos4 x sin3 x dx.

11 Ex: Evaluate Z I := cos5 x sin5 x dx

12 If both m and n are even, then the integral is slightly harder. We will see shortly a recursive method for dealing with such an integral, but for smaller values of m and n one can use the identities 1 + cos 2x cos2 x = 2 1 − cos 2x sin2 x = . 2

Ex. Evaluate I := R cos4 x sin2 x dx.

See that Z I = (cos2 x)2 sin2 x dx Z 1 + cos 2x2 1 − cos 2x = dx 2 2 1 Z = 1 + cos 2x − cos2 2x − cos3 2x dx 8 Z = 1 1 + cos 2x − cos2 2x − (1 − sin2 2x) cos 2x dx 8

Z = 1 1 − cos2 2x + sin2 2x cos 2x dx 8 h i = 1 x − 1 sin 4x + 1 sin3 2x + C. 8 2 8 6

13 Applications matter! An important problem in applied math, engineering and physics is to calculate the total mass of an given object. Consider a thin plate occupying the unit quarter–disk in the first quadrant.

If the density δ(x, y) of the plate at any point (x, y) is given by δ(x, y) = x2y4 then the total mass of the plate is given by √ Z 1 "Z 1−x2 # M = x2y4 dy dx. 0 0 To make this integral easier, we switch to polar co–ordinates: x = r cos θ; y = r sin θ; dy dx = r dr dθ with a substitution giving Z π/2 Z 1 M = (r2 cos2 θ)(r4 sin4 θ) rdrdθ 0 0 Z 1 Z π/2 = r7 dr (cos2 θ)(sin4 θ) dθ. 0 0

14 4. Reduction formulae

Repeated integration by parts can be a long process! We can shorten the process by applying so–called “reduction formu- lae”.

Ex: The reduction formula Z 1 Z tann x dx = tann−1 x − tann−2 x dx (∗) n − 1 can be used in an iterative fashion to calcuate Z tan5 x dx

R n If In := tan x dx then (*) may be compactly written as

1 n−1 In := tan x − In−2, n ≥ 2. n − 1

15 R π/2 n Ex. Let In := 0 sin x dx. Use the reduction formula n − 1 In := I 2, n ≥ 2 n n− to calculate I7.

16 Ex: Construct a reduction formula for Z n x In := x e dx.

17 Ex: Find the reduction formula for Z π/2 n In := sin x dx. 0

The reduction formula for the integral of cosn x is similar.

18 Ex: Construct a reduction formulae from Z π/4 n In := sec x dx. 0

A similar method is used to obtain the reduction formula for R π/4 n the integral In := 0 tan x dx. 19 Ex. [Q1, Class Test 1, 2002] Let Z π/4 n In := tan θ sec θ dθ. 0 Show that 1 √  In := 2 − (n − 1)I 2 , for n ≥ 2. n n− Note that d sec θ = sec θ tan θ. dθ

20 A Two parameter recurrence:

Consider Z π/2 m n Im,n = cos x sin x dx 0 Z π/2 = [cosm−1 x][sinn x cos x] dx 0 and use integration by parts. Choose u = cosm−1 x and v0 = sinn x cos x. Thus, 1 u0 = −(m−1) sin x cosm−2 x, v = sinn+1 x. n + 1 Integration by parts then leads to m − 1 Im,n = I 2 , m ≥ 2. m + n m− ,n

In a similar way, one could also obtain the recurrence n − 1 Im,n = I 2. n ≥ 2. m + n m,n− In applying the above formulae we must reach one of I1,1 = 1 π 2,I1,0 = I0,1 = 1 or I0,0 = 2.

You are not expected to memorise this formula.

21 5. Trig & Hyperbolic Substitutions.

You will have already seen integration by simple substitution.

With integrals involving square roots of quadratics, the idea is to make a suitable trigonometric or hyperbolic substitution that greatly simplifies the integral.

22 Integrals involving square roots of quadratics can be worked out using the following trigonometric or hyperbolic substitu- tions.

q a2 − x2 try x = a sin θ

q a2 + x2 try x = a tan θ or x = a sinh θ

q x2 − a2 try x = a sec θ or x = a cosh θ

23 Ex: Evaluate Z 4 q I = x2 16 − x2 dx. 0

24 Ex: Evaluate Z dx I := . (a2 + x2)3/2

25 Ex: Evaluate Z dx I := q x2 x2 − 1 via the substitution x = sec θ

(This last integral can also be done using a cosh θ substi- tution but it is not easy.)

26 Applications matter! An important problem in applied math, engineering and physics is to calculate the total mass of an given object.

Consider a thin wire of constant density δ (mass per unit length) that lies in the XY –plane along the curve

y = f(x) := x2/2, a ≤ x ≤ b. It can be shown that the total mass M of the wire is Z b q M = δ 1 + [f 0(x)]2 dx a Z b q = δ 1 + x2 dx. a q See how an integral of 1 + x2 naturally arises?

27 6. Partial Fractions.

f(x) A rational function is a function of the form where f g(x) and g are polynomials.

Ex: Which of the following are rational functions?

2x + 1 (a) 3x2 − 4

cos x (b) x2 + 1

x2 (c) x − 1

ex (d) . x + 1

For the purpose of integration, we ensure that the degree of the numerator is less than the degree of the denominator. If not then we may need to divide.

28 Building the intuition.

An integral like Z dx x(1 − x) cannot be easily computed directly, however, we know that the integrals Z dx Z dx , x 1 − x can both be directly evaluated.

1 1 Thus, can we write x(1−x) as some linear combination of x 1 and 1−x?

29 30 31 Heaviside proved important results in electromagnetism and . He reduced Maxwell’s 20 equations in 20 variables to 4 equations in 2 variables.

”Mathematics is an experimental science, and definitions do not come first, but later on.“

“Why should I refuse a good dinner simply because I don’t un- derstand the digestive processes involved.” [reply when crit- icised for his daring use of operators before they could be justified formally.]

32 Factors are Linear:

Ex. Evaluate Z 2x − 1 Z 2x − 1 I := dx = dx. x2 + 5x + 6 (x + 3)(x + 2)

33 Ex. Evaluate Z 2x2 + 2x + 6 dx. (x − 1)(x + 1)(x − 2)

34 Repeated Linear Factors:

Ex: Evaluate Z x + 3 I := dx. (x + 2)3

35 In general, each factor in the denominator of the form (x − a)k gives rise to an expression of the form A A A 1 + 2 + ..... + k . x − a (x − a)2 (x − a)k Ex: Evaluate Z dx I := . x(x + 1)3

36 Ex: [Q2, Class Test 1, 2003] Calculate Z 8x + 9 dx. (x − 2)(x + 3)2

37 Irreducible Quadratic Factors:

Suppose the denominator of our rational function is a quadratic which does not factor (over the real numbers). For example, 2x + 1 f(x) = . x2 + 4x + 5

To find the integral of such a function, we manipulate the integrand so that the numerator equals the of the denominator.

This leads to a logarithm and complete the square on the denominator of the remaining term leading to an inverse tan- gent function.

38 Ex: Evaluate Z 2x + 1 I := dx. x2 + 4x + 5

39 (N.B. If the quadratic does have real but irrational roots, one can use this same method to avoid nasty partial fractions. The second factor will then lead to an inverse tanh. e.g. Z 2x + 1 dx x2 + 4x − 6 Z 2x + 4 3 = + dx x2 + 4x − 6 10 − (x + 2)2 3 x + 2! = ln |x2 + 4x − 6| + √ tanh−1 √ + C. 10 10

40 Ex; [Q1, Class Test 1, 2002] Calculate Z x dx. x2 + 2x + 10 You are given that Z du 1 u = tan−1 + C. u2 + a2 a a

41 Combinations of the Rules:

These rules can be combined to cover a variety of situations.

Ex: Calculate Z x + 6 I := dx. x(x2 + 2x + 3)

42 In general, an irreducible quadratic factor

x2 + ax + b in the denominator will give rise to a term of the form Ax + B x2 + ax + b and more generally again, a factor

(x2 + ax + b)k in the denominator will give rise to terms of the form A x + B A x + B A x + B 1 1 + 2 2 +...+ k k . x2 + ax + b (x2 + ax + b)2 (x2 + ax + b)k

43 Ex. Evaluate Z x I := dx. (x + 1)2(x2 + 1)

44 Applications matter! Where does an integral involving partial fractions arise? Let P = P (t) denote the population size of a species at time t. It can be shown that P and dP/dt satisfy the“differential equation” dP  P  = P 1 − (3) dt M where M > 0 is a constant.

The challenge is to determine the unknown function P from (3) and hence predict what will happen to the population over time.

If we rearrange (3) and integrate both sides w.r.t t then we obtain 1 Z 1 dP Z dt = 1dt M P (M − P ) dt which becomes 1 Z dP = t + K. M P (M − P )

45 Applying partial fractions we obtain 1 Z dP 1 Z dP Z dP  = + M P (M − P ) M P M − P which can be integrated to form P = Cet. |M − P | By considering two separate cases M − P > 0 and M − P < 0 we can rearrange, solve for P and plot the following graph.

46 7. Rationalising substitutions

The above methods using partial fractions allow us to inte- grate (in principle) any rational function, so we often make a change of variable in an integral that will lead us to some rational function.

Ex: Evaluate Z dx I := . 1 + x1/4

47 Ex: Calculate Z dx I := q . e2x − 1

48 8. Weierstrass’ substitution.

Weierstrass’ substitution is very useful for integrals involving a rational expression in sin x and/or cos x.

Weierstrass’ substitution is x t = tan . 2

2t 1 − t2 Recall, that sin x = , cos x = , and that 1 + t2 1 + t2 2 dt dx = . 1 + t2

You should know how to derive these formulae. For example, if t = tan x/2 then 2t 2 tan x = 2 2 2 x 1 + t 1 + tan 2 (sin x)/(cos x) = 2 2 2 2 x 2 x 1 + (sin 2)/(cos 2) x x = 2 sin cos 2 2 = sin x.

Who was Weierstrass?? 49 Ex: Calculate Z dx I := . 1 + cos x + sin x .

50 π/2 Ex: Show that I = R dx = √π . 0 2+cos x 3 3

We let t = tan(x/2), so that

1 − t2 cos x = 1 + t2 2 dt dx = 1 + t2 in a similar way to the previous example. Substitution then leads to Z 1 2 I = dt 0 3 + t2 1 " 2 t # = √ tan−1 √ 3 3 0 π = √ . 3 3

51 Applications matter! Where does an integral like Z dθ 1 + cos θ + sin θ arise? Consider a thin plate in the XY –plane that occupies the region (in polars)

1 ≤ r ≤ 2, 0 ≤ θ ≤ π/2. Suppose at each point (x, y) 6= (0, 0) the plate has density function 1 δ(x, y) = q . x2 + y2 + x + y To evaluate the total mass M of the plate we consider  √  Z 1 Z 4−y2 M =  √ δ(x, y) dx dy. 0 1−y2 Now, making substitutions: x = r cos θ; y = r sin θ; dx dy = r dr dθ we obtain Z 2 Z π/2 dθ M = dr . 1 0 1 + cos θ + sin θ

52 9. APPENDIX

MAPLE

The following examples show how to use MAPLE to perform partial fraction decompositions. > convert(x^2/(x+2), parfrac, x);

4 x − 2 + x + 2 > convert(x/(x-b)^2, parfrac, x);

b 1 + (x − b)2 x − b

53 Integration by Parts.

The analysis requires you to:

choose functions f and g0;

then calculate f 0 and g from your above choices;

and then apply the above formula.

Ex: Evaluate I = R xex dx.

We choose f = x and g0 = ex. Thus, f 0 = 1 and g = ex. Using our IBP formula Z Z I = xex dx = xex − 1ex dx = xex − ex + C.

54 Integration by inspection.

When confronted by an integral, you should always see if the integral can be ‘guessed’ and then fine–tuned by multiplying or dividing by a constant.

Alternatively, multiply and divide the integral by a particular constant to put it into a useful form.

Ex: Evaluate R x(x2 + 1)10 dx.

See that x is“almost”the derivative of (x2 + 1).

We make the guess (x2 + 1)11 and then check our guess by evaluating d [(x2+1)11] = 11·2x(x2+1)10 = 22x(x2+1)10. dx See that we have an unwanted 22 in the above. Thus, we divide our initial guess by 22 to obtain our answer Z 1 x(x2 + 1)10 dx = (x2 + 1)11 + C. 22

55 Observe that this method ONLY works for integrals of the form Z f(g(x))g0(x) dx when the derivative g0(x) is present in the integrand up to a constant. Z Z d "− cos6 t# sin t cos5 t dt = dt dt 6 − cos6 t = . 6 The above methods should remind you of the !

Z x4(x3 + 1)10 dx cannot be ‘guessed’ and fine tuned since the derivative of x3 + 1 is not in the integrand.

56 Other useful integrals.

Z 1 −1 x q dx = sin a2 − x2 a

Z 1 −1 x q dx = sinh a2 + x2 a

Z 1 1 x dx = tan−1 a2 + x2 a a

Z 1 1 x dx = tanh−1 a2 − x2 a a

These four should be learnt carefully.

57