Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Last part please

image text in transcribed

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) = ;a", 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). flate(a, r) which, given a list of coefficients a which define a Write a function polynomial p(x) = aix, i=0 and a root r of p(2) 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 xo. 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) = ,". 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. 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) = ;a", 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). flate(a, r) which, given a list of coefficients a which define a Write a function polynomial p(x) = aix, i=0 and a root r of p(2) 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 xo. 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) = ,". 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

Step: 1

To complete the question we need to break it down into parts and implement the required functions Le... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Financial And Manag Acct Ed7 Sg M1 M13

Authors: Carl S. Warren, James M. Reeve, Philip E. Fess

7th Edition

0324054610, 978-0324054613

More Books

Students also viewed these Accounting questions

Question

What are some nonverbal clues to deception?

Answered: 1 week ago

Question

Develop clear policy statements.

Answered: 1 week ago

Question

Draft a business plan.

Answered: 1 week ago

Question

Describe the guidelines for appropriate use of the direct plan.

Answered: 1 week ago