SolveTools - Maple Programming Help

Home : Support : Online Help : Mathematics : Factorization and Solving Equations : SolveTools : SolveTools/Polynomial

SolveTools

 Polynomial
 solve a single polynomial for one variable

 Calling Sequence Polynomial( f, x, ...)

Parameters

 f - polynomial in x x - variable options - (optional) equation(s) of the form keyword = value

Options

 • explicit : truefalse
 • domain : absolute, rational, integer, real, or parametric.
 • dropmultiplicity : truefalse

Description

 • Solve for a polynomial in x.  Polynomial uses factor,  compoly, and explicit root formulae to write the roots explicitly where possible.
 • If not possible, a list of indexed RootOf will be returned.
 • The behavior of Polynomial is controlled by the option explicit, or by the environment variable _EnvExplicit.  In all cases the option, if specified, overrides the environment variable. has three possible behaviors depending on the option
 • By default (if the option explicit not specified and _EnvExplicit is not set) explicit roots are calculated for polynomials of degree 2 and 3 but not for polynomials higher degree (unless they factor or decompose). Implicit roots that do not involve non-numeric symbols are given as indexed RootOfs.
 • If explicit is specified as an option (or _EnvExplicit=true) then explicit roots are computed when possible.
 • If explicit=false is specified as an option (or _EnvExplicit=false) then no attempt is made to compute explicit roots, and unspecialized RootOf expressions are returned.
 • The domain option can be used to restrict the roots returned. Using domain=real or domain=integer will return only real or integer roots respectively.  domain=absolute will return all the roots and domain=rational will return the roots which lie in the same field as the coefficients of f in the same way as roots; in particular if f is a polynomial with integer coefficients, domain=rational will return only the roots which are rational numbers.  domain=parametric will return a piecewise expression giving a discussion of different cases.
 • If the option dropmultiplicity is specified, only one copy of each root is returned.

Examples

 > $\mathrm{with}\left(\mathrm{SolveTools}\right):$
 > $\mathrm{Polynomial}\left(0,x\right)$
 $\left[{x}\right]$ (1)
 > $\mathrm{Polynomial}\left(1,x\right)$
 $\left[{}\right]$ (2)
 > $\mathrm{Polynomial}\left({x}^{2},x\right)$
 $\left[{0}{,}{0}\right]$ (3)
 > $\mathrm{Polynomial}\left({x}^{2}-1,x\right)$
 $\left[{1}{,}{-}{1}\right]$ (4)
 > $\mathrm{Polynomial}\left({x}^{2}+1,x,\mathrm{explicit}=\mathrm{false}\right)$
 $\left[{\mathrm{RootOf}}{}\left({{\mathrm{_Z}}}^{{2}}{+}{1}{,}{\mathrm{label}}{=}{\mathrm{_L1}}\right)\right]$ (5)
 > $\mathrm{Polynomial}\left({x}^{5}+2x+1,x\right)$
 $\left[{\mathrm{RootOf}}{}\left({{\mathrm{_Z}}}^{{5}}{+}{2}{}{\mathrm{_Z}}{+}{1}{,}{\mathrm{index}}{=}{1}\right){,}{\mathrm{RootOf}}{}\left({{\mathrm{_Z}}}^{{5}}{+}{2}{}{\mathrm{_Z}}{+}{1}{,}{\mathrm{index}}{=}{2}\right){,}{\mathrm{RootOf}}{}\left({{\mathrm{_Z}}}^{{5}}{+}{2}{}{\mathrm{_Z}}{+}{1}{,}{\mathrm{index}}{=}{3}\right){,}{\mathrm{RootOf}}{}\left({{\mathrm{_Z}}}^{{5}}{+}{2}{}{\mathrm{_Z}}{+}{1}{,}{\mathrm{index}}{=}{4}\right){,}{\mathrm{RootOf}}{}\left({{\mathrm{_Z}}}^{{5}}{+}{2}{}{\mathrm{_Z}}{+}{1}{,}{\mathrm{index}}{=}{5}\right)\right]$ (6)
 > $\mathrm{Polynomial}\left({x}^{5}+2x+1,x,\mathrm{explicit}=\mathrm{false}\right)$
 $\left[{\mathrm{RootOf}}{}\left({{\mathrm{_Z}}}^{{5}}{+}{2}{}{\mathrm{_Z}}{+}{1}{,}{\mathrm{label}}{=}{\mathrm{_L2}}\right)\right]$ (7)
 > $\mathrm{f1}≔\mathrm{expand}\left({\left(x-1\right)}^{4}\left(\genfrac{}{}{0}{}{\left({z}^{4}-z-1\right)}{\phantom{z={x}^{3}+x}}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}|\phantom{\rule[-0.0ex]{0.1em}{0.0ex}}\genfrac{}{}{0}{}{\phantom{\left({z}^{4}-z-1\right)}}{z={x}^{3}+x}\right)\right):$
 > $\mathrm{Polynomial}\left(\mathrm{f1},x,\mathrm{domain}=\mathrm{integer}\right)$
 $\left[{1}{,}{1}{,}{1}{,}{1}\right]$ (8)
 > $\mathrm{Polynomial}\left(\mathrm{f1},x,\mathrm{domain}=\mathrm{integer},\mathrm{dropmultiplicity}\right)$
 $\left[{1}\right]$ (9)
 > $\mathrm{Polynomial}\left(\mathrm{f1},x,\mathrm{domain}=\mathrm{rational}\right)$
 $\left[{1}{,}{1}{,}{1}{,}{1}\right]$ (10)
 > $\mathrm{Polynomial}\left(\mathrm{f1},x,\mathrm{domain}=\mathrm{real}\right)$
 $\left[{\mathrm{RootOf}}{}\left({{\mathrm{_Z}}}^{{12}}{+}{4}{}{{\mathrm{_Z}}}^{{10}}{+}{6}{}{{\mathrm{_Z}}}^{{8}}{+}{4}{}{{\mathrm{_Z}}}^{{6}}{+}{{\mathrm{_Z}}}^{{4}}{-}{{\mathrm{_Z}}}^{{3}}{-}{\mathrm{_Z}}{-}{1}{,}{-}{0.5542396981}\right){,}{\mathrm{RootOf}}{}\left({{\mathrm{_Z}}}^{{12}}{+}{4}{}{{\mathrm{_Z}}}^{{10}}{+}{6}{}{{\mathrm{_Z}}}^{{8}}{+}{4}{}{{\mathrm{_Z}}}^{{6}}{+}{{\mathrm{_Z}}}^{{4}}{-}{{\mathrm{_Z}}}^{{3}}{-}{\mathrm{_Z}}{-}{1}{,}{0.7679130647}\right){,}{1}{,}{1}{,}{1}{,}{1}\right]$ (11)
 > $\mathrm{SolveTools}:-\mathrm{Polynomial}\left(a{x}^{2}-\left(b+a\right)x+b,x\right)$
 $\left[\frac{{b}}{{a}}{,}{1}\right]$ (12)
 > $\mathrm{Polynomial}\left(a{x}^{2}-\left(b+a\right)x+b,x,\mathrm{domain}=\mathrm{parametric}\right)$
 ${{}\begin{array}{cc}{{}\begin{array}{cc}\left[{x}\right]& {b}{=}{0}\\ \left[{1}\right]& {\mathrm{otherwise}}\end{array}& {a}{=}{0}\\ \left[{1}{,}\frac{{b}}{{a}}\right]& {\mathrm{otherwise}}\end{array}$ (13)