Sponsored links: Algebra eBooks
 

Help Index

A

B

C

D

E

F

G

H

I

J

K

L

M

N

O

P

Q

R

S

T

U

V

W

X

Y

Z

The Maxima on-line user's manual

Algebra Calculator

Search:

Allroots Calculator

Allroots

Function: allroots (<expr>)

a:5;
b:5;
F:13;
s:(a+b+c)/2;
g:F^2=s*(s-a)*(s-b)*(s-c);
allroots(g);

Function: allroots (<eqn>) Computes numerical approximations of the real and complex roots of the polynomial <expr> or polynomial equation <eqn> of one variable.

The flag polyfactor when true causes allroots to factor the polynomial over the real numbers if the polynomial is real, or over the complex numbers, if the polynomial is complex.

allroots may give inaccurate results in case of multiple roots.

     If the polynomial is real, allroots (%i*<p>)) may yield more
     accurate approximations than allroots (<p>), as allroots
     invokes a different algorithm in that case.

allroots rejects non-polynomials. It requires that the numerator after rating should be a polynomial, and it requires that the denominator be at most a complex number. As a result of this allroots will always return an equivalent (but factored) expression, if polyfactor is true.

For complex polynomials an algorithm by Jenkins and Traub is used (Algorithm 419, Comm. ACM, vol. 15, (1972), p. 97). For real polynomials the algorithm used is due to Jenkins (Algorithm 493, ACM TOMS, vol. 1, (1975), p.178).

Examples:

          (%i1) eqn: (1 + 2*x)^3 = 13.5*(1 + x^5);
                                      3          5
          (%o1)              (2 x + 1)  = 13.5 (x  + 1)
          (%i2) soln: allroots (eqn);
          (%o2) [x = .8296749902129361, x = - 1.015755543828121,

x = .9659625152196369 %i - .4069597231924075,

          x = - .9659625152196369 %i - .4069597231924075, x = 1.0]
          (%i3) for e in soln
                  do (e2: subst (e, eqn), disp (expand (lhs(e2) - rhs(e2))));
                                - 3.5527136788005E-15

- 5.32907051820075E-15

4.44089209850063E-15 %i - 4.88498130835069E-15

- 4.44089209850063E-15 %i - 4.88498130835069E-15

3.5527136788005E-15

          (%o3)                         done
          (%i4) polyfactor: true$
          (%i5) allroots (eqn);
          (%o5) - 13.5 (x - 1.0) (x - .8296749902129361)

2 (x + 1.015755543828121) (x + .8139194463848151 x

+ 1.098699797110288)

There are also some inexact matches for allroots. Try ?? allroots to see them.

(%o1)                                true
(%i2) 

Allroots Example

Related Examples

allroots-diff-realroots-rhs-solve

f:y=-x^5/1800-7*x^4/1...

ab:diff(rhs(f),x);

realroots(ab);

Calculate

allroots-expand

expand((x-2)*(x-3)*(x...

allroots(x^4-12*x^3+5...

Calculate

allroots-transpose

transpose(allroots(x^...

Calculate

allroots

allroots(2*x^5 - 19*x...

Calculate

allroots-create_list-diff-ev-exp-log-numer

p(x):=x*(x-1)*(x-2);

f(x):=p(x)*exp(-x*log...

t:diff(f(x),x)*exp(x*...

Calculate

allroots

allroots((x^2+1)+x-5,x);

Calculate

allroots-false-integrate-numer-solve

numer:false;

f: 4*x-5*x^2;

allroots(f);

Calculate

allroots-expand-integrate

equ:expand((x-1)*(x-3...

aa:integrate(equ,x)*4;

allroots(aa);

Calculate

allroots-diff-factor-find_root-ic2-ode2-sin-solve

f:8*x^3-36*x^2+54*x-27;

solve(f,x);

find_root(f,x,0,2);

Calculate

allroots-complex-solve

allroots(x^3=-1/2);

solve([x^3=1/2],[x]),...

Calculate