f1[x_]:=x^2-2
f21[x_]:=Cos[x]
f3[x_]:=x^3-7
f4[x_]:=x^3-3x^2+x-1
newton[f_,x0,a_,b_,n_]:=
Module[{list=NestList[#-f[#]/f'[#]&,x0,n]},
Column[{TraditionalForm@Text@Style[Row[{HoldForm[(Subscript[{(Subscript[x, k])}, k=0]^n)]," = ",list}],14],
Plot[f[x],{x,a,b},PlotRange->All,AxesLabel->{Style[x,16],Style[y,16]},
PlotStyle->Thickness[.006],
Epilog->{{Red,Thickness[.002],Arrowheads[.03],Arrow[Most[Flatten[Map[{{#,0},{#,f[#]}}&,list],1]]]},
{PointSize[0.015],Point[{x0,0}]}},
ImageSize->{600,325}]},Center]];
newton[f21,N[0.6],0,2Pi,1]

Manipulate[newton[d,N[x0],0,2Pi,n],
{{d,f21,"function"},{f1->TraditionalForm[x^2-2],f21->TraditionalForm[Cos[x]],f3->TraditionalForm[x^3-7],f4->TraditionalForm[x^3-3x^2+x-1]},
ControlType->PopupMenu},{{n,1,"n"},{0,1,2,3,4,5,6},ControlType->SetterBar},{{x0,.6,Subscript["x","0"]},0.01,6.11,Appearance->"Labeled"}, SaveDefinitions->True]

TraditionalForm[x^2-Sin[x]]

Plot[f4[x],{x,0,2 Pi},
PlotRange->All,
AxesLabel->{Style["x",Red,Bold,Italic,16],Style["y",Blue,Bold,Italic,16]},
PlotStyle->Thickness[0.008],
ImageSize->{300,200}]

Manipulate[Plot[d[x],{x,0,2 Pi},
PlotRange->All,
AxesLabel->{Style["x",Red,Bold,Italic,16],Style["y",Blue,Bold,Italic,16]},
PlotStyle->Thickness[0.008],
ImageSize->{300,200}],
{d,{f1-> "Първа функция",f21->"Втора функция",f3-> x^3-7,f4->TraditionalForm[x^3-3x^2+x-1]}}
]