extracting only the polynomial entry in factors

jocaps
Messages : 118
Inscription : lun. avr. 17, 2017 4:32 pm

extracting only the polynomial entry in factors

Message par jocaps » ven. nov. 02, 2018 2:00 pm

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

parisse
Messages : 5082
Inscription : mar. déc. 20, 2005 4:02 pm
Contact :

Re: extracting only the polynomial entry in factors

Message par parisse » ven. nov. 02, 2018 2:20 pm

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.

jocaps
Messages : 118
Inscription : lun. avr. 17, 2017 4:32 pm

Re: extracting only the polynomial entry in factors

Message par jocaps » ven. nov. 02, 2018 2:25 pm

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.

Répondre