The Newton-Raphson Method

Section 1.1 - The Geometry of the Newton-Raphson Method

Example 1.1.1

F[x_] = (x^3)-5 (x^2)+3x + 5;

RootsF = NSolve[F[x]==0,x]

RootsPlot = Graphics[{PointSize[0.025], Red, Point[{x,0}/.RootsF]}];

PlotF = Plot[F[x], {x,-3,7}, PlotStyle->{Blue, Thickness[0.007]}];

Show[PlotF,RootsPlot,PlotRange->{{-2,5},{-5,6}}]

FindRoot[F[x]==0,{x,4},WorkingPrecision->20]

F[5]

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

DF[5]

ArrowPlots = Graphics[{Arrowheads[.05], Thickness[0.010], Yellow, Arrow[{{5,-10},{5,-4.5}}],Black,Arrow[{{30/7,-10},{30/7,-4.5}}], Red, Arrow[{{3.9, 10},{3.9,2}}]}];

TangentF = Plot[28x -120,{x,-3,7},PlotStyle->{Black,Thickness[0.007]}];

Show[ArrowPlots,PlotF,TangentF,RootsPlot,PlotRange->{{3.5,5.5},{-20,30}},Axes->True,AspectRatio->2/3]

(Subscript[x, 0])= SetPrecision[5.00,10];

(Subscript[x, 1])= ((Subscript[x, 0])-F[(Subscript[x, 0])]/DF[(Subscript[x, 0])])

F[(Subscript[x, 1])]

DF[(Subscript[x, 1])]

F[(Subscript[x, 1])]-(Subscript[x, 1])DF[(Subscript[x, 1])]

NextIntercept = Solve[F[(Subscript[x, 1])]+DF[(Subscript[x, 1])] (x-(Subscript[x, 1])) ==0, x]

ArrowPlots2 = Graphics[{Arrowheads[.05], Thickness[0.010], Blue, Arrow[{{3.97495, -10}, {3.97495, -4.5}}]}];

TangentF2 = Plot[15.2449 x - 60.5977, {x,-3,7}, PlotStyle->{Red, Thickness[0.007]}];

Show[ArrowPlots, ArrowPlots2,PlotF,TangentF,TangentF2,RootsPlot,PlotRange->{{3.5,5.5},{-20,30}},AspectRatio->1, Axes->True]

(Subscript[x, 0]) = N[5,30];

For[k=1, k≤ 8, k++, (Subscript[x, k]) = ((Subscript[x, k-1])-F[(Subscript[x, k-1])]/DF[(Subscript[x, k-1])]);]

Table[{(Subscript["x", k]), "=", N[(Subscript[x, k]),12]},{k,1,8}]//MatrixForm

(Subscript[x, 0])= N[{0,1,5},30];

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

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

NSolve[F[x]==0,x,WorkingPrecision->15]

Manipulate[TangentLine=F[a]+DF[a](x-a);
AxisIntercept = Solve[F[a]+DF[a](x-a) ==0,x];
PlotIntercept = Graphics[{PointSize[0.025], Black, Point[{x,0}/.AxisIntercept[[1]]]}];
TangentPlot = Plot[TangentLine, {x,-3,7}, PlotStyle->{Red, Thickness[0.007]}, PlotRange->{{-2,5},{-5,6}}, AspectRatio->1];
Show[TangentPlot, PlotF, PlotIntercept, PlotRange->{{-2,5},{-5,6}}, AspectRatio->1],{{a,-1,"a"},-1, 4.5,0.09}]