Estimate #sqrt(12)# using Newton-Rhapson?

3 Answers
Nov 16, 2017

Newton's method says that #f(x)~~l(x)=f(x_0)+f'(x_0)(x-x_0)#

#sqrt(12)# can be found by the function #f(x)=x^2-12#

We know that #3<sqrt(12)<4#, so #x_0=3#

#f'(x)=2x#

1st iteration:
#l(x)=(3^2-12)+2(3)(x-3)#
#=-3+6(x-3)#
#=-3+6x-18#
#=6x-21#

#6x-21=0#
#x=21/6=7/2=3.5#

Now we iterate with #x_0# now being equal to #7/2#

2nd iteration:
#l(x)=((7/2)^2-12)+2(7/2)(x-7/2)#
#=-1/4+7(x-7/2)#
#=-1/4+7x-49/2#
#=7x-99/4#

#7x-99/4=0#

#x=99/28~3.54#

3rd iteration:
#l(x)=((99/28)^2-12)+2(99/28)(x-99/28)#

#=393/784+99/14(x-99/28)#

#=393/784+(99x)/144-9801/392#

#=(99x)/14-19209/784#

#(99x)/14-19209/784=0#

#x=6403/1848~~3.4648#

4th iteration:
#l(x)=((6403/1848)^2-12)+2(6403/1848)(x-6403/1848)#

#=5.025*10^(-3)+6403/924(x-6403/1848)#

#=5.025*10^(-3)+(6403x)/924-24.01#

#=(6403x)/924-24.005#

#(6403x)/924-24.005=0#

#x~~3.4641~~sqrt(12)#

Nov 16, 2017

#3.4641#

Explanation:

This link here lists several methods to compute square roots: https://en.wikipedia.org/wiki/Methods_of_computing_square_roots

The digit-by-digit method is an extremely useful method to find exact answers but is extremely slow.

A faster method is to use Newton's method, but it can only be used to approximate square roots.

Newton's method states that the zeros of a function #P# can be approximated as #x_1=x_0-(P(x_0))/(P'(x_0))#, where #x_0# is our initial guess, #x_1# is our next guess, and #P'# is the derivative of #P# with respect to #x#. Finding the square root of a number #A# is essentially finding a number #k# such that #k^2-A=0#. Substituting these in, we get #x_1=x_0-(x_0^2-A)/(2x_0)=(x_0^2+A)/(2x_0)#.

This means that, if we have a guess #x_0#, we can get a better guess by calculating #(x_0^2+A)/(2x_0)#, where #A# is the number which square root we are trying to find. We can do this again with our new guess to get more accurate answers.

Take note of three things. First, our new guesses will always be slightly larger than the actual answer (except when the guess is exactly the answer, then the new guess would be equal to the previous guess). We can round our final answer down to account for this. Second, some guesses may not work (for example, if our first guess is #0#, we would be dividing by #0#). Third, the closer the initial guess is to the actual number, the better the new guess would be.

Let's first try finding the square root of #121#. #121# is really close to #100#, which square root is #10#. So guess #x_0=10# first. Then, compute #(x_0^2+A)/(2x_0)=(10^2+121)/(2*10)=(100+121)/(2*10)=221/20=11 1/20#. This is pretty close (slightly larger) to the actual answer #11#. You can repeat the whole process again to get more accurate answers.

Now, find the square root of #12#. Suppose that we guess the number #3#. Then, #(3^2+12)/(2*3)=21/6=3.5#. Let us now put #3.5# in the equation. Then, #((3.5)^2+12)/(2*(3.5))=(24.25)/7=3.4642857...#. Since the new estimate is always larger, we should always round down, such as to #3.4642#.

The following list shows how the formula produces more accurate answers each iteration:

  • #x_0=3# (This is our initial guess)
  • #x_1=3.5#
  • #x_2=3.4642857142857144...#
  • #x_3=3.4641016200294548...#
  • #x_4=3.4641016151377544...#

After #x_3#, the five digits after the decimal point are not changing anymore, which means that they are already accurate. Thus, rounding to four decimal places, the answer is #3.4641#.

The actual answer is #sqrt(12)=3.4641016151377544...#

Nov 16, 2017

# sqrt(12) = 3.4641# to 4 dp via Newton-Rhapson

Explanation:

We want to find #sqrt(12)#, Let:

# x = sqrt(12) => x^2=12 #
# :. x^2-12 = 0 #

Let:

# f(x) = x^2-12 #

Our aim is to solve #f(x)=0#. To find the solution numerically, using Newton-Rhapson method we use the following iterative sequence

# { (x_1,=x_0), ( x_(n+1), = x_n - f(x_n)/(f'(x_n)) ) :} #

Therefore we need the derivative:

# \ \ \ \ \ \ \f(x) = x^2-12 #
# :. f'(x) = 2x #

So our iterative formula is:

# { (x_1,=x_0), ( x_(n+1), = x_n - (x^2-12)/(2x) ) :} #

Then using excel working to 8dp with #x_0=3#, we can tabulate the iterations as follows:

SteveM using Microsoft Excel

We get convergence to #8 \ dp# with #4# iterations.

We could equally use a modern scientific graphing calculator as most new calculators have an "Ans" button that allows the last calculated result to be used as the input of an iterated expression.

And we conclude that the solution is (to 4dp):

# x = 3.4641#

The actual value via a calculator is:

# sqrt(12) =3.46410161 ... #