Newton’s method is a numerical technique that can be used to approximate the roots of a continuous function. Suppose \(f(x)\) is a differentiable function and you know that \(f(x)=0\) at some root \(x=r\text{.}\) However, you are unable to solve for \(r\) algebraically and so you need to approximate \(r\) numerically.
Newton’s method relies on using linear approximation of the function at a point close to the desired root \(r\text{.}\) You can begin by choosing a value \(x_0\) relatively close to \(r\text{,}\) and constructing the linear approximation of \(f(x)\) at \(x_0\text{:}\)
Because \(f(x) \approx L(x)\) near \(x_0\text{,}\) the \(x\)-intercept of \(L(x)\) should be very close to \(r\text{.}\) We can solve for this \(x\)-intercept by setting \(L(x)\) equal to zero:
Assuming that this \(x\)-intercept is even closer to \(r\) than our initial value \(x_0\text{,}\) we could use this new value \(x_1\) and repeat these same steps: find the new linear approximation of \(f(x)\) at \(x_1\text{,}\) solve for its \(x\)-intercept, and call the value \(x_2\text{.}\)
In this activity, you will be using the NewtonsMethod() command, which automates this process. It is part of the Student[Calculus1] package, which you will need to include at the top of your Maple worksheet. In the last exercise, you are encouraged to try to write a loop for Newton’s method.
In this exercise, you will use Newton’s method to numerically approximate the roots of the function \(f(x) = x^2 - 2\text{.}\) It is simple enough to solve for the two roots algebraically, but this example should help give you a basic understanding of how the method works.
Use Maple’s NewtonsMethod() command to determine the value of the root of the function \(f(x) = x^2 - 2\) using an initial value of \(2\text{.}\) Determine how many iterations are required until you get \(10\) decimal places of accuracy.
Adding the optional iterations parameter to the NewtonsMethod() command allows you to choose how many iterations are performed. By default, NewtonsMethod() carries out \(5\) iterations. You can set the parameter output=sequence to show the value after each iteration.
Apply Newton’s method to determine the value of the root of the function \(f(x) = x^2 - 2\text{.}\) This time, use an initial value of \(-2\text{.}\) Determine how many iterations are required until you get \(10\) decimal places of accuracy.
Try to apply Newton’s method to determine the value of the root of the function \(f(x) = x^2 - 2\) using an initial value of \(0\text{.}\) Determine why the NewtonsMethod() command gives an error for this particular value.
In the last exercise, you used Newton’s method to numerically approximate the values of the two roots, \(\pm\sqrt{2}\text{.}\) In this example, you will use Newton’s method to numerically approximate \(\sqrt{7}\text{.}\)
Apply Newton’s method to the function from part (a) with an initial value for \(x\) that is close to \(\sqrt{7}\text{.}\) Then, evaluate \(\sqrt{7}\) to \(15\) digits using evalf() and verify that the values agree.
Newton’s method converges with “quadratic convergence”, which roughly means that you will get twice as many correct digits for \(x_{new}\) as you did for \(x_{old}\text{.}\) Iterate Newton’s method for