nth root algorithm | principal nth root
TheprincipalnthrootAn{displaystyle{sqrt[{n}]{A}}}ofapositiverealnumberA,isthepositiverealsolutionoftheequationxn=A{displaystylex{n}=A}.ForapositiveintegerntherearendistinctcomplexsolutionstothisequationifA>0{displaystyleA>0},butonlyoneispositiveandreal.UsingNewtonsmethod[edit]Newtonsmethodisamethodforfindingazeroofafunctionf(x).Thegeneraliterationschemeis:Makeaninitialguessx0{displaystylex_{0}}Setxk+1=xk−f(xk)f′(xk){displaystylex_{k+1}=x_{k}-{frac{f(x_{k})}{f(x_{k})}}}Repeatstep2untilt...
The principal nth root An{displaystyle {sqrt[{n}]{A}}} of a positive real number A, is the positive real solution of the equation xn=A{displaystyle x{n}=A}. For a positive integer n there are n distinct complex solutions to this equation if A>0{displaystyle A>0}, but only one is positive and real.
Using Newtons method[edit]Newtons method is a method for finding a zero of a function f(x). The general iteration scheme is:
Make an initial guess x0{displaystyle x_{0}} Set xk+1=xk−f(xk)f′(xk){displaystyle x_{k+1}=x_{k}-{frac {f(x_{k})}{f(x_{k})}}} Repeat step 2 until the desired precision is reached.The nth root problem can be viewed as searching for a zero of the function
f(x)=xn−A{displaystyle f(x)=x{n}-A}So the derivative is
f′(x)=nxn−1{displaystyle f{prime }(x)=nx{n-1}}and the iteration rule is
xk+1=xk−f(xk)f′(xk){displaystyle x_{k+1}=x_{k}-{frac {f(x_{k})}{f(x_{k})}}} =xk−xkn−Anxkn−1{displaystyle =x_{k}-{frac {x_{k}{n}-A}{nx_...