62.2 Operations for Rational Functions

Rational the rational functions form a field, therefore all arithmetic operations are applicable to rational functions.

  • f + g
  • f - g
  • f * g
  • f / g

    gap> x:=Indeterminate(Rationals,1);;y:=Indeterminate(Rationals,2);;
    gap> f:=3+x*y+x^5;;g:=5+x^2*y+x*y^2;;
    gap> a:=g/f;
    (5+x_1^2*x_2+x_1*x_2^2)/(3+x_1*x_2+x_1^5)
    

    Note that the quotient f/g of two polynomials might be represented as a rational function again. If g is known to divide f the call Quotient(f,g) (see Quotient) should be used instead.

    At the moment GAP does not contain a proper multivariate Gcd algorithm. Therefore it cannot be guaranteed that rational functions will always be represented as a quotient of coprime polynomials. In certain unfortunate situations this might lead to a degree explosion.

    All polynomials as well as all the univariate polynomials in the same indeterminate form subrings of this field. If two rational functions are known to be in the same subring, the result will be expressed as element in this subring.

    [Top] [Previous] [Up] [Next] [Index]

    GAP 4 manual
    February 2000