The Newton-Raphson Method

Section 1.2 - Examples of the Newton-Raphson Method

Example 1.2.1

H[x_] = 8(x^5)-3(x^4)+2(x^3)+9x-5;

Plot[H[x],{x,-10,10},PlotStyle->{Blue, Thickness[0.007]}]

Plot[H[x],{x,-3,3},PlotStyle->{Blue, Thickness[0.007]},PlotRange->{{-3,3},{-30,30}}]

DH[x_] = D[H[x],x]

(Subscript[x, 0])=N[{1,1+I,-1-I},40];

Newt[x_] = x-H[x]/DH[x]

(NewtMat = N[NestList[Newt[#]&,(Subscript[x, 0]),6],9])//MatrixForm

RootsH = {NewtMat[[6,1]],NewtMat[[6,2]], Conjugate[NewtMat[[6,2]]],NewtMat[[6,3]],Conjugate[NewtMat[[6,3]]]}

NSolve[H[x],x]

P = Coefficient[H[x],x,5] Product[x-RootsH[[k]],{k,1,5}]

Chop[Expand[P],(10^(-6))]

H[x]

Example 1.2.1

Example 1.2.1

Example 1.2.1

H[x_] = 8(x^5)-3(x^4)+2(x^3)+9x-5;

Plot[H[x],{x,-10,10},PlotStyle->{Blue, Thickness[0.007]}]

Plot[H[x],{x,-3,3},PlotStyle->{Blue, Thickness[0.007]},PlotRange->{{-3,3},{-30,30}}]

DH[x_] = D[H[x],x]

(Subscript[x, 0])=N[{1,1+I,-1-I},40];

Newt[x_] = x-H[x]/DH[x]

(NewtMat = N[NestList[Newt[#]&,(Subscript[x, 0]),6],9])//MatrixForm

RootsH = {NewtMat[[6,1]],NewtMat[[6,2]], Conjugate[NewtMat[[6,2]]],NewtMat[[6,3]],Conjugate[NewtMat[[6,3]]]}

NSolve[H[x],x]

P = Coefficient[H[x],x,5] Product[x-RootsH[[k]],{k,1,5}]

Chop[Expand[P],(10^(-6))]

H[x]

Example 1.2.2

Clear[H];

H[x_] = (E^x); K[x_] = Cos[2 x] + 5;

Plot[{H[x],K[x]},{x,0,3},PlotStyle->{{Red,Thickness[0.007]},{Blue, Thickness[0.007]}}, PlotRange->{{0,3},{0,15}}]

F[x_] = H[x]-K[x]

DF[x_] = D[F[x],x]

(Subscript[x, 0])=SetPrecision[2,20];

Newt[x_] = x-F[x]/DF[x]

(NewtMat = N[NestList[Newt[#]&,(Subscript[x, 0]), 5],12])//MatrixForm

Example 1.2.3

F[x_] = SetPrecision[Tan[x]-1.26195000000000000, 20]

DF[x_] = D[F[x],x]

Newt[x_] = x-F[x]/DF[x]

(Subscript[x, 0]) = SetPrecision[1,20];

(NewtMat = SetPrecision[NestList[Newt[#]&, (Subscript[x, 0]),5],20])//MatrixForm

{ArcTan[1.26195], ArcTan[SetPrecision[1.26195,20]]}

Example 1.2.4

(5^13)

(6^13)

F[x_] = (x^13)-8319407225;

DF[x] = D[F[x],x];

Newt[x_] = x-F[x]/DF[x]

(Subscript[x, 0])= SetPrecision[6,20];

(NewtMat = SetPrecision[NestList[Newt[#]&, (Subscript[x, 0]),5],12])//MatrixForm

N[(8319407225^(1/13)),12]