Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

The solution of the nonlinear equation x5 − P = 0 gives the fifth root of the

ID: 1827770 • Letter: T

Question

The solution of the nonlinear equation x5 − P = 0 gives the fifth root of the

number P . A numerical solution of the equation can be calculated with New-

ton’s method. The solution process starts by choosing a value x1 as a first

estimate of the solution. Using this value, a second, more accurate solution

x can be calculated with x = x − x15−P , which is then used for calculating 2 2 1 5x14

a third, still more accurate solution x3, and so on. The general equation for calculating the solution x from the solution x is x = x −xi5−P . Write a

i+1 i i+1 i 5xi4

user-defined function that calculates the fifth root of a number. For function

name and arguments use y = fifthroot(P), where the input argument P is

the number whose fifth root is to be determined, and the output argument

y is the value √5 P. In the program use x = P for the first estimate of the

solution. Then, by using the general equation in a loop, calculate new, more

accurate solutions. Stop the looping when the estimated relative error E

defined by E = |xi+1−xi | is smaller than 0.00001. Use the function you wrote √xi √ √

to calculate: 1) 5 120, 2) 5 16807, and 3) 5 −15.

Explanation / Answer

function [y] = fifthroot(P) format short x=P; xi=1; i=5; while n==1:i xi=xi-((xi^5-P)/(5*xi)^4); E=abs((xi-x)/x); if E