Find roots
- Subject: Find roots
- From: Aleksas Domarkas
- Date: Sun, 6 Jan 2013 12:16:12 +0200
Find roots of log(x^3-78*x+90)+1000*x
(%i1) f:log(x^3-78*x+90)+1000*x$
First root is
(%i2) find_root(f, x, -1, 0);
(%o2) -0.0045037052827993
Let x1, x2, x3 - roots of x^3-78*x+90.
(%i3) allroots(x^3-78*x+90); map(rhs,%)$
(%o3) [x=1.174624074847539,x=8.185668853475939,x=-9.360292928323476]
(%i5) [x1,x2,x3]:sort(%);
(%o5) [-9.360292928323476,1.174624074847539,8.185668853475939]
(%i6) eq:log((x-x1)*(x-x2)*(x-x3))+1000*x;
(%o6)
log((x-8.185668853475939)*(x-1.174624074847539)*(x+9.360292928323476))+1000*x
(%i7) eq1:%, logexpand=super;
(%o7)
log(x+9.360292928323476)+log(x-1.174624074847539)+log(x-8.185668853475939)+1000*x
We compute root near x2
(%i8) eq3:subst(x=x2-10^(-t),eq1)$
(%i9) %, logexpand=super$
(%i10) find_root(%, t, 500, 600);
(%o10) 512.0011678763734
Then root of log(x^3-x*78+90)+1000*x is x2-10^(-t), t~~512.
We compute root near x3
(%i11) eq2:subst(x=x3+10^(-t),eq1)$
(%i12) t1:find_root(eq2, t, 3500, 3600);
(%o12) 3557.080773671874
Then root of log(x^3-x*78+90)+1000*x is x3+10^(-t), t~~3557.
best
Aleksas Domarkas