using Matlab Let fx x2 a Show that the Newtons Method lead


using Matlab

Let f(x) = x^2 - a. Show that the Newton\'s Method leads to the recurrence X_n + 1 = 1/2 (X_n + a/X_n) Use this, with 2 as starting point, to find a fraction that is within 10^-4 of Squareroot 2.

Solution

According to newton\'s formula,

xn+1 = xn - f(x)/f\'(x)

Therefore, xn+1 = xn - (xn2 - a)/2xn

which is, 1/2 * (xn + a/xn)

Hence, proved.

x = 2; %initializing x
a = 2; %choosing a random a
while (x>sqrt(2)+0.0001) || (x<sqrt(2)-0.0001)
    x = 0.5*(x+a/x); %recurrence formula
end
disp(x); %displaying x

 using Matlab Let f(x) = x^2 - a. Show that the Newton\'s Method leads to the recurrence X_n + 1 = 1/2 (X_n + a/X_n) Use this, with 2 as starting point, to find

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site