Question: (a) Implement Newton's method with pencil, paper, and a calculator to approximate the root of f(x) = 2x + 3 cos x - e^x. Use
(a) Implement Newton's method with pencil, paper, and a calculator to approximate the root of f(x) = 2x + 3 cos x - e^x. Use p0 = 1, and find p2.
(b) Implement a Newton method solver in Matlab. Write a function with the following input/output structure: function [r,k] = newton(f,fprime,x0) where f is the function, fprime its derivative, x0 is the initial guess, r is the approximate root, and k is the number of iterations required. Use the function on the same problem. Use the stopping criteria: abs(x(i+1)-x(i) < eps(x(i+1)). Write down the root to 6 decimal places and the number of iterations necessary.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
