The sqrfree command provides squarefree factorizations of polynomials; that is, it factors a polynomial as a product of powers of coprime factors, where each factor has roots of multiplicity 1 (in other words, a factor and its derivative are coprime).
Examples.
⎛ ⎝ | x2+3 x+2 | ⎞ ⎠ | ⎛ ⎝ | x−1 | ⎞ ⎠ | 2 |
⎛ ⎝ | x2+3 x+2 | ⎞ ⎠ | 2 | ⎛ ⎝ | x−1 | ⎞ ⎠ | 3 |