Professional Documents
Culture Documents
We have now reached the last unit of our Calculus course, a unit that you should find both interesting
and relatively easy. The broad topic under discussion is Numerical Methods, our work
concentrating on solving equations and evaluating definite integrals. As the name of the topic implies,
the solutions we find will not be exact (though the degree of accuracy could be very great indeed). For
this reason we will first concentrate on determining the size of the errors involved (both absolute ands
relative), together with the bounds of these errors.
For f(x) = √(x + 1), find the second degree Taylor Polynomial for c = 0 (i.e. centred at x = 0). Use this
expansion to approximate √(1.1) and determine the accuracy of this approximation.
[ Note that at this point, without checking with a calculator, we do not know the degree of accuracy of
this answer. This is where the calculation of the remainder term R2 comes into the picture. ]
As this contains 4 zeroes after the decimal point (also, added to 1.04875 we obtain an answer of
1.04881), we can safely conclude that √(1.1) = 1.0488 to 4 decimal places.
Example 2
The function f is given by f(x) = tan x, where – π/2 < x < π/2. Obtain the power series expansion of
f(x) up to and including the term in x³. The series is to be used to obtain approximate values of f(x) for
x ε [ -0.3, 0.3 ]. By considering the remainder term
Therefore f ''(x) = 2f(x)f '(x) and f '''(x) = 2[f '(x)]² + 2f(x)f ''(x).
Therefore f(0) = 0, f '(0) = 1, f ''(0) = 0 and f '''(0) = 2 x 1² = 2.
Therefore f (4)(x) = 8sec³x. sec x tan x + 8tan x sec4x + 4tan²x (2sec²x tan x)
We then find f (4)(x) using the value of x ε [ - 0.3, 0.3 ] which maximizes R3 (and also,
Example 3
interpreted in this form, dx and dy are called differentials. Putting the result another way,
dy = f '(x) dx
Written in this form, dx can be taken as a small change in x and dy as the corresponding
Example 4
If A = πr² and r increases from 4 to 4.1, what is the approximate small increase in A ?
We write dA/dr = 2πr and put dA = 2πr dr. Taking dr as the increase in the value of r, i.e.
[ Note that the actual change in A would be 4.1²π - 4²π = (4.1 + 4)(4.1 – 4)π
= 8.1 x 0.1π = 0.81π. Our approximate answer is therefore out by an amount 0.01π. ]
Example 5
Given that y = 1√x, find the approximate change in y when x increases from 9 to 9.1.
Therefore 1/√ (9.1) ≈1/3 - 0.00185 ≈ 0.3315. [ Note that the calculator gives 0.3315 also
Similar to the work in examples 4 and 5 above, if dx is a small error in x, then dy gives
Example 6
A manufacturer of ball bearings has determined that his machine produces ball
bearings of radius 3 cm with a maximum error of 0.02 cm in the radius. Since the
of the ball bearings. What will be the maximum error for the volume ?
The maximum error in the volume, corresponding to a maximum error of 0.02 cm in the
clear, however, that whilst an error of size 0.1 is relatively unimportant when the original
value of the variable is 100, the same size of error becomes critical when the original
value is 0.5 ! It is therefore not so much the absolute value of the error, but the percentage
Example 7
An error of 3% is made in measuring the radius of a sphere. Find (i) the relative error,
more than one variable. For example, if z = f(x, y) = x² + y², what would be the
First of all, however, we will state the result for the total differential dz, where
z = f(x, y). As you will see, this is quite a simple extension of the previous result for one
variable (i.e. dy = f '(x) dx), excepting that in the two variable (or more) situation we use
partial derivatives. The result is
[ This result can be easily extended to functions of more than two variables. ]
Example 8
Example 9
find dw.
Our last few questions involve two or more variables together with percentage (rather
Example 10
(i) The area E of triangle ABC is to be calculated using the formula E = ½ bc sin A.
(iii) If A = π/6 radians ± 0.02 radians, and the possible percentage error in measuring
each of b and c is ± 3%, find, to 2 significant figures, the greatest possible percentage
f(x) = 0. This root will, in general, not be found exactly − in fact, an exact solution could
accuracy), life will be made much easier if we can determine a good first estimate of the
root in question.
You will see later that we can use various iterative techniques to obtain a solution.
However, we must start with a first estimate x1 of the root [ of f(x) = 0 ]. If the first
estimate is good, fewer iterations (and therefore less work) will be needed. Furthermore,
Graphical Method
Consider, for example, the equation ln (2x + 1) = x − 2 given above. If the graphs of
the negative or the positive root of ln (2x + 1) = x − 2 can be found. In this case, we could
use x1 = 4 as our first approximation to the positive root. Clearly, also, the negative root
f(a) and f(b) have different signs, then f(x) = 0 when x = α , such that a < α < b.
Looking at the above diagram (Fig. 2), where f(a) < 0 and f(b) > 0, clearly the curve
y = f(x) must cross the x-axis somewhere between a and b if both (i) f is a function and
(ii) f is continuous. Thus, for example, if f(x) = e2x − x − 2 (as in Activity 1), then
f (-1) = e-2 + 1 − 2 < 0, and f (-2) = e-4 + 2 − 2 > 0. Therefore the required root lies
between x = - 1 and x = - 2.
Notice that we could zero in on this root by repeated use of the Intermediate Value
Theorem, e.g. as f (- 1.5) < 0 and f (- 2) > 0, the root lies between − 1.5 and − 2. Further,
as f (- 1.75) is also < 0, the root lies between − 1.75 and − 2, etc.
Linear Interpolation
This concept can be easily explained by reference to Fig. 2. If we take the curve PQ to be
approximately linear, we can find the equation of the straight line PQ and hence
calculate where this line crosses the x-axis. This should give a reasonably good first
approximation to α.
Example 1
Show that the positive root of the equation ln (2x + 1) = x − 2 lies between x = 4 and
Let f(x) = ln (2x + 1) − x + 2 [ remember that we need to write the equation in the form
f(x) = 0. ]
To find a closer approximation by linear interpolation, we first need to find the equation
of the line joining the points P(4, 0.197) and Q(5, - 0.602).
of f(x) = 0, our next step is to devise some iterative means of locating this root to any
the sequence 2, ¾ , 9/32, …, 2 x (3/8) n-1 , … is such that the nth term un = 3/8 un-1 (for n ≥ 2).
formula for a sequence, and given the first term, we can develop all the terms of the
= 3/2, etc.
The question now arises, "Can we always derive an iterative formula for the solution of
an equation and, if so, will it always work ?" I'm not sure about the answer to the first
question (the word 'always' rather frightens me !), but the answer to the second question
is definitely "No".
Example 1
Show that the equation x² - 5x + 1 = 0 can be arranged as x = (x² + 1)/5 or, alternatively,
Starting with x1 = 0.2, find the values of x2 , x3 and x4 which are produced by each of
these iterative formulae. Which formula appears to give a sequence that converges to one
of the roots ? Can we state this root to 3 (or even 4) significant figures ? If so, why ?
From the first equation, we can now write xn+1 = (xn² + 1)/5. Taking x1 = 0.2,
Clearly the first formula gives the sequence beginning 0.2, 0.208, 0.2087, 0.2087, and
certainly appears to be converging to one of the roots. Also, as the answer 0.2087 is
repeated, we can safely conclude that we have found a root to 4 significant figures .
formula xn+1 = (xn² + 1)/5 converged to a root, whilst the formula x n+1 = 5 − 1/xn did
not. The question then arises, "Do we need to go through the task of finding u2 , u3 , u4 ,
Consider the general iterative formula xn+1 = f (xn), which in turn is derived from
= (x1, x 2 ). If P1 T is now drawn parallel to the x−axis and TP2 parallel to the y−axis,
(meeting the line y = x at T and the curve y = f(x) at P2), then the x−coordinate of P2
The sequence x1, x2, x3,… is therefore seen to converge to the root α. This
convergence is possible as long as the (positive) gradient of the curve y = f(x) is less
than the gradient of the line y = x in the region of the root, i.e. 0 < f '(x) < 1.
If f '(x) < − 1, (see Fig. 4), the sequence would again fail to converge.
We can see therefore that the iteration formula x n+1 = f (x n ) would converge if either
in the region of the root, i.e. | f '(x) | < 1, if the trivial result f '(x) = 0 is ignored.
Example 2
Which of the following iterative formulae would produce a convergent sequence in the
region of the indicated value of x ?
Example 3
equation by an iterative method. Show that the equation has a root in [ 0, 1 ] and a root
in [ 9, 10 ].
Using the iteration xr+1 = (1 + xr²)/10, calculate x2 , x3 and x4 taking (i) x1 = 0, (ii) x1 = 10.
Show, graphically or otherwise, that (i) produces a sequence converging to the smaller
root, but (ii) produces a diverging sequence. Explain this behaviour and find an iteration
Therefore, as g is a continuous function and g(0), g(1) have different signs, there is a root
Similarly, g(9) = 82 − 90 = - 8, and g(10) = 101 − 100 = 1. Therefore, as g(9), g(10) have
To show that in (i) we have a sequence that converges to the smaller root, we will first
use the method of determining whether | f '(x) | < 1, where f(x) = (1 + x²)/10
from the given iteration formula. But f '(x) = 2x/10 = x/5, giving 0 < f '(x) < 1 in the
Therefore the iteration formula gives a convergent sequence when the root lies in the
interval [ 0, 1 ], but a divergent sequence when the root lies in the interval [ 9, 10 ].
Looking once more at the case concerning the larger root, we can illustrate the divergent
We now take the function f(x) = 10 − 1/x, which gives f '(x) = 1/x².
Therefore 0 < f '(x) < 1 in the interval [ 9, 10 ], hence the iterative sequence converges.
Our next session continues the idea of solving an equation f(x) = 0 by means of iteration.
This time, however, we will concentrate on one particular result , i.e. the
prove very useful indeed. However, the technique employed certainly had its drawbacks,
mainly (i) the degree of ingenuity that was often needed to derive a formula, and (ii) the
possibility that such a formula may not even work ! Clearly life would be a lot easier if
we had a given formula that we could apply in every situation. This is why the Newton−
Like many brilliant ideas, the Newton−Raphson formula is base on a very simple notion.
a second (and, in general, better) approximation is obtained by drawing the tangent to the
curve at the point (T) where x = x1 . This gives (see Fig. 1) the second approximation
Our next question is "How can we devise a formula that implements this process ?"
This is the Newton−Raphson iterative formula.
Before we look at a couple of examples, however, let us stress again that a good first
approximation goes a long way ! Firstly, it requires fewer iterations to achieve the
Example 1
Show that the equation ex + x − 2 = 0 has one and only one real root. Use the Newton−
A graphical method would adequately answer the first part of the question.
Example 2
(i) Show by calculation that the equation 2x − tan x = 0 has a root, α, between x = 1 and
f (1.2) = 2.4 − tan 1.2 ≈ - 0.1722. Therefore, as f is a continuous function in the range
x = 1 to x = 1.2 (clearly there is a discontinuity when x = π/2 !), and f (1), f (1.2) have
Show that the Newton-Raphson approximation can be derived from the Taylor expansion
of f (a + h).
If the curve y = f (x) is such that the point T (where x = x1 ) lies close to a turning point, then the
tangent at T could intersect the x-axis at a point where x = x2 and the second approximation x2 is
worse than the first. This is an unusual occurrence (and could have been avoided if x1 were even closer
to α), but we will now look at an example involving such a breakdown of the method.
Example 4
By considering the graphs of y = x and y = tan x, or otherwise, show that the smallest
This smallest positive root is denoted by α. An attempt to calculate the value of α is made
by using the Newton-Raphson method applied to the equation tan x − x = 0, with the
initial approximation given by x1 = 4. Calculate x2 and x3 and explain, with the aid of a
Use the Newton-Raphson method with a suitable initial approximation to find the value
Therefore the smallest positive root of the equation x = tan x is clearly in the interval
However, as we shall soon see, this does not prove to be the case.
Why have we ended up in this very strange situation ? A sketch would certainly help to
To draw the curve y = f (x), where f (x) = x − tan x and f '(x) = 1 − sec²x, we note that
f '(π) = 0. The curve therefore has a stationary point at (π, π). As the gradient of the curve
y = f (x) has the same sign when x is just < π and when x is just > π, we can also
exactly, 6.12). The second approximation is therefore clearly worse than the first.
To obtain a sequence that converges to the root, we need to obtain a better first
approximation − in this case one that is a little less than 3π/2 ( ≈ 4.7).
Simpson's Rule
Here we are at last − the final topic of our course ! You will be pleased to know also that
the topic is an easy one. If you can think back to the work we did on the trapezium rule
(in Calculus 2), you will have a good idea of what our current session involves.
Just to refresh your memory, however, let us briefly recap our work on the trapezium
rule. The idea is to estimate the area 'under' a curve (and hence the value of the
corresponding definite integral) by dividing the area into several trapezia (the more the
better !).
You can see also that in the example we have illustrated (in Fig. 1), the estimated result
using the trapezium rule should be a very good one. In fact, if enough trapezia are used,
Obviously the sum of the three trapezia is greater than the required area by a fairly
curve instead of a straight line ?" This is where Simpson's Rule comes in !
Simpson's Rule
The essence of Simpson's Rule is that, if three points on the curve are taken, e.g.
then we can approximate the curve ABC [ in our example, given by the function
This is not too surprising as you should remember that many different functions were
Polynomials.
In our previous example, the coordinates of A, B and C (Fig. 4) were (0, 1), (1, 1.4142)
and (2, 3) respectively. If these three points lie on the curve y = ax² + bx + c, then
We can, however, make life easier by generalizing the result instead of finding a, b and c
numerically in every single instance. This is the formula we will now develop.
(x3 − x2 , y3 ), as the curve just moves a distance of x 2 units in the direction of the negative
x− axis.
Therefore, if x3 − x2 = d, the curve passes through the points (− d, y1 ), (0, y2 ) and (d, y3 ).
y = ax² + bx + c, then
y1 = ad² − bd + c ,
y2 = c and
y3 = ad² + bd + c.
But the area between the parabola y = ax² + bx + c, the x− axis and the lines x = − d, x = d
Our next task is to give this result (i.e. 2/3 ad³ + 2cd) in terms of y1 , y2 , y3 and d.
Example 2
General Result
In order to use Simpson's Rule, we need to divide the required area into n equally
spaced subintervals, where n is even (i.e. the number of ordinates must be odd ).
The required area, using Simpson's Rule, then follows the same pattern that we
Note carefully that the middle ordinates are multiplied by 4 and 2 alternately, beginning
Compare your answer with the result obtained in Example 1 (using the Trapezium
Rule).
This compares with the Trapezium Rule approximation of 7.56. Remember, however,
that Fig. 2 clearly showed that this answer was an over-estimate, suggesting that the
The area in square centimetres of the cross-section of a model boat 28cm long at
0
11.5
15.3
16.3
16.2
13.4
9.3
4.9
0
If the cross-sectional area of a strip is A cm², and the length is divided into thin strips,
each of width δx, then the volume of the boat ≈ ΣA δx cm³. As the number of strips is
We can then estimate this volume using Simpson's Rule with d = 3.5, y 1 = 0, y 2 = 11.5,
etc.
Example 5
A new approximation to the integral is f (− p) + f (p), where p = 1/√3. Prove that this is
also exact if f (x) is any polynomial of degree 3, but that if f (x) is any polynomial of
degree 4, then the error in the new approximation is less than the error in Simpson's
approximation.
Also, f (− 1/√3) + f (1/√3) = a[− 1/(3√3)] + b/3 − c/√3 + d + a[1/(3√3)] + b/3 + c/√3 + d
= 1/3 (2a + 2c + 6e) = 2/3 a + 2/3 c + 2e. The error in using Simpson's approximation is
a/9 − b/(3√3) + c/3 − d/√3 + e + a/9 + b/(3√3) + c/3 + d/√3 + e = 2a/9 + 2c/3 + 2e.
The error is therefore 2a/5 − 2a/9 = 8a/45, which is clearly less than 12a/45, i.e. the error
made in using this method is less than the error using Simpson's Rule.