The sum of two numbers a and b is 21.2. If each number is added to its own square root (i.e. a + √ a), the product of the two sums is 170.73. Using either Newton’s method or the secant method, determine the two numbers using a tolerance of 10−4 Consider x0 = 0 and/or x1 = 1 as starting values. Hint: Set up as a system of two equations and two unknowns and reduce to one equation with one unknown.
I tried using this code but it gave me the same answer each time and one that doesn't fit the formula. Any suggestions? Thanks!
ff1=@(x) ((21.2-x)+sqrt(21.2-x)).*(x+sqrt(x))-170.73;secantmethod(ff1,0,1,10.^(-4))ff2=@(x) (x+sqrt(x)).*((21.2-x)+sqrt(21.2-x))-170.73;secantmethod(ff2,0,1,10.^(-4))
Best Answer