Hello, i need to compute the formula y=arctan(x) with Newton’s method.
I already have a code for the Newton method.
Newton[fn_, dfn_, X0_, iter_] := Module[{X1 = X0},
Print[StringForm["X0= `` ; Y0= ``",
ToString[NumberForm[N[X1], {8, 5}]], ScientificForm[N[fn[X1]], 4]]];
Do[{X1 = X1 - fn[X1]/dfn[X1],
Print[StringForm["X`1`= `2` ; Y`1`= `3`", i,
ToString[NumberForm[N[X1], {8, 5}]],
ScientificForm[N[fn[X1]], 4]]]}, {i, iter}]
]
but I need to calculate arctan, how to write it here?
I am not very good with coding, could anyone help, please?
