Question regarding detecting roots of polynom



>>>>> "WK" == Wilfried Kral <wilfried.kral at gmx.net> writes:

WK> I was building an 18 degree polynom like
...
WK>  with roots that have always integers for real an imaginary part

WK> so Maxima seems to get the pure real values and then stops.
WK> If a freind uses Matlab or in Online Mathematica I get the exact solutions.

As recently suggested on anther thread, solve(gfactor(poly),var); works
better.

Using your poly:

(%i1) display2d:false;

(%o1) false
x^18-36*%i*x^17+83*x^17-2818*%i*x^16+2591*x^16-95676*%i*x^15+31291*x^15
    -1829926*%i*x^14-222415*x^14-21043560*%i*x^13-13429735*x^13
    -134373950*%i*x^12-221505091*x^12-162118764*%i*x^11-2100454047*x^11
    +5328348982*%i*x^10-12519554958*x^10+54789418068*%i*x^9-44078314424*x^9
    +287090759824*%i*x^8-50671326176*x^8+912058259616*%i*x^7+322740608816*x^7
    +1651930704544*%i*x^6+1945453962592*x^6+873591016128*%i*x^5
    +5209884712576*x^5-3122885337856*%i*x^4+7794942136576*x^4
    -7959302616576*%i*x^3+5886979568640*x^3-8129574092800*%i*x^2
    +690482554880*x^2-3774525235200*%i*x-1846961971200*x-585326592000*%i
    -841015296000;

(%o2) x^18-36*%i*x^17+83*x^17-2818*%i*x^16+2591*x^16-95676*%i*x^15+31291*x^15
          -1829926*%i*x^14-222415*x^14-21043560*%i*x^13-13429735*x^13
          -134373950*%i*x^12-221505091*x^12-162118764*%i*x^11-2100454047*x^11
          +5328348982*%i*x^10-12519554958*x^10+54789418068*%i*x^9
          -44078314424*x^9+287090759824*%i*x^8-50671326176*x^8
          +912058259616*%i*x^7+322740608816*x^7+1651930704544*%i*x^6
          +1945453962592*x^6+873591016128*%i*x^5+5209884712576*x^5
          -3122885337856*%i*x^4+7794942136576*x^4-7959302616576*%i*x^3
          +5886979568640*x^3-8129574092800*%i*x^2+690482554880*x^2
          -3774525235200*%i*x-1846961971200*x-585326592000*%i-841015296000
(%i3) gfactor(%o2);

(%o3) (x+1)*(x+3)*(x+4)*(x+6)*(x+8)*(x-4*%i+2)*(x-4*%i+3)*(x-4*%i+4)
           *(x-4*%i+6)*(x-4*%i+9)*(x-2*%i)*(x-2*%i+1)*(x-2*%i+2)*(x-2*%i+4)
           *(x-2*%i+6)*(x-2*%i+7)*(x-2*%i+8)*(x-2*%i+9)
(%i4) solve(%o3,x);

(%o4) [x = 2*%i-9,x = 2*%i-8,x = 2*%i-7,x = 2*%i-6,x = 2*%i-4,x = 2*%i-2,
       x = 2*%i-1,x = 2*%i,x = 4*%i-9,x = 4*%i-6,x = 4*%i-4,x = 4*%i-3,
       x = 4*%i-2,x = -8,x = -6,x = -4,x = -3,x = -1]

Another suggesting in that thread is to set algebraic:true, but that
doesn't work as well here:

(%i5) solve(%o2,x),algebraic:true;

(%o5) [x = -3,x = -1,x = -4,x = -8,x = -6,
       0 = x^13+(61-36*%i)*x^12+(1070-2026*%i)*x^11+(-44660*%i-3830)*x^10
               +(-460920*%i-371147)*x^9+(-1529088*%i-5353727)*x^8
               +(13544402*%i-35943060)*x^7+(168139960*%i-102170200)*x^6
               +(740595920*%i+109209296)*x^5+(1349765824*%i+1597658416)*x^4
               +(4170648640-226610976*%i)*x^3+(3755946880-4231612800*%i)*x^2
               +(-4647635200*%i-468851200)*x-1016192000*%i-1460096000]

It looks like using gfactor() when solving any poly with gaussian
integer coefficients (or "gaussian rational" coefficients) is a good
idea when trying to solve() them.

-JimC
-- 
James Cloos <cloos at jhcloos.com>         OpenPGP: 1024D/ED7DAEA6