Use the Newton Raphson Method of Quickly Finding Roots

Isaac Newton and Joseph Raphson came up with a very fast method for finding roots. However, it does not always converge, especially if the root is less than .5 as I understand it, nor if the initial guess is not close enough. I will show 2 applications of the method by showing you how to formulate a Microsoft Excel worksheet to calculate the results of the square root of 685 and the solution of the Neutral Operation of (a+b) = a^b where b is known and we wish to solve for a.

What the image below does not show, but should, is that x1's tangent (at the perpendicular up from X1 to the curve) becomes the basis for the new guess at the root, x2, which is a good deal closer as you can imagine from the image.

Steps

  1. Format cell B1 of a new worksheet with a thick outline and color canary yellow -- this means that it is an input cell. In cell A1, type, "Square" (w/o the quotation marks) and adjust column width to fit the phrase. Select column B and Format Cells Number for 14 decimal places. Expand the column width if need be.
  2. Input the number of which the root is to be found in cell B1. In this example, it is 685.
  3. In cell A1, type "Square". In cell A2, type "InitialROOTGuess" (w/o the quotation marks). Since 25^2 = 625, and 30^2 = 900, we will use 25. Please input 25 in cell B2
  4. Select cell range A1:B2 and Insert Name Create in Left Column. Doing so will assign the defined variable name "Square" to cell B1, as well as the defined variable name "InitialROOTGuess" to cell B2.
    • The Newton-Raphson method is that guess X(1) (read X sub 1) = X(0) + f(X(0))/f'(X(0)). In this case, where x^2 = 685, f(x) = x^2 - 685 = 0 and f'(x) = 2x. Therefore, into cell B3, please input the following formula (w/o quotation marks) "=InitialROOTGuess-((InitialROOTGuess^2-Square)/(2*InitialROOTGuess))"
  5. And now select cell range B4:B15 and input the following formula, "=B3-((B3^2-Square)/(2*B3))" and Edit Fill Down so that the formula calculates all the way down to cell B15 for large numbers. The formula will be taking each previous guess and using it to get a better current answer by a factor of 2 more significant digits each computation.
    • You should see the correct answer, 26.1725046566048, which is the square root of 685, in cell B6. Please notice how fast the Newton-Raphson method arrived at the correct answer.
  6. Bear in mind that this method can find roots for complicated equations like x^5 * (4x^2 +1)^2 so long as one can take the first derivative (see Calculus I and II). For simple expressions such as 4x^3, to obtain the derivative, one takes the exponent down and multiplies it as a (combined) coefficient, and reduces the exponent by 1 power, so the derivative of x^n = nx^(n-1) and the derivative of 4x^3 = 12x^2. If there is a constant such as π in the expression as a factor, that is treated as the 4 just was above in 4x^3 -- it remains. If there is a lone x, such as in the expression 4x^3 - x, the derivative of that is 12x^2 - 1, since x^0 = 1. if there is a constant added such as 4x^3 + 10, it is dropped, and the derivative is 12x^2.
  7. Find the answer to the Neutral Operation of (a+b) = a^b, called "neutral" between the operations of Addition and Exponentiation on either side of the equals sign.
  8. Select Row 1 and Insert Row. In the new cell A1, type "Power" (w/o quotation marks). Format cell C1 with a border and red font and input 10 into cell C1.
  9. Try to find (a+b) = a^b when b=10, i.e. when Power = 10. Therefore, we have (a+10) = a^10, so F(X) = a^10 - a - 10 and F'(x) = 10*a^9 - 1. Our InitialROOTGuess will be 1 since 1+10 = 11 and 1^10 = 1, but 2+10 = 12 and 2^10 = 1024 (which is much too large). We do not know the "square", which is actually a^10 -- not a square -- or sum (a+b) yet. Do not input an InitialROOTGuess yet however. Let's preserve the square root function we made in columns A and B by moving over and working in column C.
  10. Select cell C2 and Insert Define Name InitialGuess for it and you may type "InitialGuess" into cell B2 if you so choose. Select cell C1 and Insert Name Define Powerful for it. You may type "Powerful" into B1 if you so choose. Select cell C3 and input the following formula (w/o quotes): "=InitialGuess+(((InitialGuess)^Powerful)-Powerful-InitialGuess)/(Powerful*(-InitialGuess)^(Powerful-1)". The evaluated result should equal 2. This has modified the derivative in the denominator somewhat by dropping the constant; in this case, that is necessary, along with changing the sign of the InitialGuess in the final term. Call it the Garthwaite method if you please -- it is part of trying to arrive at the base instead of the root.
  11. Select cell range C4:C15 and input into C4 the formula "=C3+(((C3)^Powerful)-Powerful-C3)/(Powerful*(-C3)^(Powerful-1))" and Edit Fill Down so that cell C15 contains the computed result of 1.27411386474511, which is the answer we seek.
  12. (1.27411386474511 + 10) = 1.27411386474511^10 = 11.2741138647451 and the problem of (a+b) = a^b when b = 10 has been solved.
    • An InitialGuess of -1 will result in the answer -1.24233531640777 and that is also correct in that (-1.24233531640777 + 10) = -1.24233531640777^10 = 8.75766468359223
  13. Save the workbook. You're done!
  14. Final image:

  15. See the article How to Create a Spirallic Spin Particle Path or Necklace Form or Spherical Border for a list of articles related to Excel, Geometric and/or Trigonometric Art, Charting/Diagramming and Algebraic Formulation.
  16. For more art charts and graphs, you might also want to click on Microsoft Excel Imagery, Mathematics, Spreadsheets or Graphics to view many Excel worksheets and charts where Trigonometry, Geometry and Calculus have been turned into Art, or simply click on the category as appears in the upper right white portion of this page, or at the bottom left of the page.



Tips

  • Only the Calculus seems capable of managing the problem.
  • The method may be self-iterative and chaotic in some instances and thus fractal. Fractals can be a lot of fun!

Warnings

  • Please see the cited reference below and read it carefully for warnings concerning divergence and other methods used for convergence to the root.

Related Articles

Sources and Citations