67
MATH143 Calculus Lecturer: Dr Alexander Belton ([email protected]) Office: Fylde B12 Syllabus Differentiation Introduction to differentiation using graphical methods. Differentiation from first principles (up to third-order polynomials only). Basic differentiation using formulae. Chain, product and quotient rules. Second-order and higher derivatives. Stationary points and their classification. Parametric, implicit and logarithmic differentiation. Integration The definite integral (as signed area). Indefinite integration (as the process inverse to differentiation). Integration of trigonometric functions using product and double- angle formulae. Integration of rational functions by completing the square and by partial fractions. Integration by parts and by substitution. Applications: arc length of a plane curve; area and centroid of a plane region; surface area, volume and centre of mass of a solid of revolution. Numerical methods The trapezium rule. Simpson’s rule (the derivation is not examinable). The Newton- Raphson method. Further topics Taylor and Maclaurin series; estimation of integrals. L’Hˆ opital’s rule. Recommended text books Either Engineering Mathematics by A. Croft, R. Davison and M. Hargreaves, third edition, 2001, Prentice Hall, ISBN 0 130 26858 5, £39·99. Or Modern Engineering Mathematics by G. James, fourth edition, 2008, Pearson Education Ltd, ISBN 978-0-13-239144-3, £37·99. Lectures and class exercises The notes for this course are complete and, together with the workshop questions and assessed exercises, provide all the information you need – however, you should annotate them with your own notes taken during lectures. Examples are given in the notes but further practice will be gained by working through the class exercises, given on separate sheets, during lecture time. You are expected to attend lectures so that you can participate in and learn from the solution of these additional exercises. 1

MATH143 Calculuspower/MATH143notes-1.pdf · Chain, product and quotient rules. Second-order and higher derivatives. Stationary points and their classification. Parametric, implicit

  • Upload
    others

  • View
    4

  • Download
    0

Embed Size (px)

Citation preview

Page 1: MATH143 Calculuspower/MATH143notes-1.pdf · Chain, product and quotient rules. Second-order and higher derivatives. Stationary points and their classification. Parametric, implicit

MATH143 Calculus

Lecturer: Dr Alexander Belton ([email protected]) Office: Fylde B12

Syllabus

Differentiation

Introduction to differentiation using graphical methods. Differentiation from firstprinciples (up to third-order polynomials only). Basic differentiation using formulae.Chain, product and quotient rules. Second-order and higher derivatives. Stationarypoints and their classification. Parametric, implicit and logarithmic differentiation.

Integration

The definite integral (as signed area). Indefinite integration (as the process inverseto differentiation). Integration of trigonometric functions using product and double-angle formulae. Integration of rational functions by completing the square and bypartial fractions. Integration by parts and by substitution. Applications: arc lengthof a plane curve; area and centroid of a plane region; surface area, volume and centreof mass of a solid of revolution.

Numerical methods

The trapezium rule. Simpson’s rule (the derivation is not examinable). The Newton-Raphson method.

Further topics

Taylor and Maclaurin series; estimation of integrals. L’Hopital’s rule.

Recommended text books

Either Engineering Mathematics by A. Croft, R. Davison and M. Hargreaves, thirdedition, 2001, Prentice Hall, ISBN 0 130 26858 5, £39·99.Or Modern Engineering Mathematics by G. James, fourth edition, 2008, PearsonEducation Ltd, ISBN 978-0-13-239144-3, £37·99.

Lectures and class exercises

The notes for this course are complete and, together with the workshop questionsand assessed exercises, provide all the information you need – however, you shouldannotate them with your own notes taken during lectures. Examples are given inthe notes but further practice will be gained by working through the class exercises,given on separate sheets, during lecture time. You are expected to attend lecturesso that you can participate in and learn from the solution of these additionalexercises.

1

Page 2: MATH143 Calculuspower/MATH143notes-1.pdf · Chain, product and quotient rules. Second-order and higher derivatives. Stationary points and their classification. Parametric, implicit

Learning outcomes

At the end of this module, students should be able to:

(a) use the notation of differentiation and integration correctly;

(b) differentiate simple functions, including powers, the exponential function,trigonometric functions and their inverses;

(c) differentiate sums, products and quotients of functions;

(d) differentiate composite functions;

(e) differentiate implicitly and use this method to differentiate functions ofthe form f(x) = g(x)h(x);

(f) differentiate functions related through a parameter;

(g) integrate basic functions and evaluate these integrals;

(h) integrate simple trigonometric functions using product and double-angleformulae;

(i) integrate rational functions using partial fractions or by completing thesquare;

(j) integrate functions of the formaf ′(x)

f(x)and af ′(x)f(x);

(k) integrate functions using the ‘by parts’ technique;

(l) integrate functions ‘by substitution’, using a change of variable;

(m) recognise the integration technique required for a given function;

(n) find lengths, areas, volumes, centres of mass and similar quantities byusing integration techniques;

(o) find Taylor series and Maclaurin series for functions;

(p) estimate the values of integrals using the trapezium and Simpson’s rulesand using Taylor series;

(q) find numerical solutions of equations using the Newton-Raphson method;

(r) use L’Hopital’s rule to determine limits.

2

Page 3: MATH143 Calculuspower/MATH143notes-1.pdf · Chain, product and quotient rules. Second-order and higher derivatives. Stationary points and their classification. Parametric, implicit

Assessment

20% weekly coursework

40% end-of-module progress test

40% end-of-year examination

You will receive the weekly coursework assignment from your tutor at the Fridayworkshop. These workshops run from 11am until 1pm, with the first hour beingcompulsory for all students.

Please note that MATH143 coursework must be put in the first-yearcoursework pigeonhole no later than 12 NOON WEDNESDAY.

This will be then be given to your tutor. Work received later than this time will notnormally be accepted. Under no circumstances can coursework be accepted after themodel answers are given out at the following workshop. As stated in the first-yearhandbook, if a student has submitted less than 80% of the coursework required, heor she will be deemed not to be in good standing with his or her tutor.

Progress test

The progress test will take place on Thursday in Week 15 in normal lecture time.If a different room is to be used, you will be informed during lectures in Week 15 andthe information will be put on the LUVLE webpage. It is the student’s responsibilityto arrive promptly for this test. If you are ill, a medical certificate must be submittedto the Teaching Office (Engineering A38). If written confirmation of the reasonfor your absence is not received, you will be given a mark of zero.

Examination

The examination will take place towards the end of the Summer Term. You will beinformed by Student Registry, in writing, of the examination times and places. It isthe student’s responsibility to attend these examinations on time unless preventedby ill health.

3

Page 4: MATH143 Calculuspower/MATH143notes-1.pdf · Chain, product and quotient rules. Second-order and higher derivatives. Stationary points and their classification. Parametric, implicit

1 Differentiation 51.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51.2 Limits of functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51.3 Rules for the manipulation of limits . . . . . . . . . . . . . . . . . . . 51.4 Continuity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71.5 Rules for manipulating continuous functions . . . . . . . . . . . . . . 81.6 Basic ideas of differentiation . . . . . . . . . . . . . . . . . . . . . . . 81.7 Differentiation from first principles . . . . . . . . . . . . . . . . . . . 101.8 Rules for differentiation . . . . . . . . . . . . . . . . . . . . . . . . . . 131.9 Second and higher derivatives . . . . . . . . . . . . . . . . . . . . . . 171.10 Stationary points . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181.11 Parametric differentiation . . . . . . . . . . . . . . . . . . . . . . . . 191.12 Implicit differentiation . . . . . . . . . . . . . . . . . . . . . . . . . . 211.13 Logarithmic differentiation . . . . . . . . . . . . . . . . . . . . . . . . 22

2 Integration 242.1 Definite integrals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 242.2 Indefinite integrals . . . . . . . . . . . . . . . . . . . . . . . . . . . . 262.3 The fundamental theorem of calculus . . . . . . . . . . . . . . . . . . 272.4 Elementary integration . . . . . . . . . . . . . . . . . . . . . . . . . . 292.5 Trigonometric identities . . . . . . . . . . . . . . . . . . . . . . . . . 302.6 Partial fractions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 312.7 Completing the square . . . . . . . . . . . . . . . . . . . . . . . . . . 322.8 Piecewise-standard functions . . . . . . . . . . . . . . . . . . . . . . . 332.9 Further methods of integration . . . . . . . . . . . . . . . . . . . . . 332.10 Integration by substitution . . . . . . . . . . . . . . . . . . . . . . . . 362.11 Applications of integration . . . . . . . . . . . . . . . . . . . . . . . . 40

3 Numerical methods 483.1 The trapezium rule . . . . . . . . . . . . . . . . . . . . . . . . . . . . 483.2 Simpson’s rule . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 513.3 The Newton-Raphson method . . . . . . . . . . . . . . . . . . . . . . 55

4 Further topics 584.1 Taylor’s theorem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 584.2 L’Hopital’s rule . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 624.3 The modified Newton-Raphson method . . . . . . . . . . . . . . . . . 64

A The derivation of Simpson’s rule 66

4

Page 5: MATH143 Calculuspower/MATH143notes-1.pdf · Chain, product and quotient rules. Second-order and higher derivatives. Stationary points and their classification. Parametric, implicit

1 Differentiation

1.1 Introduction

Calculus is used in many situations in order to analyse varying quantities. It involvestwo basic operations, differentiation and integration, which are opposite sides of thesame coin. The Greeks developed the rudimentary ideas of integration, Archimedesusing his ‘method of exhaustion’ to obtain an exact formula for the area of a circle.Differentiation was probably first used by Fermat in the 17th century, to determinethe maxima and minima of certain functions. The connection between the twotechniques was developed by Newton and Leibniz, working independently of eachother, as a way of dealing with change and motion; it is the notation developed byLeibniz that is used today. Calculus has many applications throughout science andengineering and provides an essential language: for example, the laws of physics areformulated used calculus.

1.2 Limits of functions

Limits have already appeared in MATH142 for sequences. As these ideas will beused to develop some of the basic formulas for differentiation, we will revisit thistopic briefly.

Definition

A function f(x) is said to approach (or tend to) a limit l as x approaches the value aif we can make the value of f(x) as close as we please to l by taking x sufficientlyclose to a. This is written as

limx→a

f(x) = l or f(x) → l as x→ a.

Note that we do not require that f(a) = l or even that f(a) exists.

1.3 Rules for the manipulation of limits

If f(x) → l and g(x) → m as x→ a then

(i) f(x) + g(x) → l +m as x→ a,

(ii) f(x)g(x) → lm as x→ a

and (iii) if m 6= 0 thenf(x)

g(x)→ l

mas x→ a.

5

Page 6: MATH143 Calculuspower/MATH143notes-1.pdf · Chain, product and quotient rules. Second-order and higher derivatives. Stationary points and their classification. Parametric, implicit

Examples

1. Evaluate limx→0

3x2 + 5x3 − 2x4

2x2 + x3.

The rules for limits show that the denominator 2x2 + x3 → 0 as x → 0, sorule (iii) cannot be applied directly to this quotient. However, if we divide thenumerator and denominator by the lowest power of x which appears (here, x2)then, as x→ 0, the rules for limits apply and

limx→0

3x2 + 5x3 − 2x4

2x2 + x3= lim

x→0

3 + 5x− 2x2

2 + x=

3 + 0− 0

2 + 0=

3

2.

2. Evaluate limx→∞

3x2 + 4x− 2

5x2 − x+ 6.

Here, neither the numerator nor denominator converge as x → ∞; they bothgrow without limit. However, if we divide the numerator and denominator bythe highest power of x which appears then, as x → ∞, the individual termswill each tend to a limit. In this case, dividing by x2 gives

limx→∞

3x2 + 4x− 2

5x2 − x+ 6= lim

x→∞

3 + 4x− 2

x2

5− 1x+ 6

x2

=3 + 0− 0

5− 0 + 0=

3

5.

3. Evaluate limx→0

sin x

x. (As always, x is in radians.)

The series expansion for sin x is

sin x = x− x3

3!+x5

5!− · · · ,

sosin x

x= 1− x2

3!+x4

5!− · · · → 1

as x → 0. Strictly speaking, this working isn’t covered by the rules for limits,because there are infinitely many terms in the series. However, this argumentcan be made valid; you should remember this limit as a fact.

6

Page 7: MATH143 Calculuspower/MATH143notes-1.pdf · Chain, product and quotient rules. Second-order and higher derivatives. Stationary points and their classification. Parametric, implicit

1.4 Continuity

Definition

The function f(x), defined at and around the point a, is said to be continuous at aif f(x) → f(a) as x→ a.

(Informally, the function f(x) is continuous at a if we can draw its graph around awithout lifting the pencil from the paper.)

A function is continuous if it is continuous at every point where it is defined.

Continuous functions include polynomials, such as x3 − 3x + 1, the exponentialfunction and the sine and cosine functions.

The function

f(x) =

{

1/x if x 6= 0,

0 if x = 0

is discontinuous (i.e., not continuous) at x = 0. (See Figure 1.)

–4

–3

–2

–1

0

1

2

3

4

–4 –3 –2 –1 1 2 3 4

x

f(x)

Figure 1: The graph of the function f(x)

7

Page 8: MATH143 Calculuspower/MATH143notes-1.pdf · Chain, product and quotient rules. Second-order and higher derivatives. Stationary points and their classification. Parametric, implicit

1.5 Rules for manipulating continuous functions

If f(x) and g(x) are continuous at a then so are

(i) kf(x), where k is a constant,

(ii) the sum f(x) + g(x)

(iii) the product f(x)g(x) and

(iv) the quotient f(x)/g(x), as long as g(a) 6= 0.

If g(x) is continuous at a and f(x) is continuous at g(a) then

(v) the composite function f(g(x)) is continuous at a.

1.6 Basic ideas of differentiation

Differentiation is a means of measuring a ‘rate of change’. This can be the rate ofchange of y with respect to x, i.e., the ‘slope’ of the graph y = f(x), or the rate ofchange of a variable with respect to time, temperature et cetera.

0

1

2

3

4

5

s

1 2 3 4t

Figure 2: s = ut

One way to think about the meaning of differentiation is to consider an object movingin a straight line, with constant velocity ums−1. The distance s metres travelled bythe object in t seconds is given by the formula

s = ut.

The graph of distance s against time t is a straight line (see Figure 2) and u is thegradient of this line.

8

Page 9: MATH143 Calculuspower/MATH143notes-1.pdf · Chain, product and quotient rules. Second-order and higher derivatives. Stationary points and their classification. Parametric, implicit

If the velocity varies with time (as in Figure 3) then the average velocity over thedistance travelled between time t0 and time t1 is

s(t1)− s(t0)

t1 − t0,

which is the gradient of the straight line between(

t0, s(t0))

and(

t1, s(t1))

.

0

1

2

3

4

5

6

s

1 2 3 4 5t

(

t0, s(t0))

(

t1, s(t1))

Figure 3: s = f(t)

If we put t1 = t0 + δt and s(t1) = s(t0) + δs then the gradient equals

s(t1)− s(t0)

t1 − t0=δs

δt.

If we now let t1 → t0 (equivalently, δt→ 0) then this quotient tends to the gradientof the tangent line to the graph at the point

(

t0, s(t0))

.

This process of passing from the function s(t) to the gradient of the tangent is calleddifferentiation and it measures the rate of change of s(t) with respect to t. Thegradient function is called the derivative of the function s(t).

9

Page 10: MATH143 Calculuspower/MATH143notes-1.pdf · Chain, product and quotient rules. Second-order and higher derivatives. Stationary points and their classification. Parametric, implicit

Definition

The derivative of a function f(x) at the point x, written f ′(x) ordf

dx, is

limδx→0

f(x+ δx)− f(x)

δx= lim

δx→0

δf

δx.

(Informally, the derivative of a function f(x) at the point x is the gradient of thetangent to the curve y = f(x) at the point

(

x, f(x))

.)

This limit will not exist at x if

(a) f(x) is not continuous at x or

(b) the graph of f(x) has a ‘corner’ at x.

(Informally, a function is differentiable at x if its graph is continuous and ‘smooth’at and near to x.) We are not going to dwell on this possibility.

1.7 Differentiation from first principles

Examples

1. If f(x) = c, where c is a constant, then f(x+ δx) = c and

f ′(x) = limδx→0

f(x+ δx)− f(x)

δx= lim

δx→0

c− c

δx= lim

δx→00 = 0.

As the derivative is the gradient of the tangent to the curve, this result shouldseem fairly obvious: the graph is, in this case, a horizontal line. Alternatively,it should be clear that the rate of change of a constant is zero.

2. If f(x) = bx, where b is a constant, then

f(x+ δx) = b(x+ δx) = bx+ b δx

and

f ′(x) = limδx→0

f(x+ δx)− f(x)

δx

= limδx→0

bx+ b δx− bx

δx= lim

δx→0

b δx

δx= lim

δx→0b = b.

Again, this makes sense: the equation of a straight line through the origin isy = mx, with m the gradient of that line. The derivative of a function is thegradient of the tangent to the graph of that function, so for a straight line thederivative is a constant, the line’s gradient.

10

Page 11: MATH143 Calculuspower/MATH143notes-1.pdf · Chain, product and quotient rules. Second-order and higher derivatives. Stationary points and their classification. Parametric, implicit

3. If f(x) = ax2, where a is a constant, then

f(x+ δx) = a(x+ δx)2 = ax2 + 2ax δx+ a(δx)2

so

f ′(x) = limδx→0

f(x+ δx)− f(x)

δx

= limδx→0

ax2 + 2ax δx+ a(δx)2 − ax2

δx

= limδx→0

2ax δx+ a(δx)2

δx= lim

δx→0(2ax+ a δx)

= 2ax.

4. Combining the working from Examples 1, 2 and 3, we can see that

d

dx(ax2 + bx+ c) = 2ax+ b.

In general, if y = xn (where n can be any number, integer or otherwise) then,using the binomial theorem, it may be shown that

dy

dx= nxn−1.

5. Find, from first principles, the derivative of f(x) = ex.

From the definition,

f ′(x) = limδx→0

e(x+δx) − ex

δx= lim

δx→0

ex(eδx − 1)

δx.

The series expansion of eδx is

eδx = 1 + δx+(δx)2

2!+

(δx)3

3!+

(δx)4

4!+ · · ·

and therefore

f ′(x) = ex limδx→0

(1 + δx+ (δx)2

2!+ (δx)3

3!+ · · · − 1)

δx

= ex limδx→0

(

1 +δx

2!+

(δx)2

3!+ · · ·

)

= ex.

11

Page 12: MATH143 Calculuspower/MATH143notes-1.pdf · Chain, product and quotient rules. Second-order and higher derivatives. Stationary points and their classification. Parametric, implicit

(As for Example 3 in Section 1.3, this last step isn’t properly justified by therules for limits above, but this argument can be made rigorous and gives theright answer.)

6. Find the derivatives of the functions f(x) = sin x and g(x) = cosx from firstprinciples.

Using the trigonometric identity

sinA− sinB = 2 cosA+B

2sin

A− B

2

with A = x+ δx and B = x, we have

f ′(x) = limδx→0

sin(x+ δx)− sin x

δx= lim

δx→0

cos(x+ 12δx) sin(1

2δx)

12δx

.

By Example 3 in Section 1.3 (and the fact that cosx is continuous) it followsthat

f ′(x) = limδx→0

cos(x+1

2δx) lim

δx→0

sin(12δx)

12δx

= (cosx)× 1 = cos x.

To differentiate the function g(x) = cosx from first principles, we use thetrigonometric identity

cosA− cosB = −2 sinA+B

2sin

A− B

2

with A = x+ δx and B = x, which implies that

g′(x) = limδx→0

cos(x+ δx)− cosx

δx

= limδx→0

− sin(x+ 12δx) sin(1

2δx)

12δx

= − limδx→0

sin(x+1

2δx) lim

δx→0

sin(12δx)

12δx

= − sin x.

Note

There are three ways of thinking of the derivative: (i) using its definition, as a limit;(ii) graphically, as the gradient of the tangent to the graph or (iii) kinematically, asthe rate of change of one variable with respect to another. Each of these should bekept in mind; choosing the most appropriate one may help when solving a problem.

12

Page 13: MATH143 Calculuspower/MATH143notes-1.pdf · Chain, product and quotient rules. Second-order and higher derivatives. Stationary points and their classification. Parametric, implicit

1.8 Rules for differentiation

Scalar-multiplication rule

If y = f(x) and k is a constant then

d

dx(ky) = k

dy

dx= kf ′(x).

Sum rule

If y = f(x) and z = g(x) then

d

dx(y + z) =

dy

dx+

dz

dx= f ′(x) + g′(x).

Composite (‘chain’) rule

If y = f(z) and z = g(x) then y = f(g(x)) and

dy

dx=

dy

dz

dz

dx= f ′(z)g′(x).

Examples

1. If y = x6 + 3x4 − x2 + 1 then

dy

dx= 6x5 + 12x3 − 2x.

The first two rules (for scalar multiples and sums) are summed up by sayingthat differentiation is linear. Linearity, together with Example 4 in Section 1.7,means that we can differentiate any polynomial.

2. If y = e√x then y = ez, where z = x1/2. The chain rule states that

dy

dx=

dy

dz

dz

dx,

sody

dx=

d

dzez

d

dxx1/2 = ez × 1

2x−1/2 =

e√x

2√x.

3. If f(x) = sinh x = 12(ex − e−x) then, by linearity and the chain rule,

f ′(x) =ex − (−e−x)

2=ex + e−x

2= cosh x.

13

Page 14: MATH143 Calculuspower/MATH143notes-1.pdf · Chain, product and quotient rules. Second-order and higher derivatives. Stationary points and their classification. Parametric, implicit

4. If f(x) = cosh x = 12(ex + e−x) then

f ′(x) =ex + (−e−x)

2=ex − e−x

2= sinh x.

So far we have been dealing with functions involving x and y. Whatever lettersthe variables are labelled with, the rules remain the same.

5. Differentiate the following functions with respect to the appropriate variable.

(i) 15t− 10t2 (ii) sin(

5θ +π

3

)

(iii) ecoshω

(i)d

dt(15t− 10t2) = 15− 20t.

(ii) If s = sin(

5θ + π3

)

and z = 5θ + π3then s = sin z and

ds

dθ=

ds

dz

dz

dθ= (cos z)× 5 = 5 cos

(

5θ +π

3

)

.

(iii) Let p = ecoshω and q = coshω, so that p = eq and

dp

dω=

dp

dq

dq

dω= eq × sinhω = ecoshω sinhω.

6. Evaluate the derivative of ln cos θ when θ = π/4.

Let y = ln cos θ and z = cos θ, so that y = ln z and

d

dθ(ln cos θ) =

dy

dθ=

dy

dz

dz

dθ=

1

z(− sin θ) = − sin θ

cos θ= − tan θ.

(We will show in Example 1 on p.16 thatd

dzln z =

1

z.) Hence the derivative

of ln cos θ at θ = π/4 is − tan(π/4) = −1.

7. Consider the function f(x) = 3x2 − 7x+ 1. Find

(i) the derivative of f(x),

(ii) the gradient of f(x) at x = 2 and

(iii) the equation of the tangent to y = f(x) at the point where x = 2.

14

Page 15: MATH143 Calculuspower/MATH143notes-1.pdf · Chain, product and quotient rules. Second-order and higher derivatives. Stationary points and their classification. Parametric, implicit

(i) The derivative f ′(x) = 6x− 7.

(ii) The gradient of f(x) at x = 2 is therefore f ′(2) = 6(2)− 7 = 5.

(iii) The tangent is a straight line, so is described by the equation y = mx+ c.

The constant m is the gradient at x = 2, which is 5.

The tangent passes through the point(

2, f(2))

and

f(2) = 3(2)2 − 7(2) + 1 = −1.

Hence y = −1 when x = 2, so −1 = 5(2) + c and c = −11.

Thus the equation of the tangent line at x = 2 is y = 5x− 11.

Product rule

If y = f(x) and z = g(x) then

d

dx(yz) =

dy

dxz + y

dz

dx= f ′(x)g(x) + f(x)g′(x).

Quotient rule

If y = f(x) and z = g(x) then

d

dx

(y

z

)

=dydxz − y dz

dx

z2=f ′(x)g(x)− f(x)g′(x)

g(x)2.

Examples

1. If y = x3 sin x then

dy

dx=

d

dx(x3) sin x+ x3

d

dx(sin x) = 3x2 sin x+ x3 cos x.

2. If s = et√t then

ds

dt=

d

dt(et)t1/2 + et

d

dt(t1/2) = ett1/2 + et

(

1

2t−1/2

)

= et(√

t+1

2√t

)

.

3. If y = ln x sin x then

dy

dx=

d

dx(ln x) sin x+ ln x

d

dx(sin x) =

1

xsin x+ lnx cos x

=sin x

x+ lnx cos x.

15

Page 16: MATH143 Calculuspower/MATH143notes-1.pdf · Chain, product and quotient rules. Second-order and higher derivatives. Stationary points and their classification. Parametric, implicit

4. If y =x+ 1

x2 + 3then

dy

dx=

(

ddx(x+ 1)

)

(x2 + 3)− (x+ 1) ddx(x2 + 3)

(x2 + 3)2

=(1)(x2 + 3)− (x+ 1)(2x)

(x2 + 3)2

=x2 + 3− 2x2 − 2x

(x2 + 3)2

=3− 2x− x2

(x2 + 3)2.

5. If T = tan θ =sin θ

cos θthen

dT

dθ=

(

ddθ

sin θ)

cos θ − sin θ ddθ

cos θ

cos2 θ=

cos2 θ + sin2 θ

cos2 θ=

1

cos2 θ= sec2 θ.

Inverse-function rule

If y = f−1(x) then x = f(

f−1(x))

= f(y). From the chain rule we have

1 =dx

dx=

dx

dy

dy

dx, so

dy

dx= 1

/

dx

dy=

1

f ′(y).

Examples

1. If y = ln x then x = ey anddx

dy= ey, so

dy

dx=

1

ey=

1

elnx=

1

x.

(This is one of the standard derivatives listed on p.6 of the Data Book.)

2. If y = sin−1 x then x = sin y anddx

dy= cos y, so

dy

dx=

1

cos y=

1√

1− sin2 y=

1√1− x2

.

(Since cos2 x+ sin2 x = 1, we know that cos y = ±√

1− sin2 y, but which signdo we take? As sin−1 x is increasing – draw a sketch to convince yourself ofthis – it has positive gradient, so we take the positive square root.)

16

Page 17: MATH143 Calculuspower/MATH143notes-1.pdf · Chain, product and quotient rules. Second-order and higher derivatives. Stationary points and their classification. Parametric, implicit

3. If y = cos−1 x then x = cos y anddx

dy= − sin y, so

dy

dx=

1

− sin y=

−1√

1− cos2 y=

−1√1− x2

.

(Again, the positive root is chosen to give the right sign: the function cos−1 xis decreasing.)

4. If y = tanh−1 x then x = tanh y anddx

dy= sech2 y, so (using the fact that

sech2 y = 1− tanh2 y)

dy

dx=

1

sech2 y=

1

1− tanh2 y=

1

1− x2.

1.9 Second and higher derivatives

Definition

The second derivative of y = f(x), denoted byd2y

dx2or f ′′(x), is defined to be the

derivative of the first derivativedy

dx= f ′(x). In other words,

d2y

dx2=

d

dx

(

dy

dx

)

.

We can extend this to third, fourth and higher derivatives. In general, these are

written asdny

dxnor f (n)(x), where n is often written in Roman numerals in the latter

case: we have

f(x), f ′(x), f ′′(x), f ′′′(x), f (iv)(x), f (v)(x) and so on.

Examples

1. If f(x) = x3 − sin x then

f ′(x) = 3x2 − cos x,

f ′′(x) = 6x+ sin x,

f ′′′(x) = 6 + cosx,

f (iv)(x) = − sin x,

f (v)(x) = − cosx

et cetera.

17

Page 18: MATH143 Calculuspower/MATH143notes-1.pdf · Chain, product and quotient rules. Second-order and higher derivatives. Stationary points and their classification. Parametric, implicit

2. A projectile is thrown with an initial vertical component of velocity 30ms−1.If the vertical height above the ground, s metres, is given by

s = 1·7 + 30t− 4·9t2,

find the time at which the projectile is at a maximum height above the groundand hence determine this maximum height. Calculate the acceleration of theprojectile.

The maximum height is achieved when the velocity v =ds

dtis zero, that is,

when the rate of change of distance with respect to time is zero. Thus

0 =ds

dt= 30− 9·8t

and the maximum height is achieved at time

t =30

9·8 = 3·06 (2 d.p.).

At this time,

s = 1·7 + 30(3·06)− 4·9(3·06)2 = 47.6 (1 d.p.),

so the maximum height achieved by the projectile is 47·6 metres (to one decimalplace).

Acceleration is the rate of change of velocity with respect to time, so this is

a =dv

dt=

d2s

dt2= −9·8.

Note that the acceleration is the same for any time t here. This is accelerationdue to the force of gravity acting toward the earth. Note also that, from theshape of the graph of s, it must have a maximum value and not a minimum.

1.10 Stationary points

If the derivative f ′(x) > 0 then the gradient of the function f(x) is positive, so thefunction is increasing; if f ′(x) < 0 then f has negative gradient, so the function isdecreasing.

Points where the derivative of a function is zero are called stationary points : theyare where the rate of change of the function is zero.

18

Page 19: MATH143 Calculuspower/MATH143notes-1.pdf · Chain, product and quotient rules. Second-order and higher derivatives. Stationary points and their classification. Parametric, implicit

The second derivative can give us information on stationary points. Let x0 be astationary point for the function f(x), so that f ′(x0) = 0, and suppose f ′′(x0) > 0.

As f ′′(x0) is the gradient of f ′(x) at x0, the derivative f ′(x) has positive gradient,so is increasing, near x0. Hence f

′(x) must be negative to the left of x0 and positiveto the right of x0 (since f ′(x0) = 0). So the function f(x) is decreasing to the left ofx0 and increasing to the right of x0: the value f(x0) is a local minimum.

Similarly, if f ′′(x0) < 0 then the derivative f ′(x) is decreasing near x0, so the valuef(x0) is a local maximum.

In Example 2 on p.18,d2s

dt2= −9·8 < 0, so the height found there is a maximum (as

we have already seen).

If f ′′(x0) = 0 then the second derivative tells us nothing and we need to look directlyat the behaviour of f ′(x) for x near the stationary point.

Example

Find and classify the stationary points of the function y = x3.

Sincedy

dx= 3x2 = 0 ⇐⇒ x = 0,

the function has one stationary point, at x = 0. The second derivative

d2y

dx2= 6x,

which is zero at x = 0, so this tells us nothing about the nature of the stationary

point. Sincedy

dx> 0 if x 6= 0, the function y is increasing and x = 0 is neither a local

maximum nor a local minimum. (This should also be clear to you from a sketch ofthe function.)

1.11 Parametric differentiation

A curve may sometimes be expressed parametrically as x = g(t), y = h(t) ratherthan in the form y = f(x). For example,

(x, y) = (t2, 2t) (t > 0)

gives the curve y2 = 4x: a parabola.

19

Page 20: MATH143 Calculuspower/MATH143notes-1.pdf · Chain, product and quotient rules. Second-order and higher derivatives. Stationary points and their classification. Parametric, implicit

In these circumstances we can use the chain rule to find the gradientdy

dx: note that

dy

dx=

dy

dt

dt

dx=

dy

dt

/

dx

dt.

The second derivative needs more care; in general,

d2y

dx26= d2y

dt2

/

d2x

dt2.

Instead, using the chain rule again, we have that

d2y

dx2=

d

dx

(dy

dx

)

=

(

d

dt

(dy

dx

)

)

dt

dx.

Examples

1. For the curve given parametrically by x = t2−1, y = t3−t, we see that dxdt

= 2t

anddy

dt= 3t2 − 1, so

dy

dx=

3t2 − 1

2t=

3

2t− 1

2t.

The second derivative is

d2y

dx2=

(

d

dt

(3

2t− 1

2t−1)

)

1

2t=(3

2+

1

2t−2) 1

2t=

3

4t+

1

4t3.

2. Consider the curve given parametrically by x = cos3 t, y = sin3 t; in this case,

dx

dt= −3 cos2 t sin t and

dy

dt= 3 sin2 t cos t.

Hencedy

dx=

3 sin2 t cos t

−3 cos2 t sin t= − sin t

cos t= − tan t

and

d2y

dx2=( d

dt(− tan t)

)( 1

−3 cos2 t sin t

)

=− sec2 t

−3 cos2 t sin t=

1

3 cos4 t sin t.

(Remember that sec t = 1/ cos t.)

20

Page 21: MATH143 Calculuspower/MATH143notes-1.pdf · Chain, product and quotient rules. Second-order and higher derivatives. Stationary points and their classification. Parametric, implicit

1.12 Implicit differentiation

Sometimes y is not defined explicitly as a function of x or in terms of a parameter,but is merely related to x by means of an equation. For example, the circle withradius 2 and centre (0, 0) is given by the familiar formula

x2 + y2 = 4.

In this situation we treat y as an unknown function of x, differentiate both sides of

the equation with respect to x and then solve to find the derivativedy

dx.

To help with this we have the chain rule, which tells us that

d

dx

(

g(y))

=d

dy

(

g(y))dy

dx= g′(y)

dy

dx.

Examples

1. If x2 + y2 = 4 thend

dx(x2) +

d

dx(y2) =

d

dx(4) = 0,

so 2x+ 2ydy

dx= 0 and

dy

dx= −x

y.

2. Consider the ellipse given by the equation x2+ xy+ y2 = 3. Find the equationof the tangent to the ellipse at the point (1, 1).

The tangent at (1, 1) is a straight line with general equation y = mx + c; the

gradient m equals the value ofdy

dxwhen x = y = 1. Differentiating implicitly,

we haved

dx

(

x2 + xy + y2) =d

dx(3) = 0

and, noting that xy is a product, this implies that

2x+

(

y + xdy

dx

)

+ 2ydy

dx= 0, so (x+ 2y)

dy

dx= −2x− y.

Hencedy

dx= −2x+ y

x+ 2yand m = −2 + 1

1 + 2= −1.

To find c, note that the tangent passes through the point (1, 1), so 1 = −1 + cand c = 2. The equation of the tangent is therefore y = 2− x.

21

Page 22: MATH143 Calculuspower/MATH143notes-1.pdf · Chain, product and quotient rules. Second-order and higher derivatives. Stationary points and their classification. Parametric, implicit

3. For the ellipse of Example 2, findd2y

dx2.

Differentiating both sides of the equation

2x+ xdy

dx+ y + 2y

dy

dx= 0

implicitly with respect to x, noting that xdy

dxand 2y

dy

dxare products, we have

2 +

(

dy

dx+ x

d2y

dx2

)

+dy

dx+

(

2

(

dy

dx

)2

+ 2yd2y

dx2

)

= 0.

Hence

(x+ 2y)d2y

dx2= −2 − 2

dy

dx− 2

(

dy

dx

)2

andd2y

dx2= −2

(

1 + dydx

+ (dydx)2

x+ 2y

)

= −2

(

1− 2x+yx+2y

+ (2x+yx+2y

)2

x+ 2y

)

.

Multiplying the numerator and denominator of this last quantity by (x+2y)2,we see that

d2y

dx2= −2

(

(x+ 2y)2 − (2x+ y)(x+ 2y) + (2x+ y)2

(x+ 2y)3

)

= −2

(

x2 + 4xy + 4y2 − 2x2 − 4xy − xy − 2y2 + 4x2 + 4xy + y2

(x+ 2y)3

)

= −2

(

3(x2 + xy + y2)

(x+ 2y)3

)

.

Finally, the original equation tells us that x2 + xy + y2 = 3, so

d2y

dx2=

−18

(x+ 2y)3.

1.13 Logarithmic differentiation

A neat trick, known as logarithmic differentiation, can be used to find the derivativeof expressions of the form y = f(x)g(x). The idea is to take the natural logarithmsof both sides and then differentiate with respect to x.

22

Page 23: MATH143 Calculuspower/MATH143notes-1.pdf · Chain, product and quotient rules. Second-order and higher derivatives. Stationary points and their classification. Parametric, implicit

Note first that if y = ln(

h(x))

then, by the chain rule,

dy

dx=h′(x)

h(x). (⋆)

Example

If y = (cosh x)x thenln y = ln

(

(cosh x)x)

= x ln cosh x.

Differentiating both sides with respect to x (using the chain rule and noting thatx ln cosh x is a product) gives that

1

y

dy

dx= ln cosh x+ x

d

dx(ln cosh x) = ln cosh x+ x

(

sinh x

cosh x

)

,

sody

dx= y(ln cosh x+ x tanh x) = (cosh x)x(ln cosh x+ x tanh x).

This technique can also be used to simplify expressions which contain products,quotients and composite functions.

Example

Finddy

dxif y =

4√sin 2x

(x+ 1)2(3x− 1).

First, take logarithms of both sides:

ln y = ln 4 +1

2ln sin 2x− 2 ln(x+ 1)− ln(3x− 1).

Differentiating with respect to x, using the observation (⋆) above and noting thatln 4 is a constant, we see that

1

y

dy

dx=

cos 2x

sin 2x− 2

x+ 1− 3

3x− 1.

Rearranging and replacing y by its definition as a function of x, we see that

dy

dx=

4√sin 2x

(x+ 1)2(3x− 1)

(

cot 2x− 2

x+ 1− 3

3x− 1

)

.

23

Page 24: MATH143 Calculuspower/MATH143notes-1.pdf · Chain, product and quotient rules. Second-order and higher derivatives. Stationary points and their classification. Parametric, implicit

2 Integration

2.1 Definite integrals

Definition

Let f(x) be a function on the interval [a, b], where a < b; in other words, f(x) isdefined for all values of x from x = a to x = b inclusive. Informally, we define thedefinite integral of f(x) from a to b, denoted by

∫ b

a

f(x) dx,

to be the area under the graph of y = f(x) between x = a and x = b. More precisely,we mean the area between y = f(x) and the x-axis, with the area below the x-axiscounting as negative. We also define

∫ a

b

f(x) dx = −∫ b

a

f(x) dx

and∫ a

a

f(x) dx = 0.

We call the function being integrated, f(x), the integrand of the integral, dx thedifferential of x and the points a and b the limits of integration. Think of theintegral sign

(a stretched ‘S’, for ‘sum’) and the differential dx as brackets aroundthe integrand – they must always appear together. The x in dx tells us the name ofthe variable we are integrating over.

Examples

1. Find

∫ b

a

c dx, where c is constant.

The graph of y = c is a horizontal straight line, and the (positive) rectangulararea between this line and the x-axis is either (b− a)c (if c > 0) or (b− a)(−c)(if c < 0). As area below the x-axis counts as negative, we see that, in bothcases,

∫ b

a

c dx = (b− a)c.

24

Page 25: MATH143 Calculuspower/MATH143notes-1.pdf · Chain, product and quotient rules. Second-order and higher derivatives. Stationary points and their classification. Parametric, implicit

B

A

–4

–2

0

2

4

6

1 2 3 4 5

y

x

Figure 4: y = 2x− 4

2. Calculate

∫ 5

0

(2x− 4) dx.

In Figure 4, area A = 12× 2 × 4 = 4 and area B = 1

2× 3 × 6 = 9. Since A is

below the x-axis, its area counts as negative, so

∫ 5

0

(2x− 4) dx = 9− 4 = 5.

For more complicated functions, the area is found (and the integral is defined) bytaking the limit of the approximations we obtain by dividing the area into rectangularstrips, each of width δx, and then letting δx → 0. (See Figure 5.)

0

1

2

3

4

5

6

7

1 2 3 4x

y

Figure 5: y = 12x(x− 1)(x− 31

10) + 2

25

Page 26: MATH143 Calculuspower/MATH143notes-1.pdf · Chain, product and quotient rules. Second-order and higher derivatives. Stationary points and their classification. Parametric, implicit

Ifa = x0 < a+ δx = x1 < a+ 2δx = x2 < · · · < xn = b

and the height of each rectangle is 12

(

f(xi−1) + f(xi))

for i = 1, 2, 3, · · · , n (given nsuch rectangles) then the approximate area is equal to

n∑

i=1

1

2

(

f(xi−1) + f(xi))

δx.

As δx→ 0,n∑

i=1

1

2

(

f(xi−1) + f(xi))

δx→∫ b

a

f(x) dx.

This concept (the integral as the limit of certain sums) will come in useful later forsome of the applications of integration. As with differentiation, however, we willgenerally not work from first principles.

2.2 Indefinite integrals

Definition

The function F (x) is an indefinite integral for the continuous function f(x) if F (x)is differentiable and F ′(x) = f(x), in which case we write

f(x) dx = F (x) + c,

where c is the constant of integration.

Here there are no limits of integration. A function, the indefinite integral F (x),is the result of indefinite integration, rather than a number (the area) for definiteintegration.

Example

Sinced

dxtanx = sec2 x, the function tan x is an indefinite integral for sec2 x and

sec2 x dx = tan x+ c.

The Fundamental Theorem of Calculus gives the link between indefinite and definiteintegrals. It is what allows us to calculate definite integrals simply by recognisingderivatives, and without having to find the areas of lots of rectangles.

26

Page 27: MATH143 Calculuspower/MATH143notes-1.pdf · Chain, product and quotient rules. Second-order and higher derivatives. Stationary points and their classification. Parametric, implicit

2.3 The fundamental theorem of calculus

Theorem (FTC)

If F (x) is an indefinite integral for the continuous function f(x), so that F ′(x) = f(x),then the definite integral

∫ b

a

f(x) dx =

[

F (x)

]b

a

= F (b)− F (a).

(The square-bracket notation is just shorthand for the final quantity.)

Put simply, this means that to integrate, we need only recognise the integrand as aderivative.

The constant of integration

The Fundamental Theorem of Calculus means that integration can be regarded as

the inverse process to differentiation. We know thatd

dx(x2) = 2x, so x2 is one choice

for the indefinite integral∫

2x dx.

However, differentiating x2 + 3 or x2 − 7 also results in 2x, since differentiatinga constant gives zero, so these three functions are all equally good choices for anindefinite integral of 2x. All we can say is

2x dx = x2 + c;

a constant of integration must be included with the indefinite integral.

If F (x) and G(x) are both indefinite integrals for f(x) then

d

dx

(

F (x)−G(x))

=d

dxF (x)− d

dxG(x) = f(x)− f(x) = 0,

so F (x)−G(x) is an indefinite integral for the zero function. By the FTC,

0 =

∫ b

a

0 dx =(

G(b)− F (b))

−(

G(a)− F (a))

and rearranging this shows that G(b)−G(a) = F (b)− F (a). Hence any two choicesof indefinite integral for f(x) differ at most by a constant, and all choices give the

same value for the definite integral

∫ b

a

f(x) dx.

27

Page 28: MATH143 Calculuspower/MATH143notes-1.pdf · Chain, product and quotient rules. Second-order and higher derivatives. Stationary points and their classification. Parametric, implicit

Examples

1. Find the indefinite integrals of (a) xn (when n 6= −1), (b)1

xand (c) sin x.

(a) We haved

dx(xn+1) = (n+ 1)xn, so

d

dx

(

1

n+ 1xn+1

)

= xn.

Hence

xn dx =1

n+ 1xn+1 + c.

(b) For x > 0 we know thatd

dx(ln x) =

1

x. On the other hand, for x < 0 we

haved

dx

(

ln(−x))

= − 1

−x =1

x.

Hence

1

xdx = ln x+ c1 if x > 0 and

1

xdx = ln(−x) + c2 if x < 0. Thus

1

xdx = ln |x|+ c.

(c) We know that

d

dx(− cosx) = − d

dxcos x = −(− sin x) = sin x

and therefore

sin x dx = − cos x+ c.

2. Calculate

∫ 4

2

x2 dx.

From 1(a),

x2 dx =1

2 + 1x2+1 + c =

1

3x3 + c. Therefore, by the FTC,

∫ 4

2

x2 dx =

[

1

3x3 + c

]4

2

=

(

1

343 + c

)

−(

1

323 + c

)

=64− 8

3=

56

3.

Note that the constant of integration always cancels out, so we can ignore cwhen finding a definite integral.

28

Page 29: MATH143 Calculuspower/MATH143notes-1.pdf · Chain, product and quotient rules. Second-order and higher derivatives. Stationary points and their classification. Parametric, implicit

2.4 Elementary integration

Rules of integration

(a) Scalar-multiplication rule

If k is a constant then

kf(x) dx = k

f(x) dx.

(b) Sum rule∫

(

f(x) + g(x))

dx =

f(x) dx+

g(x) dx.

Hence integration, like differentiation, is linear.

(c) Linear-composite rule

If a and b are constants and F ′(x) = f(x) then∫

f(ax+ b) dx =1

aF (ax+ b) + c.

This is a special case of integration by substitution, which we will meet later.To see why it is true, we use the chain rule: let y = ax+ b and note that

d

dx

(1

aF (ax+ b)

)

=1

a

dF

dy

dy

dx=

1

aF ′(y)a = f(ax+ b),

as required.

Examples

1. Find

(6x3 + 15x2 + 2 sin x) dx.

We have that∫

(6x3 + 15x2 + 2 sinx) dx

= 6

x3 dx+ 15

x2 dx+ 2

sin x dx by (a) and (b)

= 61

4x4 + 15

1

3x3 + 2

sin x dx by Example 1 on p.28

=3

2x4 + 5x3 − 2 cosx+ c by the FTC.

Note that we only need one constant of integration.

29

Page 30: MATH143 Calculuspower/MATH143notes-1.pdf · Chain, product and quotient rules. Second-order and higher derivatives. Stationary points and their classification. Parametric, implicit

2. Find

(1 + 7x)3/2 dx.

Since

y3/2 dy =2

5y5/2 + c, the linear-composite rule (c) shows that

(1 + 7x)3/2 dx =1

7× 2

5(1 + 7x)5/2 + c =

2

35(1 + 7x)5/2 + c.

3. Find

(2 sin 3θ − 3 cos 5θ) dθ.

The FTC implies that

sinψ dψ = − cosψ + c1 and

cosψ dψ = − sinψ + c2.

Hence∫

(2 sin 3θ − 3 cos 5θ) dθ = 2

sin 3θ dθ − 3

cos 5θ dθ by (a) and (b)

= 2× 1

3(− cos 3θ)− 3× 1

5(sin 5θ) + c by (c)

= −2

3cos 3θ − 3

5sin 5θ + c.

Integration is inherently more difficult than differentiation. Whereas methodicallyapplying various rules allows us to differentiate most reasonable functions, the sameis not true for integration. Indeed, some fairly elementary functions such as

√sin x

have no elementary function as their integral, and numerical methods are required.Much of the practice of integration involves using certain techniques, some of whichare given below.

2.5 Trigonometric identities

Examples

1. Since sinα sin β = 12

(

cos(α− β)− cos(α + β))

,

sin 4x sin 3x dx =1

2

(cosx− cos 7x) dx =1

2sin x− 1

14sin 7x+ c.

30

Page 31: MATH143 Calculuspower/MATH143notes-1.pdf · Chain, product and quotient rules. Second-order and higher derivatives. Stationary points and their classification. Parametric, implicit

2. Since cos 2x = 2 cos2 x− 1, it follows that∫ π/2

0

cos2 x dx =

∫ π/2

0

1

2(1 + cos 2x) dx

=1

2

[

x+1

2sin 2x

]π/2

0

=

(

π

4+

1

4sin π

)

−(

0 +1

4sin 0

)

4.

2.6 Partial fractions

This method is used to integrate rational functions: these are functions that can bewritten as the quotient of two polynomials.

1. Find

5x− 4

x2 − 8x+ 12dx.

Note first that5x− 4

x2 − 8x+ 12=

5x− 4

(x− 6)(x− 2)=

13

2(x− 6)− 3

2(x− 2), so

5x− 4

x2 − 8x+ 12dx =

13

2

1

x− 6dx− 3

2

1

x− 2dx

=13

2ln |x− 6| − 3

2ln |x− 2|+ c.

2. Find

4x+ 3

(x− 3)2dx.

Since4x+ 3

(x− 3)2=

15

(x− 3)2+

4

x− 3,

it follows that∫

4x+ 3

(x− 3)2dx = 15

1

(x− 3)2dx+ 4

1

x− 3dx =

−15

x− 3+ 4 ln |x− 3|+ c.

3. Find

1

1− x2dx.

As1

1− x2=

1

2(1− x)+

1

2(1 + x), we see that

1

1− x2dx =

1

2

1

1− xdx+

1

2

1

1 + xdx

= −1

2ln |1− x|+ 1

2ln |1 + x|+ c =

1

2ln

1 + x

1− x

+ c.

31

Page 32: MATH143 Calculuspower/MATH143notes-1.pdf · Chain, product and quotient rules. Second-order and higher derivatives. Stationary points and their classification. Parametric, implicit

2.7 Completing the square

Any integral of the form

1

ax2 + bx+ cdx or

1√ax2 + bx+ c

dx,

where a 6= 0, can, by completing the square, be transformed into one of the formsgiven in the table of standard integrals on p.6 of the Data Book.

Examples

1. Find

1

x2 + 4x+ 7dx.

Completing the square gives

x2 + 4x+ 7 = (x+ 2)2 + 3 = 3

(

1 +(x+ 2√

3

)2)

,

so∫

1

x2 + 4x+ 7dx =

1

3

1

1 +(

(x+ 2)/√3)2 dx

=1

√3 tan−1

(

x+ 2√3

)

+ c =1√3tan−1

(

x+ 2√3

)

+ c.

2. Find

1√

x(1 + x)dx.

Completing the square gives

x(1 + x) = x+ x2 =(

x+1

2

)2 − 1

4=

1

4

(

(2x+ 1)2 − 1)

.

Hence∫

1√

x(1 + x)dx =

√4

1√

(2x+ 1)2 − 1dx

= 2× 1

2cosh−1(2x+ 1) + c = cosh−1(2x+ 1) + c.

32

Page 33: MATH143 Calculuspower/MATH143notes-1.pdf · Chain, product and quotient rules. Second-order and higher derivatives. Stationary points and their classification. Parametric, implicit

2.8 Piecewise-standard functions

The observation that∫ b

a

f(x) dx =

∫ c

a

f(x) dx+

∫ b

c

f(x) dx

whenever a < c < b allows us to integrate piecewise-standard functions, i.e., functionswhich are made up by ‘gluing together’ standard functions on subintervals.

Example

Evaluate

∫ 2

−1

|x3| dx.

Noting that |x3| = x3 if x > 0 and |x3| = −x3 if x 6 0, it follows that

∫ 2

−1

|x3| dx =

∫ 0

−1

(−x3) dx+∫ 2

0

x3 dx

=1

4

([

−x4]0

−1+[

x4]2

0

)

=1

4(0− (−1) + 24 − 0) =

17

4.

This idea will be useful when studying Fourier Series in MATH145.

2.9 Further methods of integration

Integration by parts

There is no simple ‘product rule’ for integration. However, the product rule fordifferentiation,

d

dx(uv) = u

dv

dx+ v

du

dx

can be rearranged to give

udv

dx=

d

dx(uv)− v

du

dx.

Integrating with respect to x and using the FTC, we see that∫

udv

dxdx = uv −

vdu

dxdx.

If the function to be integrated can be expressed as udv

dxfor suitable functions u

and v then we can apply this formula, called ‘integration by parts’. The trick is tochoose a function u which gets simpler when differentiated.

33

Page 34: MATH143 Calculuspower/MATH143notes-1.pdf · Chain, product and quotient rules. Second-order and higher derivatives. Stationary points and their classification. Parametric, implicit

Examples

1. Find

xex dx.

Put u = x and v = ex, so thatdv

dx= ex and

du

dx= 1. Then

xex dx =

udv

dxdx

= uv −∫

vdu

dxdx = xex −

ex dx = xex − ex + c.

By choosing u = x, the integrand vdu

dx= ex is a function we know how to

integrate. Sometimes getting to this stage requires more than one applicationof the formula.

2. Find

x2 sin x dx.

Here we take u = x2 and v = − cos x. (If we choose u = sin x then the integrand

vdu

dx=

1

3x3 cosx is more complicated.) Then

du

dx= 2x and

x2 sin x dx = −x2 cosx+ 2

x cosx dx.

Using integration by parts again, on this new integral (taking u = x andv = sin x) we see that

x2 sin x dx = −x2 cos x+ 2x sin x− 2

sin x dx

= −x2 cos x+ 2x sin x+ 2 cosx+ c.

3. Find

x3 ln x dx.

Put u = ln x and v =1

4x4, so that

du

dx=

1

xand

dv

dx= x3. Then

x3 ln x dx =1

4x4 lnx− 1

4

x41

xdx

=1

4x4 lnx− 1

4

x3 dx =1

4x4 ln x− 1

16x4 + c.

34

Page 35: MATH143 Calculuspower/MATH143notes-1.pdf · Chain, product and quotient rules. Second-order and higher derivatives. Stationary points and their classification. Parametric, implicit

In the examples above, the integrand was made simpler until it could be recognisedas the derivative of something. When dealing with a product involving functionssuch as eax, sin x and cosx, the integrand may not simplify. However, we may beable to integrate by parts twice, return to something very like the original and hencedetermine our integral. An example will explain this idea.

Example

Evaluate I =

∫ π/4

0

e5x sin 2x dx.

If u = e5x and v = −12cos 2x then

du

dx= 5e5x and

dv

dx= sin 2x, so integration by

parts shows that

I =

∫ π/4

0

e5x sin 2x dx =

[

−1

2e5x cos 2x

]π/4

0

+5

2

∫ π/4

0

e5x cos 2x dx

=

(

−1

2e5π/4 cos

π

2+

1

2e0 cos 0

)

+5

2

∫ π/4

0

e5x cos 2x dx

=1

2+

5

2

∫ π/4

0

e5x cos 2x dx.

Now put u = e5x and v = 12sin 2x, so

du

dx= 5e5x,

dv

dx= cos 2x and integrating by

parts once more gives that

I =1

2+

5

2

(

[

1

2e5x sin 2x

]π/4

0

− 5

2

∫ π/4

0

e5x sin 2x dx

)

=1

2+

5

2

(

1

2e5π/4 sin

π

2− 1

2e0 sin 0− 5

2I

)

=1

2+

5

4e5π/4 − 25

4I.

Hence29

4I =

1

2+

5

4e5π/4

and therefore

I =4

29

(

1

2+

5

4e5π/4

)

= 8·8197 (4 d.p.).

35

Page 36: MATH143 Calculuspower/MATH143notes-1.pdf · Chain, product and quotient rules. Second-order and higher derivatives. Stationary points and their classification. Parametric, implicit

2.10 Integration by substitution

This technique is a consequence of the chain rule for differentiation. Let F (x) be anindefinite integral for f(x) and let y = g(x). By the chain rule,

d

dxF(

g(x))

= F ′(

g(x))

g′(x) = f(y)dy

dx.

The FTC implies that∫

f(y) dy = F (y) + c = F(

g(x))

+ c =

f(y)dy

dxdx

and we have the following change-of-variable formula:∫

f(y) dy =

f(y)dy

dxdx.

Some examples will show how this works in practice; recall thatdx

dy= 1

/ dy

dx.

Examples

1. To find I1 =

x2√5 + x3 dx, put t = 5 + x3, so that

dt

dx= 3x2 and

I1 =

x2√tdx

dtdt =

1

3

∫ √t dt =

2

9t3/2 + c =

2

9(5 + x3)3/2 + c.

2. To find I2 =

x+ 2

x2 + 4x+ 7dx, put t = x2 + 4x+ 7, so that

dt

dx= 2x+ 4 and

I2 =

x+ 2

t

dx

dtdt =

1

2

1

tdt =

1

2ln |t|+ c =

1

2ln |x2 + 4x+ 7|+ c.

3. To find I3 =

tan3 x dx, put t = tan x, so thatdt

dx= sec2 x = 1 + t2 and

I3 =

t3dx

dtdt =

t3

1 + t2dt

=

(

t− t

1 + t2

)

dt

=1

2t2 − 1

2ln(1 + t2) + c =

1

2tan2 x+ ln | cosx| + c.

36

Page 37: MATH143 Calculuspower/MATH143notes-1.pdf · Chain, product and quotient rules. Second-order and higher derivatives. Stationary points and their classification. Parametric, implicit

Often the integrand is not of a form which permits a straightforward use of thetechnique. A substitution is made which we hope will lead to a simplification.

Example

To find

1

x+√2− x

dx, we try to get rid of the square root by putting t =√2− x.

Then t2 = 2− x, so x = 2− t2 anddx

dt= −2t. Hence

dx

x+√2− x

=

1

2− t2 + t

dx

dtdt

=

2t

(t− 2)(t+ 1)dt

=

4

3(t− 2)+

2

3(t+ 1)dt

=4

3ln |t− 2|+ 2

3ln |t+ 1|+ c

=4

3ln |

√2− x− 2|+ 2

3ln |

√2− x+ 1|+ c.

When applying substitution to definite integrals we do not need to substitute backto get the answer in terms of the original variable. Instead we modify the limits ofintegration.

Examples

1. Show that I1 =

∫ 7

2

1

(x+ 1)√x+ 2

dx = ln(3/2).

Put t =√x+ 2 and note that

dt

dx=

1

2√x+ 2

=1

2t. As x increases from 2

to 7, t increases from 2 to 3, so

I1 =

∫ 3

2

1

(t2 − 1)t

dx

dtdt = 2

∫ 3

2

1

t2 − 1dt =

∫ 3

2

( 1

t− 1− 1

t+ 1

)

dt

=[

ln(t− 1)− ln(t+ 1)]3

2

= ln 2− ln 4− ln 1 + ln 3

= ln(3/2)

= 0·4055 (4 d.p.).

37

Page 38: MATH143 Calculuspower/MATH143notes-1.pdf · Chain, product and quotient rules. Second-order and higher derivatives. Stationary points and their classification. Parametric, implicit

2. Evaluate I2 =

∫ 3/2

0

x2√9− x2

dx.

Put x = 3 sin θ, so thatdx

dθ= 3 cos θ and

√9− x2 =

9− 9 sin2 θ = 3√

1− sin2 θ = ±3 cos θ.

To get the range of integration from x = 0 to x = 3/2, we take θ = 0 toθ = sin−1(1/2) = π/6. Then cos θ is positive on this interval, so

I2 =

∫ π/6

0

9 sin2 θ

3 cos θ

dx

dθdθ =

∫ π/6

0

3 sin2 θ

cos θ3 cos θ dθ = 9

∫ π/6

0

sin2 θ dθ.

Now,

∫ π/6

0

sin2 θ dθ =1

2

∫ π/6

0

(1− cos 2θ) dθ

=1

2

[

θ − 1

2sin 2θ

]π/6

0

=1

2

(

π

6− 1

2sin

π

3+

1

2sin 0

)

=1

2

(

π

6− 1

2

√3

2

)

and therefore I2 =3π

4− 9

√3

8= 0·4076 (4 d.p.).

3. Evaluate I3 =

∫ π/4

0

1

cos2 x+ 9 sin2 xdx.

Put t = tanx, so thatdt

dx= sec2 x and as x goes from 0 to π/4, the variable t

goes from 0 to 1. Then

I3 =

∫ 1

0

1

cos2 x+ 9 sin2 x

dx

dtdt

=

∫ 1

0

cos2 x

cos2 x+ 9 sin2 xdt =

∫ 1

0

1

1 + 9t2dt =

[1

3tan−1(3t)

]1

0=

1

3tan−1 3,

which equals 0·4163 (4 d.p.). (The penultimate equality follows from the linear-composite rule.)

38

Page 39: MATH143 Calculuspower/MATH143notes-1.pdf · Chain, product and quotient rules. Second-order and higher derivatives. Stationary points and their classification. Parametric, implicit

Inverse-function rule

Integration by parts and by substitution combine to give the following formula.

If y = f−1(x), so that x = f(y), then∫

f−1(x) dx = xy −∫

f(y) dy.

(To see where this comes from, note that∫

y dx =

1× y dx = xy −∫

xdy

dxdx = xy −

x dy.

The trick of writing the integrand g(x) as 1× g(x) and then integrating by parts canbe useful in other situations.)

Examples

1. If y = ln x then x = ey and∫

ln x dx = xy −∫

ey dy = xy − ey + c = x ln x− x+ c.

2. If y = sin−1 x then x = sin y and∫

sin−1 x dx = xy −∫

sin y dy

= x sin−1 x+ cos y + c

= x sin−1 x+

1− sin2 y + c

= x sin−1 x+√1− x2 + c.

(We take the positive square root because cos y > 0 when −π/2 6 y 6 π/2,which is the range of values taken by sin−1.)

3. If y = sinh−1 x then x = sinh y and∫

sinh−1 x dx = xy −∫

sinh y dy

= x sinh−1 x− cosh y + c

= x sinh−1 x−√

1 + sinh2 y + c = x sinh−1 x−√1 + x2 + c.

(Since cosh y > 0 for all y, we take the positive square root.)

39

Page 40: MATH143 Calculuspower/MATH143notes-1.pdf · Chain, product and quotient rules. Second-order and higher derivatives. Stationary points and their classification. Parametric, implicit

2.11 Applications of integration

Arc length of a curve

The length along the curve y = f(x) between x = a and x = b is equal to

s =

∫ b

a

1 +

(

dy

dx

)2

dx ≈∑

1 +

(

δy

δx

)2

δx =∑

(δx)2 + (δy)2.

Example

Find the length of the parabola y = x2 between x = 0 and x = 1.

From the formula given above,

s =

∫ 1

0

1 + (2x)2 dx =

∫ 1

0

√1 + 4x2 dx.

Putting x = 12sinh u, we have

dx

du= 1

2cosh u and

√1 + 4x2 =

1 + sinh2 u = cosh u.

When x = 0, u = sinh−1 0 = 0 and when x = 1, u = sinh−1 2, so

s =

∫ sinh−1 2

0

cosh udx

dudu

=1

2

∫ sinh−1 2

0

cosh2 u du

=1

4

∫ sinh−1 2

0

(1 + cosh 2u) du

=1

4

[

u+sinh 2u

2

]sinh−1 2

0

(⋆)

=1

4

[

u+ sinh u cosh u]sinh−1 2

0

=1

4

[

u+ sinh u√

1 + sinh2 u]sinh−1 2

0

=1

4

(

sinh−1 2 + 2√1 + 22 − 0− 0

)

=

√5

2+

1

4sinh−1 2 = 1·4789 (4 d.p.).

(You could use your calculator to find the answer once you reach (⋆).)

40

Page 41: MATH143 Calculuspower/MATH143notes-1.pdf · Chain, product and quotient rules. Second-order and higher derivatives. Stationary points and their classification. Parametric, implicit

Area of a plane region

Suppose f(x) and g(x) are continuous functions and f(x) > g(x) as x ranges overthe interval [a, b], i.e., for all x such that a 6 x 6 b. The area of the plane regionbetween the graphs of f(x) and g(x) and the lines x = a and x = b is equal to

A =

∫ b

a

(

f(x)− g(x))

dx =

∫ x=b

x=a

∫ y=f(x)

y=g(x)

dy dx ≈∑∑

δx δy.

(Draw a picture to convince yourself of this.)

Example

Find the area enclosed by the curves y = sec2 x and y = sin x between x = 0 andx = π/4.

0

0.5

1

1.5

2

0.1 0.2 0.3 0.4 0.5 0.6 0.7

x

y

y = g(x)

y = f(x)

Figure 6: f(x) = sec2 x, g(x) = sin x

Note that sec2 x > 1 > sin x for 0 6 x 6 π/4, as required, so the area

A =

∫ π/4

0

(sec2 x− sin x) dx =[

tan x+ cosx]π/4

0

= tanπ

4+ cos

π

4− tan 0− cos 0

= 1 +1√2− 0− 1

=1√2= 0·7071 (4 d.p.).

41

Page 42: MATH143 Calculuspower/MATH143notes-1.pdf · Chain, product and quotient rules. Second-order and higher derivatives. Stationary points and their classification. Parametric, implicit

Centroid of a plane area

As above, let f(x) and g(x) be continuous functions such that f(x) > g(x) on [a, b]and consider the same plane region, that bounded by the curves y = f(x), y = g(x),x = a and x = b, which has area A.

The centroid of this region has coordinates (x, y) given by

x =1

A

∫ b

a

x(

f(x)− g(x))

dx =1

A

∫ x=b

x=a

∫ y=f(x)

y=g(x)

x dy dx ≈ 1

A

∑∑

x δx δy

and

y =1

2A

∫ b

a

(f(x)2 − g(x)2) dx =1

A

∫ x=b

x=a

∫ y=f(x)

y=g(x)

y dy dx ≈ 1

A

∑∑

y δx δy.

In the special case where the lower curve is the x-axis (i.e., g(x) = 0) we have

A =

∫ b

a

f(x) dx, x =1

A

∫ b

a

xf(x) dx and y =1

2A

∫ b

a

f(x)2 dx.

If the region is made out of a thin material of uniform density then the centroid isits centre of mass. The centre of mass r of a finite number of particles is equal totheir average position, weighted by their masses: r =

imiri/∑

imi; analogously,the coordinates of the centroid are given by the integrals of position times density.

Example

Find the coordinates of the centroid of the region enclosed by the parabola y = x2−xand the line y = x. (See Figure 7.)

–1

0

1

2

3

4

5

6

–1 1 2 3x

y

y = g(x)

y = f(x)

Figure 7: f(x) = x, g(x) = x2 − x

42

Page 43: MATH143 Calculuspower/MATH143notes-1.pdf · Chain, product and quotient rules. Second-order and higher derivatives. Stationary points and their classification. Parametric, implicit

The two curves intersect when

x2 − x = x ⇐⇒ x2 − 2x = 0 ⇐⇒ x(x− 2) = 0 ⇐⇒ x = 0 or 2.

In between x = 0 and x = 2 we have x > x2 − x, so we take

f(x) = x and g(x) = x2 − x.

Then

A =

∫ 2

0

(2x− x2) dx =

[

x2 − x3

3

]2

0

= 4− 8

3− 0 + 0 =

4

3,

so

x =1

A

∫ 2

0

x(2x− x2) dx =3

4

[

2x3

3− x4

4

]2

0

=3

4

(

16

3− 4− 0 + 0

)

= 1

and

y =1

2A

∫ 2

0

(x2 − (x2 − x)2) dx =3

8

∫ 2

0

(x2 − x4 + 2x3 − x2) dx

=3

8

[

−1

5x5 +

1

2x4]2

0

=3

8

(

−32

5+ 8− 0 + 0

)

=3

5.

The coordinates of the centroid are therefore (1, 3/5).

Area of a surface of revolution

A surface of revolution is obtained by rotating the curve y = f(x) (from x = a tox = b) through 2π radians about the x-axis, where f(x) > 0 for a 6 x 6 b. Itssurface area S is given by the following formula:

S = 2π

∫ b

a

y

1 +

(

dy

dx

)2

dx

=

∫ θ=2π

θ=0

∫ x=b

x=a

y

1 +

(

dy

dx

)2

dx dθ ≈∑∑

(δx)2 + (δy)2 y δθ.

If θ is the angle through which the curve is rotated then a small patch of the surfacewill have width y δθ and length δs =

(δx)2 + (δy)2, so area δs y δθ.

43

Page 44: MATH143 Calculuspower/MATH143notes-1.pdf · Chain, product and quotient rules. Second-order and higher derivatives. Stationary points and their classification. Parametric, implicit

Examples

1. Find the surface area of the part of the sphere x2 + y2 + z2 = r2 which isenclosed by the planes x = a and x = b, where −r 6 a < b 6 r.

The sphere may be obtained by rotating y =√r2 − x2 about the x-axis. On

this curve we have y2 = r2−x2, and differentiating with respect to x gives that

2ydy

dx= −2x ⇐⇒ dy

dx= −x

y.

Hence

S = 2π

∫ b

a

y

1 +x2

y2dx = 2π

∫ b

a

y2 + x2 dx = 2π

∫ b

a

r dx = 2πr(b− a).

2. Find the surface area of the surface of revolution obtained by rotating aboutthe x-axis the curve y = ex from x = 0 to x = ln 3.

–10

–5

0

5

10–10

–5

5

100.5

1

1.5

2

2.5

x

y

z

Figure 8: The surface of revolution obtained by rotating y = ex

From the formula,

S = 2π

∫ ln 3

0

y

1 +

(

dy

dx

)2

dx = 2π

∫ ln 3

0

y√

1 + y2 dx

= 2π

∫ 3

1

y√

1 + y2dx

dydy = 2π

∫ 3

1

1 + y2 dy.

44

Page 45: MATH143 Calculuspower/MATH143notes-1.pdf · Chain, product and quotient rules. Second-order and higher derivatives. Stationary points and their classification. Parametric, implicit

Using the substitution u = sinh−1 y and noting thatdy

du= cosh u, we have

S = 2π

∫ sinh−1 3

sinh−1 1

1 + sinh2 udy

dudu = 2π

∫ sinh−1 3

sinh−1 1

cosh2 u du

= π

∫ sinh−1 3

sinh−1 1

(1 + cosh 2u) du

= π

[

u+1

2sinh 2u

]sinh−1 3

sinh−1 1

= 28·3048 (4 d.p.).

Volume of a solid of revolution

A solid of revolution is obtained by rotating about the x-axis the area beneath thecurve y = f(x), where x ranges over the interval [a, b] and f(x) > 0 for all such x.Its volume V is given by the formula

V = π

∫ b

a

f(x)2 dx =

∫ 2π

θ=0

∫ x=b

x=a

∫ f(x)

y=0

y dy dx dθ ≈∑∑∑

δx δy y δθ.

If θ is the angle through which the curve is rotated, a small piece of V will havelength δx, height δy and width y δθ.

Examples

1. Find the volume of the solid of revolution obtained by rotating the area belowthe parabola y = 2− x2 and above the x-axis.

–2

–1

0

1

2

–2 –1 1 2x

y

Figure 9: The parabola y = 2− x2

45

Page 46: MATH143 Calculuspower/MATH143notes-1.pdf · Chain, product and quotient rules. Second-order and higher derivatives. Stationary points and their classification. Parametric, implicit

The parabola y = 2 − x2 crosses the x-axis at 2 − x2 = 0, so when x = ±√2,

and lies above the x-axis in between. Hence

V = π

√2

−√2

(2− x2)2 dx = π

√2

−√2

(4− 4x2 + x4) dx

= π

[

4x− 4

3x3 +

x5

5

]

√2

−√2

= π

(

4√2− 4

32√2 +

4√2

5+ 4

√2− 4

32√2 +

4√2

5

)

=64√2π

15= 18·9563 (4 d.p.).

2. A sphere of radius r is obtained by rotating the curve y =√r2 − x2 about the

x-axis, where −r 6 x 6 r. Show that its volume V = 4πr3/3.

From the formula above,

V = π

∫ r

−r

(r2 − x2) dx = π

[

r2x− x3

3

]r

−r

= π(

r3 − r3

3+ r3 − r3

3

)

=4πr3

3,

as required.

Centre of mass of a solid of revolution

A solid of revolution is obtained as above, by rotating about the x-axis the areabeneath the curve y = f(x), with x ranging from a to b and f(x) > 0. Its centre ofmass lies on the x-axis (i.e., has y and z coordinates y = z = 0) and has x coordinate

x =π

V

∫ b

a

xf(x)2 dx =1

V

∫ 2π

θ=0

∫ b

x=a

x

∫ f(x)

y=0

y dy dx dθ ≈ 1

V

∑∑∑

x δx δy y δθ.

As for the centroid, the coordinates of the centre of mass are given by integratingposition times density. As the solid is symmetrical about the x-z and x-y planes, theintegrals for y and z will both be zero.

46

Page 47: MATH143 Calculuspower/MATH143notes-1.pdf · Chain, product and quotient rules. Second-order and higher derivatives. Stationary points and their classification. Parametric, implicit

Example

The area enclosed by the curve y = (3x + 1)1/4, the x-axis, the y-axis and the linex = 5 is rotated through 2π radians about the x-axis. Calculate the x coordinate ofthe centre of mass of the resulting solid of revolution.

–2

–1

0

1

2–2

–1

1

21

2

3

4

5

x

y

z

Figure 10: The solid of revolution obtained from y = (3x+ 1)1/4

From the formula above,

V = π

∫ 5

0

(

(3x+ 1)1/4)2

dx = π

∫ 5

0

(3x+ 1)1/2 dx

= π

[

2

9(3x+ 1)3/2

]5

0

=2π

9(163/2 − 13/2) = 14π.

Hence

x =π

V

∫ 5

0

xf(x)2 dx =1

14

∫ 5

0

x(3x+ 1)1/2 dx.

Using integration by parts with u = x and v =2

9(3x+ 1)3/2, we have

x =1

14

(

[

2

9x(3x+ 1)3/2

]5

0

− 2

9

∫ 5

0

(3x+ 1)3/2 dx

)

=1

63

(

320−[

2

15(3x+ 1)5/2

]5

0

)

=320

63− 2

63

1023

15=

102

35= 2·9143 (4 d.p.).

47

Page 48: MATH143 Calculuspower/MATH143notes-1.pdf · Chain, product and quotient rules. Second-order and higher derivatives. Stationary points and their classification. Parametric, implicit

3 Numerical methods

3.1 The trapezium rule

In practical situations, functions often cannot be integrated analytically (in termsof familiar functions, as above). We have to resort to numerical methods to obtainanswers with the desired degree of accuracy.

0

0.5

1

1.5

2

2.5

3

3.5

1 2 3 4

x

y

Figure 11: The trapezium rule

To find an approximate value for

∫ b

a

f(x) dx, first subdivide the interval from a to binto n equal subintervals:

a = x0 < x1 < x2 < · · · < xn−1 < xn = b,

with xi = xi−1 + h for i = 1, . . . , n and h = (b − a)/n. We approximate the areabeneath the graph between xi−1 and xi by the area Ai of a trapezium:

Ai =12

(

f(xi−1) + f(xi))

h.

48

Page 49: MATH143 Calculuspower/MATH143notes-1.pdf · Chain, product and quotient rules. Second-order and higher derivatives. Stationary points and their classification. Parametric, implicit

Adding these, we see that

∫ b

a

f(x) dx ≈n∑

i=1

Ai

=h

2

(

(

f(x0) + f(x1))

+(

f(x1) + f(x2))

+ · · ·+(

f(xn−1) + f(xn))

)

=h

2

(

f(x0) + 2f(x1) + 2f(x2) + · · ·+ 2f(xn−1) + f(xn))

= T (h).

This is the trapezium-rule approximation to

∫ b

a

f(x) dx using n strips of width h.

Example

Use the trapezium rule with 4 strips to find an approximation for I =

∫ 5

1

e−√x dx.

Work to 3 s.f.

As h = (5 − 1)/4 = 1, the strips have end points 1 < 2 < 3 < 4 < 5. Lettingf(x) = e−

√x, we see that

I ≈ T (1) =1

2

(

f(1) + 2f(2) + 2f(3) + 2f(4) + f(5))

= 0·793 (3 s.f.).

This is reasonably close to the actual value of I, which is 0·780 to 3 s.f.

Successive bisection

Often we do not know how many strips to use at first, so we repeat the process,increasing the number of strips until two successive answers agree to the requiredaccuracy. We can save a great deal of work if we successively halve the width (i.e.,double the number of strips by splitting each strip in half) since if n is even then

T (h) =h

2

(

f(x0) + 2f(x1) + 2f(x2) + · · ·+ 2f(xn−1) + f(xn))

=h

2

(

2f(x1) + 2f(x3) + · · ·+ 2f(xn−1))

+h

2

(

f(x0) + 2f(x2) + 2f(x4) + · · ·+ 2f(xn−2) + f(xn))

= h(

f(x1) + f(x3) + · · ·+ f(xn−1))

+1

2T (2h).

To understand this formula, let us see it in action.

49

Page 50: MATH143 Calculuspower/MATH143notes-1.pdf · Chain, product and quotient rules. Second-order and higher derivatives. Stationary points and their classification. Parametric, implicit

Example

Use the trapezium rule to estimate I =

∫ 20

4

1

x2 − 1dx accurate to 1 d.p.

If f(x) =1

x2 − 1then, recording our working accurate to 6 decimal places (for later),

1 strip with end points 4 < 20 gives

T (16) =h

2

(

f(x0) + f(x1))

=16

2

(

f(4) + f(20))

= 8(0·066667 + 0·002506) = 0·553383.

2 strips with end points 4 < 12 < 20 give

T (8) = 8f(12) +1

2T (16) = 8(0·006993) + 1

20·553383 = 0·332636.

(To get this figure, we add h = 8 times the new ordinate, f(12), to half the previousanswer, T (16).)

4 strips with end points 4 < 8 < 12 < 16 < 20 give

T (4) = 4(

f(8) + f(16))

+1

2T (8)

= 4(

0·015873 + 0·003922) + 1

20·332636 = 0·245496.

(Again, we add h = 4 times the sum of the new ordinates, f(8) and f(16), to halfthe previous answer, T (8).)

8 strips with end points 4 < 6 < 8 < 10 < 12 < 14 < 16 < 18 < 20 give

T (2) = 2(

f(6) + f(10) + f(14) + f(18))

+1

2T (4)

= 2(

0·028571 + 0·010101 + 0·005128 + 0·003096)

+1

20·245496

= 0·216541.(Once more, we add h = 2 times the sum of the new ordinates to half the previousanswer.) As T (4) and T (2) agree sufficiently, I = 0·2 to 1 d.p.

In this case, we can find I exactly. Since x2 − 1 = (x − 1)(x + 1), it is an exerciseusing partial fractions to show that

∫ 20

4

1

x2 − 1dx =

1

2

[

lnx− 1

x+ 1

]20

4

=1

2ln

95

63= 0·205371 (6 d.p.).

50

Page 51: MATH143 Calculuspower/MATH143notes-1.pdf · Chain, product and quotient rules. Second-order and higher derivatives. Stationary points and their classification. Parametric, implicit

The error

If we tabulate the estimates T (h) and the errors

ǫT (h) = T (h)−∫ 20

4

dx

x2 − 1= T (h)− 1

2ln

95

63

then, extending the working above to give two further estimates, we obtain Table 1.

h T (h) ǫT (h)16 0·553383 0·3480128 0·332636 0·1272654 0·245496 0·0401252 0·216541 0·0111701 0·208271 0·0029000·5 0·206104 0·000733

Table 1: Error in the trapezium-rule approximation to

∫ 20

4

1

x2 − 1dx

The error decreases approximately by a factor of 4 as the width is halved, and thisbehaviour is typical for the trapezium rule. The error is roughly a constant times h2

for small values of h: this is written as

T (h) =

∫ b

a

f(x) dx+O(h2),

where the notation O(h2) represents a function which is ‘about the same order ofmagnitude’ as h2 for small h. It is possible to do better by approximating the curvemore closely; this brings us to Simpson’s rule.

3.2 Simpson’s rule

The trapezium rule approximates the area under a curve by replacing that curvewith a number of straight-line segments, which are curves of the form y = mx + c.Simpson’s rule improves on this by using quadratic curves, i.e., curves of the formy = ax2 + bx + c. A quadratic curve is determined by three points: for Simpson’srule, the first curve is chosen to go through

(

x0, f(x0))

,(

x1, f(x1))

and(

x2, f(x2))

,the second through

(

x2, f(x2))

,(

x3, f(x3))

and(

x4, f(x4))

, and so on. In order forthis to work, the area must be divided into an even number of strips.

The derivation of Simpson’s rule is not required for this course. For the interestedreader, we include an explanation in Appendix A.

51

Page 52: MATH143 Calculuspower/MATH143notes-1.pdf · Chain, product and quotient rules. Second-order and higher derivatives. Stationary points and their classification. Parametric, implicit

0

0.5

1

1.5

2

2.5

3

3.5

1 2 3 4

Figure 12: Simpson’s rule

Simpson’s rule states that

∫ b

a

f(x) dx ≈ h

3

(

f(x0) + 4f(x1) + 2f(x2) + 4f(x3) + 2f(x4)

+ · · ·+ 2f(xn−2) + 4f(xn−1) + f(xn))

,

where n is an even number and h is the width of each strip. A shorter form is oftenused:

∫ b

a

f(x) dx ≈ S(h) =h

3(F + L+ 4O + 2E),

where F and L are the first and last ordinates, O is the sum of the odd-positionordinates, (f(x1), f(x3) et cetera) and E is the sum of the even-position ordinates(f(x2), f(x4), et cetera). For comparison, the trapezium rule has the form

∫ b

a

f(x) dx ≈ T (h) =h

2(F + L+ 2O + 2E).

52

Page 53: MATH143 Calculuspower/MATH143notes-1.pdf · Chain, product and quotient rules. Second-order and higher derivatives. Stationary points and their classification. Parametric, implicit

Example

Use Simpson’s rule with 2, 4 and 8 strips to estimate

∫ 20

4

1

x2 − 1dx. Work to 6 d.p.

2 strips with h = (20− 4)/2 = 8 and f(x) =1

x2 − 1give

S(8) =8

3

(

f(4)+f(20)+4f(12))

=8

3

(

0·066667+0·002506+4(0·006993))

= 0·259053,

4 strips with h = (20− 4)/4 = 4 give

S(4) =4

3

(

f(4) + f(20) + 4(

f(8) + f(16))

+ 2f(12))

=4

3

(

0·066667 + 0·002506 + 4(0·015873 + 0·003922) + 2(0·006993))

= 0·216450

and 8 strips with h = (20− 4)/8 = 2 give

S(2)

=2

3

(

f(4) + f(20) + 4(

f(6) + f(10) + f(14) + f(18))

+ 2(

f(8) + f(12) + f(16))

)

=2

3

(

0·066667 + 0·002506 + 4(0·028571 + 0·010101 + 0·005128 + 0·003096)+ 2(0·015873 + 0·006993 + 0·003922)

)

= 0·206890.

Hence I ≈ 0·2 to 1 d.p. Adding these (and two further calculations) to our previous

table yields Table 2, where the error ǫS(h) = S(h)−∫ 20

4

dx

x2 − 1.

h T (h) ǫT (h) S(h) ǫS(h)16 0·553383 0·3480128 0·332636 0·127265 0·259053 0·0536824 0·245496 0·040125 0·216450 0·0110792 0·216541 0·011170 0·206890 0·0015191 0·208271 0·002900 0·205514 0·0001430·5 0·206104 0·000733 0·205382 0·000010

Table 2: Approximation errors for the trapezium and Simpson’s rules

53

Page 54: MATH143 Calculuspower/MATH143notes-1.pdf · Chain, product and quotient rules. Second-order and higher derivatives. Stationary points and their classification. Parametric, implicit

As the strip widths are halved, the errors are (approximately) divided by 16, i.e., theerror term is O(h4). This is how the error behaves for Simpson’s rule:

∫ b

a

f(x) dx = S(h) +O(h4).

It becomes accurate much more rapidly than is the case with the trapezium rule.

Example

Find I =

∫ 4

2

1√1 + x3

dx using Simpson’s rule with 4 and 8 strips. Work to 5 d.p.

and state your answer with the appropriate degree of accuracy.

x f(x) 4 strips 8 strips2·00 0·33333 F F2·25 0·28409 − O2·50 0·24526 O E2·75 0·21419 − O3·00 0·18898 E E3·25 0·16824 − O3·50 0·15097 O E3·75 0·13642 − O4·00 0·12403 L L

Table 3: Values of f(x) = (1 + x3)−1/2 to 5 s.f.

4 strips with h = (4− 2)/4 = 0·5 give

S(0·5) = 0·53

(

f(2) + f(4) + 4(

f(2·5) + f(3·5))

+ 2f(3))

=0·53

(

0·33333 + 0·12403 + 4(0·24526 + 0·15097) + 2(0·18898))

= 0·40337

to 5 d.p., whereas 8 strips with h = (4− 2)/8 = 0·25 give

S(0·25) = 0·253

(

f(2) + f(4) + 4(

f(2·25) + f(2·75) + f(3·25) + f(3·75))

+ 2(

f(2·5) + f(3) + f(3·5)))

=0·253

(

0·33333 + 0·12403 + 4(0·28409 + 0·21419 + 0·16824 + 0·13642)+ 2(0·24526 + 0·18898 + 0·15097)

)

= 0·40330 to 5 d.p.

The two answers agree to 3 significant figures, so I = 0·403 (3 s.f.).

54

Page 55: MATH143 Calculuspower/MATH143notes-1.pdf · Chain, product and quotient rules. Second-order and higher derivatives. Stationary points and their classification. Parametric, implicit

3.3 The Newton-Raphson method

This is an iterative method of finding a root of the equation f(x) = 0. ‘Iterative’means that we start with an initial approximation x0, then use x0 to find our nextapproximation x1, which is hopefully more accurate. We then use x1 to find x2 andso on.

Consider the graph of y = f(x) shown in Figure 3. The x value at the point A wherethe graph crosses the x-axis gives the solution to the equation f(x) = 0

–1

0

1

2

3

4

–1 1 2 3 4

x

y

A

P

Q R

Figure 13: The Newton-Raphson method

If P =(

x0, f(x0))

is a point on the curve y = f(x) near to A, then x = x0 is anapproximate value for the root of f(x) = 0. The error in the approximation is givenby the distance AR, where R = (x0, 0).

Now if PQ is the tangent to the curve at P , crossing the x-axis at Q = (x1, 0), thenx = x1 is the next approximation to the root required.

55

Page 56: MATH143 Calculuspower/MATH143notes-1.pdf · Chain, product and quotient rules. Second-order and higher derivatives. Stationary points and their classification. Parametric, implicit

The gradient of the tangent is f ′(x0) =PR

QRand f(x0) = PR, so

QR =PR

f ′(x0)=f(x0)

f ′(x0)and x1 = x0 −QR = x0 −

f(x0)

f ′(x0).

In general,

xn+1 = xn −f(xn)

f ′(xn);

this is the Newton-Raphson method.

As with the trapezium rule and Simpson’s rule, we proceed with the iteration untiltwo consecutive values agree to our desired level of accuracy.

Examples

1. Find, accurate to 4 decimal places, the root of f(x) = 2x3 − 7x+ 2 close to 0,starting with x0 = 0.

As f ′(x) = 6x2−7, recording the values to 5 decimal places gives the following.

x1 = x0 −f(x0)

f ′(x0)= 0− 2

−7= 0·28571

x2 = x1 −f(x1)

f ′(x1)= 0·28571− 0·04665

−6·51020 = 0·29288

x3 = x2 −f(x2)

f ′(x2)= 0·29288− 0·00009

−6·48533 = 0·29289

The last two values agree to 4 decimal places., so the root required is x = 0·2929to 4 d.p. (If one more iteration is completed, x3 and x4 agree to 9 d.p.)

Note that the value of f ′(x) is very large compared to the value of f(x) for eachiteration. Even for the first iteration, f ′(x) is more than 3 times the value off(x). This makes the ‘correction term’ f(xn)/f

′(xn) become small very quickly,giving rapid convergence to the root.

If the value of f ′(x) is not large in comparison with f(x), convergence to theroot can be much slower or, in certain circumstances, the successive valuescan diverge. There is a technique for dealing with this problem which will bedescribed in Section 4.3, after we have introduced Taylor series.

56

Page 57: MATH143 Calculuspower/MATH143notes-1.pdf · Chain, product and quotient rules. Second-order and higher derivatives. Stationary points and their classification. Parametric, implicit

2. Find the root of sinh x = x+ 1 to 4 s.f.

The equation has been given in the form sinh x = x+1. The Newton-Raphsonmethod requires the form f(x) = 0, so rearranging we have

f(x) = sinh x− x− 1 and f ′(x) = cosh x− 1.

If we choose the starting point x0 = 0 then f(x0) = −1 and f ′(x0) = 0, so theNewton-Raphson formula makes no sense. When this happens, we start againwith a better choice of x0. From the sketch, x0 = 2 is reasonable.

–6

–4

–2

0

2

4

6

–3 –2 –1 1 2 3

x

y

y = x+ 1

y = sinh x

Figure 14: The graphs of y = sinh x and y = x+ 1

With x0 = 2 and working to 5 decimal places, we obtain the following.

x1 = x0 −f(x0)

f ′(x0)= 2− 0·62686

2·76220 = 1·77306

x2 = x1 −f(x1)

f ′(x1)= 1·77306− 0·08646

2·02933 = 1·73045

x3 = x2 −f(x2)

f ′(x2)= 1·73045− 0·00254

1·91020 = 1·72913

x4 = x3 −f(x3)

f ′(x3)= 1·72913− 0·00002

1·90659 = 1·72912

The last two values agree to at least 4 s.f., so the root is x = 1·729 to 4 s.f.

57

Page 58: MATH143 Calculuspower/MATH143notes-1.pdf · Chain, product and quotient rules. Second-order and higher derivatives. Stationary points and their classification. Parametric, implicit

4 Further topics

4.1 Taylor’s theorem

If the function f(x) is well behaved near a then, when h is small, the quantity f(a+h)can be expressed as a power series, by writing

f(a+ h) = A0 + A1h+ A2h2 + · · · =

∞∑

n=0

Anhn,

where the coefficients A0, A1 et cetera are determined by the function f(x).

Taking h = 0 on both sides shows that A0 = f(a).

To find the other coefficients we differentiate f(a+h) with respect to h and set h = 0:

f ′(a+ h) = A1 + 2A2h + 3A3h2 + · · · ,

so putting h = 0 gives f ′(a) = A1. Continuing to differentiate, we have

f ′′(a + h) = 2A2 + (3× 2)A3h + (4× 3)A4h2 + · · · ,

so putting h = 0 gives f ′′(a) = 2A2 and therefore A2 =f ′′(a)

2.

In general, we have

An =f (n)(a)

n!,

where f (n) is the nth derivative of f(x) and n! = n(n−1)(n−2) · · · (2)(1) is n factorial.

The series

f(a+ x) = f(a) + f ′(a)x+f ′′(a)

2!x2 +

f ′′′(a)

3!+ · · · =

∞∑

n=0

f (n)(a)

n!xn

is called the Taylor-series expansion of f(x) about x = a.

The corresponding series with a = 0 is

f(x) = f(0) + f ′(0)x+f ′′(0)

2!x2 +

f ′′′(0)

3!x3 + · · · =

∞∑

n=0

f (n)(0)

n!xn,

and this is the Maclaurin-series expansion of f(x).

These series expansions are usually valid wherever the series converges, but notalways – we will not encounter any such difficulty in this course.

58

Page 59: MATH143 Calculuspower/MATH143notes-1.pdf · Chain, product and quotient rules. Second-order and higher derivatives. Stationary points and their classification. Parametric, implicit

Examples

1. Find the Maclaurin series for f(x) = ex.

Since f ′(x) = ex = f(x), it follows that f (n)(x) = ex for n = 1, 2, 3, . . .. Hencef (n)(0) = e0 = 1 for all n and the required series is

ex = 1 + x+x2

2!+x3

3!+ · · · .

2. Find the Maclaurin series for f(x) = sin x.

Here f ′(x) = cosx, f ′′(x) = − sin x, f ′′′(x) = − cosx, f (iv)(x) = sin x et cetera.When x = 0, sin x = 0 and cos x = 1, so

sin x = 0 + x+ 0− x3

3!+ 0 +

x5

5!+ · · · = x− x3

3!+x5

5!− · · · .

(The particularly alert reader will realise the previous two answers are basedon circular reasoning, since we used the Maclaurin series of ex and sin x to findthese derivatives in the first place. Rest assured that it is possible to avoid thiscircularity, and there is nothing to worry about.)

These two series are valid for any choice of x, but this is not true for allfunctions.

3. If f(x) =1

1− xthen, by the linear-composite rule,

f ′(x) =1

(1− x)2, f ′′(x) =

2

(1− x)3

and, in general, f (n)(x) =n!

(1− x)n+1. The Maclaurin series is therefore

1

1− x= 1 + x+ x2 + x3 + · · ·

and we have recovered the familiar geometric series. This expansion is validfor |x| < 1 but not for |x| > 1.

In the examples above, finding f (n)(0) did not pose much of a problem. Thismay not always be so straightforward.

59

Page 60: MATH143 Calculuspower/MATH143notes-1.pdf · Chain, product and quotient rules. Second-order and higher derivatives. Stationary points and their classification. Parametric, implicit

4. If f(x) =1

1 + x2then f ′(x) = − 2x

(1 + x2)2.

To find the higher derivatives in this case becomes rather complicated veryquickly – try it and see. Fortunately, there is an easier way: replace x by −x2in the series for 1/(1− x), to get that

1

1 + x2= 1− x2 + x4 − x6 + · · · ,

which is valid whenever | − x2| < 1 or, equivalently, |x| < 1.

5. Find the Maclaurin series for cos(

x/(1 − x2))

, up to and including the termin x4.

Again, to calculate this series by finding derivatives would be a bit complicated.Instead, recall that

cos y = 1− y2

2+y4

24+ · · · ,

where the dots represent terms of degree strictly greater than 4, so lettingy = x/(1− x2) = x+ x3 + · · · gives

cos(

x/(1− x2))

= 1− 1

2(x+ x3 + · · · )2 + 1

24(x+ x3 + · · · )4 + · · ·

= 1− 1

2(x2 + 2x4 + · · · ) + 1

24(x4 + · · · ) + · · ·

= 1− 1

2x2 − 23

24x4 + · · · .

Estimating integrals

The Taylor-series expansion gives us another way of finding approximate values fordefinite integrals. If f(x) has the Taylor series

f(x) = A0 + A1(x− a) + A2(x− a)2 + · · ·about a then f(x) is approximately equal to the polynomial

p(x) = A0 + A1(x− a) + · · ·+ An(x− a)n

for all x close to a. Hence, if c and d are close to a,∫ d

c

f(x) dx ≈∫ d

c

(

A0 + A1(x− a) + · · ·+ An(x− a)n)

dx

=

[

A0(x− a) +A1(x− a)2

2+ · · ·+ An(x− a)n+1

n + 1

]d

c

.

Taking more terms of the Taylor series will give greater accuracy.

60

Page 61: MATH143 Calculuspower/MATH143notes-1.pdf · Chain, product and quotient rules. Second-order and higher derivatives. Stationary points and their classification. Parametric, implicit

Examples

1. Find a numerical approximation to

∫ 0·5

0

e−x2/2 dx.

Replacing x by −x2/2 in the Maclaurin series for ex, we see that

e−x2/2 = 1− x2

2+x4

8− x6

48+ · · · .

Hence∫ 0·5

0

e−x2/2 dx ≈∫ 0·5

0

(

1− x2

2+x4

8− x6

48

)

dx

=

[

x− x3

6+x5

40− x7

336

]0·5

0

= 0·479925 (6 d.p.).

(The true value is 0·479925219 to 9 decimal places.)

2. Find an approximate value for

∫ 4

3

1

1 + x3dx.

A little care must be taken here; the expansion of the integrand must be valid.Although

1

1 + x3= 1− x3 + x6 − x9 + · · · ,

this holds only when |x| < 1. Instead, we re-write the integrand: note that

∫ 4

3

1

1 + x3dx =

∫ 4

3

x−3

x−3 + 1dx =

∫ 4

3

x−3(

1− x−3 + x−6 + · · ·)

dx

≈∫ 4

3

(

x−3 − x−6 + x−9)

dx

=

[

−x−2

2+x−5

5− x−8

8

]4

3

= 0·02369 (5 d.p.).

(The correct value is 0·023694490 to 9 decimal places.)

61

Page 62: MATH143 Calculuspower/MATH143notes-1.pdf · Chain, product and quotient rules. Second-order and higher derivatives. Stationary points and their classification. Parametric, implicit

4.2 L’Hopital’s rule

Let f(x) and g(x) be continuous functions. If g(a) 6= 0 then, by the rules for limits,

limx→a

f(x)

g(x)=f(a)

g(a).

If g(a) = 0 but f(a) 6= 0 then∣

f(x)

g(x)

→ ∞ as x→ a,

since |f(x)| → |f(a)| but |1/g(x)| = 1/|g(x)| is getting larger and larger as x → a.This leaves the case where f(a) = g(a) = 0. In this situation, different possibilitiesarise. For example, as x→ 0,

sin x

x→ 1,

sin2 x

x→ 0 and

sin x

x2

∣→ ∞.

In general, L’Hopital’s rule lets us find such a limit.

Put x = a+ h, so that x→ a as h→ 0. Using Taylor series,

f(x)

g(x)=f(a+ h)

g(a+ h)=f(a) + f ′(a)h+ f ′′(a)

2!h2 + · · ·

g(a) + g′(a)h+ g′′(a)2!h2 + · · ·

.

If f(a) = g(a) = 0 then dividing the numerator and denominator by h shows that

f(x)

g(x)=f ′(a) + f ′′(a)

2!h+ · · ·

g′(a) + g′′(a)2!h+ · · ·

→ f ′(a)

g′(a)

as h→ 0, as long as g′(a) 6= 0. Hence

limx→a

f(x)

g(x)=f ′(a)

g′(a)if f(a) = g(a) = 0 and g′(a) 6= 0.

What if g(a) = 0 and g′(a) = 0? The working above shows that this situation iscontrolled by the second derivatives: the limit

limx→a

f(x)

g(x)=f ′′(a)

g′′(a)if f(a) = g(a) = 0, f ′(a) = g′(a) = 0 and g′′(a) 6= 0.

Similarly, if f ′′(a) = g′′(a) = 0 but g′′′(a) 6= 0 then the method can be repeated, andso on. Summarising, we have the following general rule.

62

Page 63: MATH143 Calculuspower/MATH143notes-1.pdf · Chain, product and quotient rules. Second-order and higher derivatives. Stationary points and their classification. Parametric, implicit

L’Hopital’s rule

If f(x) and g(x) are functions such that

f(a) = g(a) = · · · = f (n−1)(a) = g(n−1)(a) = 0

but g(n)(a) 6= 0 then

limx→a

f(x)

g(x)= lim

x→a

f ′(x)

g′(x)= · · · = lim

x→a

f (n−1)(x)

g(n−1)(x)=f (n)(a)

g(n)(a).

Examples

1. Find limx→0

sin x

x.

If f(x) = sin x and g(x) = x then f(0) = sin 0 = 0 and g(0) = 0. However,f ′(x) = cos x and g′(x) = 1, so f ′(0) = cos 1 and g′(0) = 1. Hence L’Hopital’srule gives that

limx→0

sin x

x=f ′(0)

g′(0)=

1

1= 1.

(L’Hopital’s rule is not really needed here: note that

limx→0

sin x

x= lim

x→0

f(x)− f(0)

x− 0= f ′(0) = 1,

by the definition of f ′(0).)

2. Find limx→0

3x− sin x

x.

If f(x) = 3x − sin x and g(x) = x then f(0) = 0 and g(0) = 0, but f ′(x) =3− cos x and g′(x) = 1. Hence L’Hopital’s rule applies and

limx→0

3x− sin x

x=f ′(0)

g′(0)=

3− 1

1= 2.

(Again, L’Hopital’s rule isn’t really needed here: by the rules for limits,

limx→0

3x− sin x

x= lim

x→0

3x

x− lim

x→0

sin x

x= 3− 1 = 2,

as expected.)

63

Page 64: MATH143 Calculuspower/MATH143notes-1.pdf · Chain, product and quotient rules. Second-order and higher derivatives. Stationary points and their classification. Parametric, implicit

3. Find limx→0

√1 + x− 1− 1

2x

x2.

Let f(x) =√1 + x− 1− 1

2x and g(x) = x2. Then f(0) = g(0) = 0, but

f ′(x) =1

2(1 + x)−1/2 − 1

2and g′(x) = 2x,

so f ′(0) = g′(0) = 0 as well.

Differentiating again gives f ′′(x) = −1

4(1 + x)−3/2 and g′′(x) = 2, so

limx→0

f(x)

g(x)=f ′′(0)

g′′(0)=

−14

2= −1

8.

(We could also find this limit by using the binomial theorem to write down thefirst few terms of the Maclaurin series for (1 + x)1/2.)

4. Find limx→π/2

cosx

cos 3x.

Let f(x) = cosx and g(x) = cos 3x; note that f(0) = g(0) = 0. However,f ′(x) = − sin x and g′(x) = −3 sin 3x, so

limx→π/2

cosx

cos 3x=f ′(0)

g′(0)=

−1

+3= −1

3.

(Here, L’Hopital’s rule really is the best way of finding the desired limit.)

4.3 The modified Newton-Raphson method

The following material is worth noting for future reference and is included here forinterest only. It is another application of Taylor-series expansion.

Consider the equation f(x) = 0. If x = x0 is an approximate root and x = x0 + h isan exact root then, using a Taylor series, we have

0 = f(x0 + h) = f(x0) + hf ′(x0) +h2

2!f ′′(x0) + · · · .

Considering the first two terms gives 0 ≈ f(x0) + hf ′(x0), so h ≈ − f(x0)

f ′(x0). Hence

x1 = x0 −f(x0)

f ′(x0)

should be a more accurate approximation to x0 + h than x0 is; this is the standardNewton-Raphson method.

64

Page 65: MATH143 Calculuspower/MATH143notes-1.pdf · Chain, product and quotient rules. Second-order and higher derivatives. Stationary points and their classification. Parametric, implicit

If f ′(x0), the slope of the tangent to the curve y = f(x) at x = x0, is small thenthe approximate value of h may be large and the second approximation x1 may befurther away from the exact root than x0. In other words, if f ′(x0) is small then theNewton-Raphson method as it stands may fail to converge. (See Figure 15.)

–2

–1

0

1

2

–1 1 2 3x

y

y = f(x)x0

Figure 15: A function with a shallow gradient near a root

For a more accurate first step in this case, we consider the first three terms in theTaylor series, so that

0 ≈ f(x0) + hf ′(x0) +h2

2!f ′′(x0),

which is a quadratic equation in h. However, as f ′(x0) is very small (or we wouldnot be doing this working) we may neglect the h term and

0 ≈ 2f(x0) + h2f ′′(x0) ⇐⇒ h ≈ ±√

−2f(x0)

f ′′(x0).

Hence we should take

x1 = x0 ±√

−2f(x0)

f ′′(x0)

in this case, where either sign may be chosen. After this step we revert to thestandard formula,

xn+1 = xn −f(xn)

f ′(xn).

65

Page 66: MATH143 Calculuspower/MATH143notes-1.pdf · Chain, product and quotient rules. Second-order and higher derivatives. Stationary points and their classification. Parametric, implicit

A The derivation of Simpson’s rule

0

1

2

3

4

5

6

1 2 3 4 5 6 7 8x

y

Figure 16: Estimation of the area under a graph

Consider the diagram above. If the region between the x-axis, the curve y = f(x)and the lines x = a and x = b is divided into an even number of strips, each ofwidth h, then Simpson’s rule can be used to estimate this area. (In Figure 16 above,the end point a = 1, b = 8 and the width h = 1.) The area of two consecutive stripsis approximated by fitting a quadratic curve, i.e., a curve of the form

y = q(x) = rx2 + sx+ t,

through the three points on the original curve at the end points of those strips: thepoints with ordinates y− = f(xi−h), y0 = f(xi) and y+ = f(xi+h). (In comparison,the trapezium rule fits a straight line between the end points of each strip.) Notethat

y− = r(xi − h)2 + s(xi − h) + t, (i)

y0 = rx2i + sxi + t (ii)

and y+ = r(xi + h)2 + s(xi + h) + t, (iii)

so taking (i)− 2(ii) + (iii) shows that

y− − 2y0 + y+ = r(xi − h)2 + s(xi − h) + t

− 2rx2i − 2sxi − 2t+ r(xi + h)2 + s(xi + h) + t = 2rh2.

66

Page 67: MATH143 Calculuspower/MATH143notes-1.pdf · Chain, product and quotient rules. Second-order and higher derivatives. Stationary points and their classification. Parametric, implicit

If Ai is the area under the fitted quadratic between x = xi − h and x = xi + h then

Ai =

∫ xi+h

xi−h

q(x) dx

=

[

rx3

3+sx2

2+ tx

]xi+h

xi−h

=r(xi + h)3

3+s(xi + h)2

2+ t(xi + h)− r(xi − h)3

3− s(xi − h)2

2− t(xi − h)

=6rx2ih + 2rh3

3+

4sxih

2+ 2th

=2rh3

3+ 2(rx2i + sxi + t)h

=h

3

(

y− − 2y0 + y+)

+ 2y0h

=h

3

(

y− + 4y0 + y+)

.

The area of the first pair of strips is, therefore,

A1 =h

3

(

f(x0) + 4f(x1) + f(x2))

;

the area under the quadratic curve fitted to the second pair of strips is A3, theestimated area of the third pair of strips is A5, and so on, where

A3 =h

3

(

f(x2) + 4f(x3) + f(x4))

, A5 =h

3

(

f(x4) + 4f(x5) + f(x6))

et cetera. Hence the estimated total area of the first three pairs of strips is

A1 + A3 + A5 =h

3

(

f(x0) + 4f(x1) + 2f(x2) + 4f(x3) + 2f(x4) + 4f(x5) + f(x6))

.

For a general number of pairs of strips, we have

∫ b

a

f(x) dx ≈ h

3

(

F + L+ 4O + 2E)

,

where F and L are the values of the first and last ordinates f(x0) and f(xn), O isthe sum of all the odd-placed ordinates (f(x1), f(x3) et cetera) and E is the sum ofall the even-placed ordinates (f(x2), f(x4) et cetera).

This is Simpson’s rule.

67