MAM1043H_Tutorial7_Solns
MAM1043H_Tutorial7_Solns
MAM1043H_Tutorial7_Solns
Exercises
For the following exercises, also try and find the roots using Binary Search, Fixed Point Iteration,
Newton’s Method and the Secant Method – don’t only stick to the method that’s required for the
particular question. First do all problems by hand, and find all roots correct to four decimal places.
1. Find the Taylor series up to the term in x4 for ln x about the point x = 3. What is the coeffi-
f (3) (3)
cient of the term in x3 ? Hint: the term in x3 not only given by (x − 3)3 .
3!
1 1 1 1
A NSWER : Here, ln x ≈ ln 3 + (x − 3) − (x − 3)2 + (x − 3)3 − (x − 3)4 .
3 18 81 324
An x3 -term is contained in both the (x − 3)4 and (x − 3)3 brackets, so these need to be
multiplied out. Simplification of the above polynomial gives
25 4 1 4 1 4
ln 3 − + x − x2 + x3 − x .
12 3 3 81 324
The coefficient needed follows trivially.
2. If we use T2 for ln x about the point x = 3 to approximate ln 5, what is the bound on the error
in the approximation?
1 1
A NSWER : From the above, we know that T2 (x) = ln 3 + (x − 3) − (x − 3)2 , and so
3 18
by Taylor’s Theorem,
f (x) = ln x = T2 (x) + R2 (x),
where
f (3) (c)
R2 = (x − 3)3 , c ∈ (3, x).
3!
We’re trying to approximate f (5) with T2 (5), so we have x = 5 and a = 3.
By Taylor’s Theorem, we know that
M
|R2 (5)| ≤ |5 − 3|3 ,
3!
where we’ll choose M to be the maximum value of | f (3) (z)| on the interval z ∈ (3, 5) (note
here that z is simply a dummy variable – we could call it anything else. We don’t want to use
x again as it’s already been used before!).
1
2 2
Differentiating, we find that f (3) (x) = 3
, so clearly | f (3) (x)| = 3 . Now we evaluate
x x
(3) (3)
| f (3)| and | f (5)| (these are the only two values we must check because we know that
2/x3 is a decreasing function for x > 0).
Clearly, | f (3) (3)| is the bigger of the two, so we’ll set
2
M = | f (3) (3)| = .
27
Thus,
1 2 8
|R2 (5)| ≤ · (2)3 = .
3! 27 81
8
⇒ |R2 (5)| ≤ .
81
This is the required error bound.
3. Find the root of the equation x4 + x3 − 22x2 − 2x + 41 = 0 in the interval [1, 2] correct to six
decimal places.
A NSWER : x ≈ 1.435476.
4. Explain why Newton’s Method does not work for finding the roots of the equation x3 − 3x +
6 = 0 if the initial approximation is chosen to be x0 = 1. Will the Secant Method work if we
start with x0 = 0 and x1 = 1?
xn+1 = −2xn .
Remember that the division by xn is done under the assumption that xn 6= 0. Now, regardless
of the choice of x0 we make, this iteration will always produce a divergent sequence. So,
we’re actually forced to make the choice that x0 = 0, even though we’ve originally assumed
2
that this would never be the case. So this is a problem function, and serves to illustrate when
Newton’s Method can fail.
One reason for Newton’s Method failing here is because f 0 (x) = 13 x−2/3 , which does not exist
at x = 0 at all ( f has a vertical tangent there). Roots at vertical tangents will cause problems
with Newton’s Method in general. So it’s best to use something else like the Secant Method
or Binary Search.
The Desmos applet at https://www.desmos.com/calculator/kgwfrkiyh8 can help with
visualisation of this particular problem. Note that this is a non-zero-rated link!
1
7. Apply Newton’s Method to the equation − a = 0 to derive the following “reciprocal”
x
algorithm:
xn+1 = 2xn − axn 2 ,
which is what your calculator does to find reciprocals without actually dividing. Now use
your answer above to compute 1/1.6984 correct to six decimal places.
(a) Use a graphing programme to sketch the curves of y = xe−x and y = 0.2 on the same
set of axes and determine how many roots there are to the equation above, and roughly
estimate their values.
3
2
-2
-4
-6
-8
-10
-3 -2 -1 0 1 2
Figure 1: The cobweb diagram for xn+1 = 2xn − axn 2 , for a = 1. Fixed points are denoted by green
circles. Note that x? = 0 is unstable, while x? = 1 is stable.
(b) Rewrite the equation above in the form x = g(x), and hence, determine what the itera-
tion xn+1 = g(xn ) should be – there will be two!
A NSWER : Two possible iterations are xn+1 = 0.2exn and xn+1 = ln xn − ln 0.2.
(c) Use both iterations to determine the root(s) of the equation – which iteration works best
for which root(s)?
A NSWER : Playing around here with the Octave code will show you that the itera-
tion containing the exponential converges to the smaller root, x ≈ 0.259171, while the
one containing the logarithms converges to the larger root, x ≈ 2.54264. Note, however,
that for some choices of x0 , the latter iteration can also converge to the smaller root –
investigate this.
(d) Now, try the solution using Newton’s Method and Binary Search.
4
script. Set the tolerance to 10−6 .
xn+1 = xn 4 − 10
and p
xn+1 = − 4 10 + xn .
(c) For the two given iterations above, what are their fixed points, approximately?
A NSWER : The fixed points will be the roots of the equation x4 − x = 10, but we need
to be careful here – not all of the fixed points will be valid for all of the iterations! They
are approximately at x? ≈ −1.697471880884864 and x? ≈ 1.855584561010884, which
could be found using Newton’s Method (for example).
The negative root, as a fixed point, isn’t valid for the second iteration at all (check this
graphically). If we wanted
√ to use this particular root as a fixed point, we’d have to use
the iteration xn+1 = − 4 10 + xn instead.
(d) Determine the stability of the fixed points in each of the iterations. Which iteration
would be useful for finding the roots of the original equation?
30x2
g0 (x) = − ,
(x3 − 1)2
5
so we get that λ ≈ 0.039128912630971 ⇒ |λ| < 1 for x? ≈ 1.855584561010884, so
this fixed point is stable.
We can only use this second iteration to find the positive root (assuming that we didn’t
know it beforehand), as x? ≈ 1.855584561010884 is the only fixed point here. Confirm
this graphically.
(e) Sketch the cobweb diagrams for each iteration, showing what happens to an arbitrary
initial guess, x0 .