Question: Consider using Newton's method to find the roots of the following function: f ( x ) = x 3 + 6 x 2 + 7

Consider using Newton's method to find the roots of the following function:
f(x)=x3+6x2+7x5
Fill in the gaps in the answer box below with Python lambda functions to represent the functions f(x) and f(x) that can be used with the Python function newton_root_finder shown in the course material to find a root of this function.
Also fill in the gap in the line defining the numpy array x0_array with 3 suitable initial values to use to find each of the 3 roots of the function in order (lowest to highest) to 7 decimal places using at most 10 iterations of Newton's method.
Hint: Plotting the function using Python or Desmos will help you to find suitable initial values for each root. These do not need to be exact! Initial values to only one decimal place are sufficient.
Your code will be tested by checking what root is found by each of your initial values.
For example if the code is tested with this test code:
x0= x0_array[0]
root = newton_root_finder(f,
f_prime,
x0,
tol,
max_iterations)
print("The first root")
print(f"is {root:.6f}(6 dps)")
the result should give the value of the first (lowest) root of the function.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!