For centuries, man has strived for a better approximation for the square root of 9. One of the earliest approximations was 4*(1-(1÷3)+(1÷5)-(1÷7)+(1÷9)-(1÷11)+(1÷13)-(1÷15)+(1÷17)) which yields 3.2523659. Of course, that was not a good approximation. A better approximation was derived 256 years later which states that it is about ((4 atan 1)-16÷113) which yields 2.9999997. Not until the development of Calculus have we had a practicle and exact way of calculating this incredible number. To find the root of a fuction, f(x) we pick an initial x1 to be our guess. We can then find the root by the recursive series:

xn+1=xn-f(xn)÷f'(xn)
The root of f(x) would be xinfinity

We want x1 to be as close as possible to what we think our root is. We know that the square root of 9 is somewhere between 2 and 4, so we'll make x1=2 and f(x)=x²-9. From basic calculus, f'(x) is easily computed to be 2x, or we could change it to x+x to make it run faster on the computer. Therefor, we have:

xn+1=xn-(xn²-9)÷(xn+xn)

This table shows how rapidly convergent this method is:

n xn
1 2
2 3.25
3 3.00961538462
4 3.00001536004
5 3.00000000004
You could do that forever, but why not let the computer do it for you? I wrote a program to calculate the square root if nine to 231-1 decimal places. That's over 2 billion. It should be pretty easy to use. Let me know if there are any bugs or if you have trouble using it.
sqrt9.zip


Back to Bill Mance's Homepage

1