If you want to find an [math]x[/math] value where a function, [math]f(x)=0[/math] and the derivative can be calculated, Newton's Method is a good approach. This applet graphically steps through what is happening with the method.[br]Step 1 : The function where we want to find the root. In this case the root is [math]\sqrt{2}[/math][br]Step 2 : Solve for the derivative[br]Step 3 : Choose an [math]x[/math] value to start. Here we chose [math]x_0=2[/math]. This is an art with Newton's method.[br]Step 4 : Evaluate the function and the derivative at the [math]x[/math] value. Draw the point [math](x,f(x))[/math].[br]Step 5 : The length of the segment shown is [math]f(x)[/math]. Note: it may be negative so it is not really a length.[br]Step 6 : Using the derivative, draw the tangent line. We will approximate the value of [math]f(x)=0[/math] by finding where this line is [math]0[/math]. [br]Step 7 : The length of the red vector can be calculated from the lines slope.[br]The slope of the line, [math]f'(x)=2x=4[/math], is the rise over the run or [math]f'(x)=\frac{\text{rise}}{\text{run}}=\frac{f\left(x\right)}{\text{- red vector}}[/math] . Solving for the red vector gives [math]\text{red vector = - \frac{f\left(x\right)}{f'\left(x\right)}}[/math] [br]Step 8 : An alternate method is to find the point on the line, [math](x_{next},0)[/math] using the slope of the line through two points. [math]f'\left(x\right)=m=\frac{y_2-y_1}{x_2-x_1}=\frac{0-f\left(x\right)}{x_{next}-x}[/math] . Solving for [math]x_{next}=x-\frac{f\left(x\right)}{f'\left(x\right)}[/math] gives the Newton method. This is the same as adding the red vector to the initial [math]x[/math].[br]Step 9: Looking at the graph of the function it can be seen that the new [math]x[/math] values is close to the desired x value where [math]f(x)=0[/math] .[br]Step 10: Repeat the operation using this new [math]x[/math] value to get a better guess of the desired [math]x[/math] value.
In this applet you can enter a function in the entry box and provide an initial guess of [math]x_0[/math] by moving the point on the x-axis.
For the following functions experiment with different values of the initial guess.[br][math]x^2-2[/math] = x^2 - 2[br][math]\frac{1}{2}+\sin\left(x\right)[/math] = 1/2 + sin(x)[br][math]\frac{x}{2}-\cos x[/math] = x - cos(x)[br][math]\frac{1}{2}-\sqrt[3]{x}[/math] = 1/2 - nroot(x,3)[br]If[ x< 0 , sqrt( -x) , sqrt(x)]