When approximating values of roots (i.e square root of 2 etc) using Newton's method, why can't you make f(x)=x-sqrt(2)=0. Instead all the books use f(x)=x^2-2=0. Can anybody explain it to me? thanks.
Differentiate f(x) = x - sqrt2
f'(x) = 1, therefore there is no x value that you can sub in the approximation for the root, and thus you cannot figure out an approximation of the root.
I think a proper explanation of why your function doesn't work really needs an explanation of how Newton's method works. I wrote this up last night but decided not to post it since it's so lengthy and thought maybe someone else could explain it a little better in the mean time.
It's the best I can do without a piece of paper, a pen and some hand waving If you're happy with just knowing that the derivative of your curve has no 'x' in it then that is fine, ignore this post
Newton's method works by looking at where some curve cuts the x-axis AND where that curves' tangent line, at some point, cut the x-axis (ie. when y = 0 and when y' = 0). Yes, both your curve and the teachers curve cut the x-axis at sqrt(2) but the tangent line of your function, at ANY x value, cuts the x-axis in the same spot (sqrt(2)) -- basically we're none the wiser as to what this number actually is.
That's alot of information I know, so the best way to see what I'm saying is to draw the line y = x - sqrt(2) and then draw the tangent line to your line at ANY point (x, x - sqrt(x)).
For the teachers function, same deal, draw a picture of the curve of the curve y = x2 - 2. Now, draw the tangent line to this curve at say, x = 2 (y = 4x - 6 -- that is, a curve with slope 4 going through the point (2, 2)). Notice how both curves cut the x-axis reasonably close?
Newton's method exploits this and uses where this new line cuts the x-axis to approximate the value of where the original curve cuts the x-axis (sqrt(2)). Instead of having to stuff around with line formulas and gradients and stuff there is an easy formula to work it all out for you (derivation in the spolier, ignore it if you want) ...
We know the equation for a line is given by:
y - y_1 = m(x - x_1).
We give an initial approximation and call it x_1. f(x_1) gives y_1
y - f(x_1) = m(x - x_1)
The gradient, m, of this line is given by f'(x_1),
y - f(x_1) = f'(x_1)(x - x_1)
The x-intercept of this line, x = some number, lets call it x_2, is given when y of this new line = 0.
0 - f(x_1) = f'(x_1)(x_2 - x_1)
Solving for x_2 (because that's our only unknown at this point) gives:
x_2 = x_1 - f(x_1)/f'(x_1).
B00m, we're done. Now given some initial approximation x_1, we can find where the tangent line of some function at that point cuts the x-axis. In the case of our function y = x2 - 2 we have
x_2 = 2 - f(2)/f'(2) = 2 - 2/4 = 3/2 = 1.5 <----- this number is where the tangent line to the curve, at x = 2, cuts the x-axis!
Using this new number as our new approximation we go again ...