Write the iterative Newton root nding function from lecture to be recursive. The function declaration should be root = newtonRec(f,df,x,tol). The inputs to the function are:
?
- f a handle to the function
- ?df a handle to the derivative of the function
- x an estimate of the root
- ? tol the tolerance to nd the root within
The ouput of the function root is a root of the function satisfying abs(f(root))
Remove all code from the lecture version that causes display.
Note: Your roots may dier slightly from those in the test cases, but should satisfy the specied tolerance. You are not allowed to use any of Matlab's builtin root nding functions.