Question: Write a function pol (a, x) which takes a list of coefficients a and a point x, and evaluates . i=0 Write a function


 

Write a function pol (a, x) which takes a list of coefficients

Write a function pol (a, x) which takes a list of coefficients a and a point x, and evaluates . i=0 Write a function coeffs (a) which takes a list of coefficients which define a polynomial p(x) = ax, i=0 and returns the list of coefficients associated with the first derivative of this polynomial, p'(x). For example given a = [1, 2, 3, 4, 5] the function should return the list [2, 6, 12, 20]. Write a function polynomial flate(a, r) which, given a list of coefficients a which define a = p(x) =ax, i=0 and a root r of p(x) whence p(r) 0, returns a list of coefficients associated with the deflated polynomial p(x)/(x r). You may use either forwards or backwards deflation. As an example given a = [2, -3, -3, 2] and r = 2 the function should return the list [-1, 1, 2]. Write a function new (f, df, x0) which implements Newton's method to identify a root of the function f whose first derivative is given by the function df, with the starting value being given by x0. Put together your answers from Questions 1-4 to write a function roots (a) which attempts to locate all of the roots of the polynomial given by p(x) =ax. i=0 You may assume that all of the roots of p(x) are real. Your function should be prepared to handle cases where Newton's method does not converge, and retry with several different initial values. Extend your routine from Question 5 to also be capable of handling polynomials with complex roots. Hint: In Python complex numbers can be specified as y = 3 + 2J with the imaginary part being suffixed by J.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

To complete the question we need to break it down into parts and implement the required functions Le... View full answer

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 Accounting Questions!