Page 1 sur 1

extracting only the polynomial entry in factors

Publié : ven. nov. 02, 2018 2:00 pm
par jocaps
Hi,

I want to be able to get the polnyomial factors of a polynomial but I'm not sure what is the best way to do this in giac or giacpy. So for instance I have a polynomial say 2/3*(x+y*x+3) and I use the factors command I get

Code : Tout sélectionner

[2,1,x*y+x+3,1,3,-1]
In my actual codes this polynomials could be really long and in this particular case, the only interesting part is the third entry in the list i.e. x*y+x+3. What is the best way to get this? Can I inquire for type? I can ask for the degree, but for degree one should give the proper indeterminates (it could be a polynomial over x or y or z or ..etc.) and probably this is not the best way to get the non-constant factors.

Jose

Re: extracting only the polynomial entry in factors

Publié : ven. nov. 02, 2018 2:20 pm
par parisse
Keeping type 6 (identifier) or 8 (expression) is probably good (however pi would be considered non constant), it depends what you want to do after.

Re: extracting only the polynomial entry in factors

Publié : ven. nov. 02, 2018 2:25 pm
par jocaps
I kind of resolved this by just asking the indets. So I went to each of the elements of the list, step 2 (since the second entry is the multiplicity), and ask if indets have length 0, if so I know they are constant.