# pseudoRemainder -- compute the pseudo-remainder

## Synopsis

• Usage:
pseudoRemainder(f,g)
• Inputs:
• f,
• g, , in the same polynomial ring R as f
• Outputs:
• , the pseudo remainder of the polynomial f by the polynomial g

## Description

Let x be the first variable of R appearing in g. Suppose that g has degree d in x, and that the coefficient of x^d in g (as an element of R, but not involving the variable x) is c. The pseudo remainder of f by g is the polynomial h of degree less than d in x such that c^(e-d+1) * f = q*g + h, where f has degree e in x.
 i1 : R = QQ[x,y]; i2 : f = x^4 4 o2 = x o2 : R i3 : g = x^2*y + 13*x^2*y^4 +x*y^2-3*x - 1 2 4 2 2 o3 = 13x y + x y + x*y - 3x - 1 o3 : R i4 : (lg, cg) = topCoefficients g 2 4 o4 = (x , 13y + y) o4 : Sequence i5 : h = pseudoRemainder(f,g) 6 4 3 4 2 2 o5 = - 27x*y + 87x*y - 2x*y + 14y - 27x*y + 6x*y - 6y + 27x + y + 9 o5 : R i6 : (cg^3 * f - h) % g o6 = 0 o6 : R i7 : q = (cg^3 * f - h) // g 2 8 2 5 6 4 2 2 3 4 2 o7 = 169x y + 26x y - 13x*y + 39x*y + x y - x*y + 14y + 3x*y - 6y + y ------------------------------------------------------------------------ + 9 o7 : R i8 : cg^3*f == h + q*g o8 = true

## Caveat

There is no pseudo-division implemented, and the only way to change the notion of what the top variable is, is to change to a ring where the variables are in a different order