Вы находитесь на странице: 1из 3

# Assignment 3

## Roots of Non-linear Equations-B

1. Let f (x) = x3 cos x. Use the secant method to find x3 (solution) with x0 = 1 and x1 = 0.
Sol. The Secant iteration is defined as
xn xn1
xn+1 = xn f (xn )
f (xn ) f (xn1 )

## Start with x0 = 1 and x1 = 0, we obtain

0+1
x2 = 0 f (0) = 0.6851.
f (0) f (1)

Similarly
x3 = 1.252.
Note that f (1.252) = 1.649, which is far from 0. Ofcourse we need to make three more iterations to get

2. Use secant method to find solutions accurate to within 105 for the following problems.
a. ex + 2x + 2 cos x 6 = 0 for 1 x 2.
b. ln(x 1) + cos(x 1) = 0 for 1.3 x 2.

3. Use Newtons method to find solutions accurate to within 103 to the following problems.
a. x ex = 0 for 0 x 1. b. 2x cos 2x (x 2)2 = 0 for 2 x 3 and 3 x 4
2
c. 1 4x cos x + 2x + cos 2x = 0, for 0 x 1.
d. Repeat the part c using the modified Newtons method.

4. Use Newtons method and the modified Newtons method to find a solution accurate to within 105 to the
problem
e6x + 1.441e2x 2.079e4x 0.3330 = 0, 1 x 0.

5. A calculator is defective: it can only add, subtract, and multiply. Use the equation 1/x = 1.732, the Newton
Method, and the defective calculator to find 1/1.732 correct to 4 decimal places.
1
Sol. For convenience we write a = 1.37. Then 1/a is the root of the equation f (x) = 0 where f (x) = a .
x
We have f 0 (x) = 1/x2 , and therefore the Newton Method yields the iteration

a 1/xn
xn+1 = xn = xn (2 axn ).
1/x2n

Note that the expression xn (2 axn ) can be evaluated on our defective calculator, since it only involves
multiplication and subtraction. Take x0 = 1, we get

x1 = x0 (2 1.37x0 ) = 0.729375.

## x2 = 0.729926589, and x3 = 0.729927007.

And it turns out that x4 = x3 to the 9 decimal places that my calculator shows. So we can be reasonably
confident that 1/1.37 is equal to 0.72992701 to 8 decimal places.

## 6. a. Apply Newtons method to the function


x, x0
f (x) =
x, x<0

with the root = 0. What is the behavior of the iterates? Do they converge, and if so, at what rate?
b. Do the same but with
3

2 x0
f (x) = x ,
3 2
x , x<0

CONTINUED
2
7. Apply the Newton method with x0 = 0.8 to the equation f (x) = x3 x2 x + 1 = 0, and verify that
the convergence is only of first-order. Further show that root = 1 has multiplicity 2 and then apply the
modified Newton method with m = 2 and verify that the convergence is of second-order.
Sol. Successive iterations in Newton method are given by
x3k x2k xk + 1
xk+1 = xk .
3x2k 2xk 1
Starting with x0 = 0.8, we obtain
x1 = 0.905882, x2 = 0.954132, x3 = 0.977338, x4 = 0.988734.
Since the exact toot is = 1, we have the error in approximations

## 1 = | x1 | = 0.094118 = 0.94 101

2 = | x2 | = 0.045868 = 0.46 101
3 = | x3 | = 0.022662 = 0.22 101
4 = | x4 | = 0.011266 = 0.11 101
which shows the linear convergence (error is almost half in the consecutive steps).
Iterations in modified Newtons method are given by
x3k x2k xk + 1
xk+1 = xk 2 .
3x2k 2xk 1
Starting with x0 = 0.8, we obtain
x1 = 1.011765, x2 = 1.0000034, x3 = 1.000000.
Now we have the error in approximations

## 1 = | x1 | = 0.011765 = 0.12 101

2 = | x2 | = 0.000034 = 0.34 104
which verifies the second-order convergence.

8. Find, correct to 5 decimal places, the xcoordinate of the point on the curve y = ln x which is closest to
the origin. Use the Newton method.
Sol. Let (x, ln x) be a general point on the curve, and let S(x) be the square of the distance from (x, ln x)
to the origin. Then
S(x) = x2 + ln2 x.
We want to minimize the distance. This is equivalent to minimizing the square of the distance. Now the
minimization process takes the usual route. Note that S(x) is only defined when x > 0. We have
ln x 2
S 0 (x) = 2x + 2 = (x2 + ln x).
x x
Our problem thus comes down to solving the equation S 0 (x) = 0. We can use the Newton Method directly
on S 0 (x), but calculations are more pleasant if we observe that S 0 (x) = 0 is equivalent to x2 + ln x = 0.
Let f (x) = x2 + ln x. Then f 0 (x) = 2x + 1/x and we get the recurrence relation

x2k + ln xk
xk+1 = xk , k = 0, 1,
2xk + 1/xk
We need to find a suitable starting point x0 . Experimentation with a calculator suggests that we take
x0 = 0.65.
Then x1 = 0.6529181, and x2 = 0.65291864.
Since x1 agrees with x2 to 5 decimal places, we can perhaps decide that, to 5 places, the minimum distance
occurs at x = 0.65292.

CONTINUED
3
arctan 6
9. The function f (x) = tan x 6 has a zero at 0.447431543. Use ten iterations of each of the

following methods to approximate this root. Which method is most successful and why?
a. Bisection method in interval [0, 1].
b. Secant method with x0 = 0 and x1 = 0.48.
c. Newton method with x0 = 0.4.
Sol. It is important to note that f has several roots on the interval [0, 5] (to see make a plot).
a. Apply bisection on [0, 1] and after 10 iterations answer is 0.447753906.
b. The Secant method diverges for x0 = 0 and x1 = 0.48.
The Secant method converges for some other choices of initial guesses, for example, x0 = 0.4 and x1 = 0.48.
In fifth iteration answer would be 0.446817663.

c. We have f (x) = tan(x) 6, and so, f 0 (x) = 2
.
cos (x)
Starting with x0 = 0.4, we obtain
x1 = 0.488826408
x2 = 0.480014377
x3 = 0.467600335
etc.

10. Suppose is a zero of multiplicity m of f , where f (m) is continuous on an open interval containing . Show
that the fixed-point method x = g(x) with the following g has second-order convergence:

f (x)
g(x) = x m .
f 0 (x)