polylib
::sqrfree
Squarefree factorization of polynomials
MuPAD® notebooks will be removed in a future release. Use MATLAB® live scripts instead.
MATLAB live scripts support most MuPAD functionality, though there are some differences. For more information, see Convert MuPAD Notebooks to MATLAB Live Scripts.
polylib::sqrfree(f
, <recollect
>)
polylib::sqrfree(f)
returns the squarefree
factorization of f
, that is, a factorization of f in
the form f = u p_{1}^{e1} … p_{r}^{er} with
primitive and pairwise different squarefree divisors p_{i}.
polylib::sqrfree(f)
returns the squarefree
factorization of the polynomial f,
that is, a factorization of f in
the form f = u f_{1}^{e1} … f_{r}^{er} with
primitive and pairwise different squarefree divisors f_{i} (i.e., gcd(f_{i}, f_{j})
= 1 for i ≠ j).
u is a unit of the coefficient ring of f, and e_{i} are positive integers.
The result of polylib::sqrfree
is an object
of the domain type Factored
. Let g:= polylib::sqrfree(f)
be
such an object. It is represented internally as the list [u,
f1, e1, ..., fr, er]
of odd length 2 r +
1.
You may extract the unit u and
the terms f_{i}^{ei} by
the ordinary index operator [ ]
, i.e., g[1]
= u, g[2] = f1^e1, g[2] = f2^e2, ...
.
The calls Factored::factors(g)
and Factored::exponents(g)
return
a list of the factors f_{i} and
the exponents e_{i} (1
≤ i ≤ r),
respectively. The call convert(g, DOM_LIST)
gives
the internal representation of a factored object, i.e., the list [u,
f1, e1, ..., fr, er]
.
Note that the result of polylib::sqrfree
is
printed as an expression and behaves like that. As an example, the
result of polylib::sqrfree(x^2+2*x+1)
is the object
printed as (x+1)^2
which is of type "_power"
.
Please read the help page of Factored
for details.
The call polylib::sqrfree(f, FALSE)
returns
a squarefree factorization of f
, where the exponents e_{i} need
not be pairwise different.
polylib::sqrfree
can handle univariate and
multivariate polynomials over Expr
, residue class
rings IntMod(p)
with prime modulus p
,
domains representing a unique factorization domain of characteristic
zero, and finite fields.
If the argument of polylib::sqrfree
is an
expression, its numerator and denominator are converted into polynomials
in all occurring indeterminates.
These polynomials are regarded as polynomials over some extension
of the rational numbers (i.e., over Expr
, see poly
). The choice of
that extension follows the same rules as in the case of the function factor
.
Factors of the denominator of an expression are indicated by negative multiplicities.
The factors in a squarefree factorization are pairwise relatively prime, but they need not be irreducible:
polylib::sqrfree( 2  2*x  6*x^4 + 6*x^5 + 6*x^8  6*x^9 2*x^12 + 2*x^13 )
Even if a factorization into irreducibles has been found, irreducible factors with the same multiplicity are collected again:
polylib::sqrfree(x^6 + x^4*y*6 + x^2*y^2*9)
You can avoid this by giving a second argument:
polylib::sqrfree(x^6 + x^4*y*6 + x^2*y^2*9, FALSE)
polylib::sqrfree
works also for polynomials:
polylib::sqrfree(poly(2 + 5*x + 4*x^2 + x^3))

A polynomial or an arithmetical expression 


Factored object, i.e., an object of the domain type Factored
.