Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

java Problem D. [20 pts] To find a root of a polynomial equation, we can use an iterative process. We start with an initial guess

java Problem D. [20 pts] To find a root of a polynomial equation, we can use an iterative process. We start with an initial guess for the value of the root, x 0 , plug it in to the iterative formula and solve for x 1 . Then we plug x 1 back into the iterative formula and solve for x 2 . We continue this process until x n+1 and x n are equal to a specified number of decimal places. When this happens, this is our approximate solution to the polynomial equation. We will be solving for a root of a cubic equation: f(x n ) = c3 x n 3 + c2 x n 2 + c1 x n + c0 where c3, c2, c1 and c0 are the coefficients of each polynomial term. The iterative formula we will use is: x n+1 = x n - ( f(x n ) / f '(x n ) ) where f '(x n )is the derivative of f(x n ) Define a public static method named cubicRoot that accepts the coefficients of the cubic equation and an initial guess for the root . This method computes and returns a root of the cubic equation by using the iterative process described below (you must use a while loop): 1. Start with the guess for the root passed to the method as x n

2. Compute x n+1 using the formula above Note: you can write the equation for the derivative in terms of the coefficients, exponents and x terms. 3. Compare x n+1 and x n i. if these are equal within 4 decimal places, then return the value ii. If not, x n should be updated - repeat Step 2

Step by Step Solution

There are 3 Steps involved in it

Step: 1

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_2

Step: 3

blur-text-image_3

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

Sams Teach Yourself Beginning Databases In 24 Hours

Authors: Ryan Stephens, Ron Plew

1st Edition

067232492X, 978-0672324925

More Books

Students also viewed these Databases questions

Question

love of humour, often as a device to lighten the occasion;

Answered: 1 week ago

Question

orderliness, patience and seeing a task through;

Answered: 1 week ago

Question

well defined status and roles (class distinctions);

Answered: 1 week ago