Karim Belabas on Fri, 13 Jan 2012 02:48:36 +0100


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: Main variable of a polynomial?


* Charles Greathouse [2012-01-13 02:16]:
> Suppose I had a variable P which was a polynomial in some unknown
> variable.  Is there a good way to get that variable in GP?
> 
> I suppose I could take the derivative until it was monic, subtract the
> constant term, and divide by pollead.  But that hardly seems efficient
> when the degree may be large.

Not sure I understand the question: what is wrong with variable(P) ?

(02:47) gp > P = t^2 + 1
%1 = t^2 + 1
(02:47) gp > variable(P)
%2 = t

Cheers,

    K.B.
-- 
Karim Belabas, IMB (UMR 5251)  Tel: (+33) (0)5 40 00 26 17
Universite Bordeaux 1          Fax: (+33) (0)5 40 00 69 50
351, cours de la Liberation    http://www.math.u-bordeaux1.fr/~belabas/
F-33405 Talence (France)       http://pari.math.u-bordeaux1.fr/  [PARI/GP]
`