%mathpiper,def="PrimitivePart"

10 # PrimitivePart(UniVariate(_var,_first,_coefs)) <--
	UniVariate(var,0,coefs/Gcd(coefs));
20 # PrimitivePart(poly_CanBeUni) <-- NormalForm(PrimitivePart(MakeUni(poly)));

%/mathpiper



%mathpiper_docs,name="PrimitivePart",categories="User Functions;Polynomials (Operations)"
*CMD PrimitivePart --- primitive part of a univariate polynomial
*STD
*CALL
	PrimitivePart(expr)

*PARMS

{expr} -- univariate polynomial

*DESC

This command determines the primitive part of a univariate
polynomial. The primitive part is what remains after the content (the
greatest common divisor of all the terms) is divided out. So the
product of the content and the primitive part equals the original
polynomial.

*E.G.

In> poly := 2*x^2 + 4*x;
Result: 2*x^2+4*x;
In> c := Content(poly);
Result: 2*x;
In> pp := PrimitivePart(poly);
Result: x+2;
In> Expand(pp*c);
Result: 2*x^2+4*x;

*SEE Content
%/mathpiper_docs