You are on page 1of 3

MATH 3241 Suggested solution to Assignment 2

1) (4 marks)
pg. 54. 6) c)
Use the Bisection method to find p4 for solving x2 4x+lnx=0 for 1 x 2 and 2 x 4

Table 1: The Bisection method for x2 4x+lnx=0 on 1 x 2


n an pn bn f (an ) f (pn ) f (bn )
1 1 1.5 2 1 0.1554 -0.6931
2 1 1.25 1.5 1 0.3394 -0.1554
3 1.25 1.375 1.5 0.3394 0.0722 -0.1554
4 1.375 1.4375 1.5 0.0722 -0.0470 -0.1554

Thus p4 =1.4375.

Table 2: The Bisection method for x2 4x+lnx=0 on 2 x 4


n an pn bn f (an ) f (pn ) f (bn )
1 2 3 4 -0.6731 -0.0986 2.6137
2 3 3.5 4 -0.0986 0.9972 2.6137
3 3 3.25 3.5 -0.0986 0.3839 0.9972
4 3 3.125 3.25 -0.0986 0.1262 0.3839

Thus p4 =3.125.

b) To find the number of iterations use the error bound formular:

|a1 b1 |
105
2n
|0.5 1.5|
105
2n
1
105
2n
n = log2 (105 )
n = 16.60

Thus we need 17 iterations to guarantee an error less than 105 .

1
MATH 3241 Suggested solution to Assignment 2

2) (2 marks)
Find p3 with p0 = 1.8 using the fixed point iteration method to solve x4 3x2 3 = 0 on [1,2].

First we need to get our g(x),

x4 3x2 3 = 0
x4 = 3x2 + 3
4
x = 3x2 + 3

Thus applying the fixed point iteration with p0 = 1.8 scheme we attain:

Table 3: The Fixed point Iteration Scheme to solve x4 3x2 3 = 0


n pn
0 1.8
1 1.8885
2 1.9239
3 1.9379

Thus the approximation for p3 = 1.9379.

3) (5 marks)
Compute p3 using p0 = 2
3
to find the fixed point of x = 2x in [ 13 , 1]. Show the fixed point is convergent.
g(x) from [ 13 , 1] is into [ 13 , 1], and we can further check and see that g 0 (x) = 2x ln 2, which decreases and
satisfies the |g 0 (x)| < k < 1. Thus by Theorem, we know the fixed point scheme is convergent.
Thus solving for the fixed point we attain:

Table 4: The Fixed point Iteration Scheme to solve x = 2x


n pn
0 0.66667
1 0.62990
2 0.64619
3 0.63896

4) (4 marks)
a) Use Newtons Method to compute p2 of f (x) = x3 cos x using p0 = 1. Can we use p0 = 0.

We cannot use p0 = 0, because f 0 (x) = 3x2 + sin x evaluated at 0 gives f 0 (0) = 0. Thus the New-
tons Method cannot be performed.
Using p0 = 1, we attain the following values:
Thus our approximation for p2 = 0.8657.
b) Using the secant method, we attain the following vales:
Thus our approximation for p3 = 1.2521.

2
MATH 3241 Suggested solution to Assignment 2

Table 5: The Newtons Method to Solve f 0 (x) = 3x2 + sin x


n pn
0 -1
1 -0.8803
2 -0.8657

Table 6: The Secant Method to Solve f 0 (x) = 3x2 + sin x


n pn
0 -1
1 0
2 -0.6851
3 -1.2521

5) (5 marks)
Construct a code to solve for the roots of f (x) = 4x cos(3x) + (x 2)2 2 = 0.
Running the code, we attain the following results. There are five roots. You also need to hand in your
running procedure and solutions.

Table 7: The roots


p0 solutions
0.5 0.5426
1.5 1.6666
2.5 2.5630
3.5 3.6487
4.5 4.8167

You might also like