Pari/GP Reference Documentation |
Contents - Index - Meta commands |

O deriv eval factorpadic intformal padicappr polcoeff polcyclo poldegree poldisc poldiscreduced polhensellift polinterpolate polisirreducible pollead pollegendre polrecip polresultant polroots polrootsmod polrootspadic polsturm polsubcyclo polsylvestermatrix polsym poltchebi polzagier serconvol serlaplace serreverse subst substpol substvec taylor thue thueinit | |

O | |

| |

deriv(x,{v}) | |

derivative of x with respect to the main variable if v is omitted, and with respect to v otherwise. The derivative of a scalar type is zero, and the derivative of a vector or matrix is done componentwise. One can use x' as a shortcut if the derivative is with respect to the main variable of x. By definition, the main variable of a The library syntax is | |

eval(x) | |

replaces in x the formal variables by the values that
have been assigned to them after the creation of x. This is mainly useful
in GP, and not in library mode. Do not confuse this with substitution (see
If x is a character string,
The library syntax is
, and qfeval(q,x)
evaluate q at x, where q
is respectively assumed to be a polynomial, a quadratic form (a symmetric
matrix), or an Hermitian form (an Hermitian complex matrix).hqfeval(q,x) | |

factorpadic(pol,p,r,{flag = 0}) | |

p-adic factorization
of the polynomial If The library syntax is | |

intformal(x,{v}) | |

formal integration of x with respect to the main variable if v is omitted, with respect to the variable v otherwise. Since PARI does not know about "abstract" logarithms (they are immediately evaluated, if only to a power series), logarithmic terms in the result will yield an error. x can be of any type. When x is a rational function, it is assumed that the base ring is an integral domain of characteristic zero. The library syntax is | |

padicappr(pol,a) | |

vector of p-adic roots of the
polynomial pol congruent to the p-adic number a modulo p, and with
the same p-adic precision as a. The number a can be an ordinary
p-adic number (type The library syntax is | |

polcoeff(x,s,{v}) | |

coefficient of degree s of the polynomial x, with respect to the main variable if v is omitted, with respect to v otherwise. Also applies to power series, scalars (polynomial of degree 0), and to rational functions provided the denominator is a monomial. The library syntax is | |

poldegree(x,{v}) | |

degree of the polynomial x in the main variable if v is omitted, in the variable v otherwise. The degree of 0 is a fixed negative number, whose exact value should not be used. The degree of a non-zero scalar is 0. Finally, when x is a non-zero polynomial or rational function, returns the ordinary degree of x. Raise an error otherwise. The library syntax is
poldegree(x,-1). | |

polcyclo(n,{v = x}) | |

n-th cyclotomic polynomial, in variable v (x by default). The integer n must be positive. The library syntax is | |

poldisc(pol,{v}) | |

discriminant of the polynomial
The library syntax is
poldisc0(x,-1). | |

poldiscreduced(f) | |

reduced discriminant vector of the
(integral, monic) polynomial f. This is the vector of elementary divisors
of The library syntax is | |

polhensellift(x, y, p, e) | |

given a prime p, an integral polynomial x whose leading coefficient is a p-unit, a vector y of integral polynomials that are pairwise relatively prime modulo p, and whose product is congruent to x modulo p, lift the elements of y to polynomials whose product is congruent to x modulo p^e. The library syntax is | |

polinterpolate(xa,{ya},{v = x},{&e}) | |

given the data vectors xa and ya of the same length n (xa containing the x-coordinates, and ya the corresponding y-coordinates), this function finds the interpolating polynomial passing through these points and evaluates it atv. If ya is omitted, return the polynomial interpolating the (i,xa[i]). If present, e will contain an error estimate on the returned value. The library syntax is | |

polisirreducible(pol) | |

The library syntax is | |

pollead(x,{v}) | |

leading coefficient of the polynomial or power series x. This is computed with respect to the main variable of x if v is omitted, with respect to the variable v otherwise. The library syntax is | |

pollegendre(n,{v = x}) | |

creates the n^{{th}} Legendre polynomial, in variable v. The library syntax is | |

polrecip(pol) | |

reciprocal polynomial of The library syntax is | |

polresultant(x,y,{v},{flag = 0}) | |

resultant of the two polynomials x and y with exact entries, with respect to the main variables of x and y if v is omitted, with respect to the variable v otherwise. The algorithm assumes the base ring is a domain. If If If The library syntax is flag = 0) and
(resultant2(x,y)flag = 1). | |

polroots(pol,{flag = 0}) | |

complex roots of the polynomial
The algorithm used is a modification of A.Sch¨nhage's root-finding algorithm, due to and implemented by X.Gourdon. Barring bugs, it is guaranteed to converge and to give the roots to the required accuracy. If The library syntax is | |

polrootsmod(pol,p,{flag = 0}) | |

row vector of roots modulo
p of the polynomial If p is very small, you may try setting The library syntax is flag = 1). | |

polrootspadic(pol,p,r) | |

row vector of p-adic roots of
the polynomial If The library syntax is | |

polsturm(pol,{a},{b}) | |

number of real roots of the real
polynomial The library syntax is
. The result is a
sturmpart(pol,
NULL,
NULL)
long. | |

polsubcyclo(n,d,{v = x}) | |

gives polynomials (in variable
v) defining the sub-Abelian extensions of degree d of the cyclotomic
field If there is exactly one such extension the output is a polynomial, else it is a vector of polynomials, eventually empty. To be sure to get a vector, you can use The function The library syntax is
long and v is a
variable number. | |

polsylvestermatrix(x,y) | |

forms the Sylvester matrix corresponding to the two polynomials x and y, where the coefficients of the polynomials are put in the columns of the matrix (which is the natural direction for solving equations afterwards). The use of this matrix can be essential when dealing with polynomials with inexact entries, since polynomial Euclidean division doesn't make much sense in this case. The library syntax is | |

polsym(x,n) | |

creates the vector of the symmetric powers of the roots of the polynomial x up to power n, using Newton's formula. The library syntax is | |

poltchebi(n,{v = x}) | |

creates the n^{{th}} Chebyshev polynomialT_n of the first kind in variable v. The library syntax is | |

polzagier(n,m) | |

creates Zagier's polynomial P_n^{(m)} used in
the functions
The library syntax is
longs. | |

serconvol(x,y) | |

convolution (or Hadamard product) of the
two power series x and y; in other words if x = sum a_k*X^k and y = sum
b_k*X^k then The library syntax is | |

serlaplace(x) | |

x must be a power series with non-negative exponents. If x = sum (a_k/k!)*X^k then the result is sum a_k*X^k. The library syntax is | |

serreverse(x) | |

reverse power series (i.e.x^{-1}, not 1/x) of x. x must be a power series whose valuation is exactly equal to one. The library syntax is | |

subst(x,y,z) | |

replace the simple variable y by the argument z in the "polynomial" expression x. Every type is allowed for x, but if it is not a genuine polynomial (or power series, or rational function), the substitution will be done as if the scalar components were polynomials of degree zero. In particular, beware that:
If x is a power series, z must be either a polynomial, a power series, or a rational function. The library syntax is | |

substpol(x,y,z) | |

replace the "variable" y by the argument z in the "polynomial"
expression x. Every type is allowed for x, but the same behaviour
as The difference with
For instance
The library syntax is | |

substvec(x,v,w) | |

v being a vector of monomials (variables), w a vector of expressions of the same length, replace in the expression x all occurences of v_i by w_i. The substitutions are done simultaneously; more precisely, the v_i are first replaced by new variables in x, then these are replaced by the w_i:
The library syntax is | |

taylor(x,y) | |

Taylor expansion around 0 of x with respect to the simple variable y. x can be of any reasonable type, for example a rational function. The number of terms of the expansion is transparent to the user in GP, but must be given as a second argument in library mode. The library syntax is | |

thue(tnf,a,{sol}) | |

solves the equation
P(x,y) = a in integers x and y, where
Hence, the only solution is x = 1, y = 1 and the result is unconditional. On the other hand:
This time the result is conditional. All results computed using this tnf
are likewise conditional, The library syntax is | |

thueinit(P,{flag = 0}) | |

initializes the
The library syntax is | |