I have fixed some code, but it always gives me errors. Can anybody tell me its right code?
PsedoRemainder[F_, G_, ord_] :=
Module[{polyquo, polyrem, MainVariable, Initial, Separant, l}
polyquo = PolynomialQuotient[F, G, MainVariable];
polyrem = PolynomialRemainder[F, G, MainVariable];
MainVariable = Last[ord];
l = Exponent[G, MainVariable];
Initial = Last[CoefficientList[G, MainVariable]];
Separant = D[G, MainVariable];
polyrem[i_] := F;
polyquo[j_] := 0;
s := 0;
deg[i_] := Exponent[R[i], MainVariable];
Initial[i_] := Last[CoefficientList[polyrem[i], MainVariable]]
While[deg[i] > l && [Initial]^s*F != polyquo[j]*G + polyrem[i],
s++;
polyrem[{i + 1} _] :=
Initial*R[i] - Initial[i]*[MainVariable]^(deg[i] - l)*G;
polyquo[{j + 1} _] :=
Initial*polyquo[j] + Initial[i]*[MainVariable]^(deg[i] - l);
i++; j++;]
Print[{[Initial]^s*F = polyquo[j]*G + polyrem[i], Initial[i], polyrem[i], polyquo[j]}];
Return[polyrem, polyquo];
F = Subscript[x, 1]^2 Subscript[x, 2]^3 - Subscript[x, 2];
G = Subscript[x, 1]^3 Subscript[x, 2] - 2;
ord = [Subscript[x, 1], Subscript[x, 2]]
The following are some explaintation
class of F:=Greatest subscript c for which x_c occurs actually in F,otherwisw 0 if F is a non-zero constant. In notation: cls(F)
MainVariable of F:=x_c if class of F is c>0,otherwise undefined.In notation :MainVariable(F)
Degree of F:=Degree of F in x_c if class of F is c>0,otherwise =0.In notation :deg(F)
For a non-constant polynomial F of class c>0, F is in normal form:= F=I*x_c^d+lower degree terms in x_c
I is called initial of F In notation: Initial(F)
{R[i], Q[j], Initial[i]}3) You have many undefined identifiers. 4} UsingInitialandinitial[i]is almost certainly going to cause trouble -- note that lists, vectors, and arrays are indexed with[[ ]]not[ ]in Mathematica. I strongly recommend you read our post for new users.Subscriptmakes the code very hard to read. I do not see what is the fascination with Subscripts really. – Nasser Dec 23 '15 at 12:23MainVariabletoPolynomialQuotient? Its valid but just returnsF/G– george2079 Dec 23 '15 at 16:21