Using Newton's method The th root of a positive real number can be computed with
Newton's method, which starts with an initial guess , which is also a positive real number, and then iterates using the
recurrence relation x_{k+1} = x_k-\frac{x_k^n-A}{nx_k^{n-1}} until the desired precision is reached. For computational efficiency, the recurrence relation can be rewritten For large values of
n and higher requirements for precision, a more rapid algorithm than Newton's method for finding the
nth root is to use a truncated
Taylor series with a
Padé approximant.
Using the Viète technique showing P(4,1) = 4. The technique of François Viète, published c. 1600, can be used to perform digit-by-digit calculation of principal roots of decimal (base 10) numbers. This method is based on the
binomial theorem and is essentially an inverse algorithm solving (10 x+y)^n = \sum_{k=0}^n P(n, k) (10 x)^{n-k} y^k where P(n, k), the
binomial coefficient, is the
kth entry on the
nth row of
Pascal's triangle. To compute the root of a number
C, choose a series of approximations x_i^n, i = 0, 1, \ldots \text{ with } x_0 = 0 that satisfy x_i^n \le C, where the difference between x_{i+1} and x_i is the next digit in the approximation. The
decimal fraction y_i is chosen to be the largest number with a single
significant digit that satisfies 10 x_i + y_i = 10 x_{i+1}, \text{ where } x_{i+1}^n \le C then per the binomial theorem (10 x_i+y)^n - (10 x_i)^n = \sum_{k=0}^{n-1} P(n, k) (10 x_i)^{n-k} y_i^k \le 10^n(C - x_i^n) The term 10^n(C - x_i^n) is just a 10^n multiple of the
ith remainder, C - x_i^n. Using this expression, any positive principal root can be computed, digit-by-digit, as follows. Write the original number in decimal form. The numbers are written similar to the
long division algorithm, and, as in long division, the root will be written on the line above. Now separate the digits into groups of digits equating to the root being taken, starting from the decimal point and going both left and right. The decimal point of the root will be above the decimal point of the radicand. One digit of the root will appear above each group of digits of the original number. Beginning with the left-most group of digits, do the following procedure for each group: • Starting on the left, bring down the most significant (leftmost) group of digits not yet used (if all the digits have been used, write "0" the number of times required to make a group) and write them to the right of the remainder from the previous step (on the first step, there will be no remainder). In other words, multiply the remainder by 10^n and add the digits from the next group. This will be the '
current value c'''''. • Find
p and
x, as follows: • Let p be the
part of the root found so far, ignoring any decimal point. (For the first step, p = 0 and 0^0 = 1). • Determine the greatest digit x such that y \le c. • Place the digit x as the next digit of the root, i.e., above the group of digits you just brought down. Thus the next
p will be the old
p times 10 plus
x. • Subtract y from c to form a new remainder. • If the remainder is zero and there are no more digits to bring down, then the algorithm has terminated. Otherwise go back to step 1 for another iteration.
Examples Find the square root of 152.2756 For clarity, the value of the chosen digit
x is in red while the current digital tally is in blue. Algorithm terminates: Answer is 12.34
Find the cube root of 4192 truncated to the nearest thousandth The desired precision is achieved. The cube root of 4,192 is 16.124...
Logarithmic calculation The principal
nth root of a positive number can be computed using
logarithms. Starting from the equation that defines
r as an
nth root of
x, namely r^n=x, with
x positive and therefore its principal root
r also positive, one takes logarithms of both sides (any
base of the logarithm will do) to obtain n \log_b r = \log_b x \quad \quad \text{hence} \quad \quad \log_b r = \frac{\log_b x}{n}. The root
r is recovered from this by taking the
antilog: r = b^{\frac{1}{n}\log_b x}. (Note: That formula shows
b raised to the power of the result of the division, not
b multiplied by the result of the division.) For the case in which
x is negative and
n is odd, there is one real root
r which is also negative. This can be found by first multiplying both sides of the defining equation by −1 to obtain |r|^n = |x|, then proceeding as before to find |
r|, and using . ==Complex roots==