this is the function: $\ f(x) = x^3 + x^2 - 3x - 3 $
% roots according to www.1728.org/cubic.html
% 1.73205080756888
% -1.73205080756888
% -1
I'm not so sure i understand fixed point iteration I've few $\ g(x) $ functions as listed below:
converges to one of the roots (-1 , 1.732, -1.732):
- $\ x = 3 / (x^2 + x - 3) $ <== x0 {{-inf, -2.6} , {-1.5,0.5} , {1.5, inf}}
- $\ x = (3 + 3x - x^2)^(1/3) $ <== x0(-inf , inf}
- $\ x = (3 + 3x - x^2)/(x^2) $ <== x0{-inf , -1}
as listed above, each g(x) will converge to one of the root. is there a function that will cover and result of all roots depending on X0 ?
the functions above have initial x values that will cause unstable result that's why i put range for each one: x0{range}, but this mean that one can choose X0 carefully ?
this function helped me figuring where my X0 shouldn't be near the spikes on the following image:
plot of g(x)+f(x)
if i choose X0 near the spikes. the result will not be converged.
so is my solution of finding g(x) is right? or it should be one (g(x)) that finds all roots depending on X0. and works from {-inf , inf}.
by the way the second g(x) finds the root 1.732 and works for full range of R
$\ x=3+3x-x^2$
edit:
i just found that X0 -2.6 will converge but X0 -3 (farther then -2.6 from the spike) will oscillate for the 2nd g(x) !