Numerical Analysis/Newton's method exercises

From Wikiversity
Jump to navigation Jump to search

In this section we are going to look at a method for approximating solutions to equations. We all know that equations need to be solved on occasion and in fact we’ve solved quite a few equations ourselves to this point. we were able to actually find the solutions, but it’s not always possible to do that exactly and/or do the work by hand. That is where this application comes into play. So, let’s see what this application is all about.

Let’s suppose that we want to approximate the solution to f(x0) and let’s also suppose that we have somehow found an initial approximation to this solution say, x0. This initial approximation is probably not all that good and so we’d like to find a better approximation. This is easy enough to do. First we will get the tangent line to f(x) at x0.

y=f(x0)+f'(x0)(x-x0)

Example:

1)Find a nonzero root of equation x2-sin x using newton's method.

Solution:

Let us take our initial guess as .5

f'(x)=2x-cos x.

now we will use newton's formula to find x2=x1-f'(x1)f(x1)

x2=.5-sin(.5)2(.5)-cos(.5)=2.374

In this way we get x3=1.4702,x4=1.0594,x5=0.9057,x6=0.8727,x7=0.8766,x8=0.8767

2)Find an approximation to 51/2 to ten decimal places with starting point as 2.

51/2 is the root of f(x)=x2-5

so now using the formula,x2=x1-f'(x1)f(x1)

we get,x1=2

x2=2.25

x3=2.236111111111

x4=2.236067977915

x5=2.236067977499

x6=2.236067977499

Exercise

Use Newton's method to approxmate the zero's of function f(x) = x3+2x+2



Algorithm Failures: In some cases the conditions on function necessary for convergence are satisfied, but the point chosen as the initial point is not in the interval where the method converges. In such cases a different method, such as bisection, should be used to obtain a better estimate for the zero to use as an initial point.

Example:Use x0=1 to find the approximation to the solution to f(x)=x1/3 .

using Newton's Formula xn+1=-2xn.

x1=-2

x2=4

x3=-8

x4=16 ..

Because each step produces new approxmation that is far from the root , method fails.

Exercise

Find the roots of the polynomial f(x)=ex-2x with starting point as 1

Quiz[edit]

1

Newton's method for solving f(x) = 0 is

xm+1=xm-f(xm)/f'(xm)
xm+1=xm+f(xm)/f'(xm)
xm+1=xm-f'(xm)/f(xm)
xm+1=xm-f(xm)/f(xm)

2

Newtons method is used to approximate the extrema of a function

true
false

3

Newton's method fails if f'(a) is equal to zero and a is used as an initial value in the iteration process

true
false

4

The square root of 346 using newtons method is

18.6010752
18.5010752
18.7010752
18.4010752

5

Find the roots of the equation x2-4x+15 for x=2 as the initial point using newtons method

5.316624
1.316624
3.667891
Method fails