@Matt - Here's an easy construction for square roots approximations of any arbitrary numbers. No need for matrices.
Use
Newton's method for solving f(x)=x
2-a=0. You know f'(x). It is 2x.
x
new = x - f(x)/f'(x) = x - (x^2-a)/(2x) = (x^2+a)/2x
...or (x+a/x)/2 as frequently taught in schools
For \(\sqrt 2\): use a=2 and apply this repeatedly:
Code:
a=2; x=1;
x=(x+a/x)/2
3/2
x=(x+a/x)/2
17/12
x=(x+a/x)/2
577/408
x=(x+a/x)/2
665857/470832
x=(x+a/x)/2
886731088897/627013566048
x=(x+a/x)/2
1572584048032918633353217/1111984844349868137938112
For \(\sqrt 10\): use a=10 and apply this repeatedly:
Code:
a=10; x=3;
x=(x+a/x)/2
19/6
x=(x+a/x)/2
721/228
x=(x+a/x)/2
1039681/328776
x=(x+a/x)/2
2161873163521/683644320912
x=(x+a/x)/2
9347391150304592810234881/2955904621546382351702304
...
Now, try the same to get fast approximation of a cubic root of 2:
x
new = x - f(x)/f'(x) = x - (x
3-a)/(3x
2) = (2x^3+a)/(3x^2)
...