PolynomialTools - Maple Programming Help

Home : Support : Online Help : Mathematics : Optimization : PolynomialTools/MinimalPolynomial

PolynomialTools

 MinimalPolynomial
 find minimal polynomial for an approximate root
 AnnihilatingPolynomial
 find an annihilating polynomial for an approximate root

 Calling Sequence MinimalPolynomial(r, x, n, acc) AnnihilatingPolynomial(r, x, n, acc)

Parameters

 r - approximate root x - (optional) variable name n - degree of the polynomial sought acc - (optional) desired accuracy of the approximation

Description

 • The MinimalPolynomial and AnnihilatingPolynomial functions use the lattice algorithm to find a polynomial of degree n (or less) with small integer coefficients which has the given approximation r of an algebraic number as one of its roots.  The output of MinimalPolynomial will be an irreducible polynomial, while the output of AnnihilatingPolynomial may be a polynomial of degree closer to the bound n.
 • If a name is not specified for the variable x, then $\mathrm{_X}$ is used.
 • The root r may be real or complex.  It may be input as a floating-point approximation to a root or as an exact algebraic number.  In the latter case, it will first be evaluated in floating point at Digits precision. This procedure is intended for approximate inputs. If r is an exact algebraic number then the minimum polynomial can be found with the command evala(Norm(_X-r)), where r is in RootOf notation.
 • The value $\mathrm{acc}\left|f\left(r\right)\right|$ is given the same weight as the coefficients in determining $f$, the minimal polynomial. If it is not specified, the default value for acc is $\frac{{10}^{\mathrm{Digits}-2}}{\mathrm{max}\left(1,\left|{r}^{n}\right|\right)}$.
 • This function is part of the PolynomialTools package, and so it can be used in the form MinimalPolynomial(..) only after executing the command with(PolynomialTools). However, it can always be accessed through the long form of the command by using PolynomialTools[MinimalPolynomial](..).

Examples

 > $\mathrm{with}\left(\mathrm{PolynomialTools}\right):$
 > $r≔\mathrm{evalf}\left(1+\sqrt{2}\right)$
 ${r}{:=}{2.414213562}$ (1)
 > $\mathrm{MinimalPolynomial}\left(r,x,2\right)$
 ${{x}}^{{2}}{-}{2}{}{x}{-}{1}$ (2)
 > $r≔1+\sqrt{2}$
 ${r}{:=}{1}{+}\sqrt{{2}}$ (3)
 > $\mathrm{MinimalPolynomial}\left(\frac{r}{10},x,25\right)$
 ${3}{}{{x}}^{{17}}{+}{2}{}{{x}}^{{16}}{-}{4}{}{{x}}^{{15}}{-}{7}{}{{x}}^{{14}}{-}{2}{}{{x}}^{{13}}{+}{3}{}{{x}}^{{12}}{-}{5}{}{{x}}^{{11}}{+}{6}{}{{x}}^{{10}}{-}{3}{}{{x}}^{{9}}{-}{10}{}{{x}}^{{8}}{+}{{x}}^{{7}}{+}{5}{}{{x}}^{{6}}{-}{{x}}^{{5}}{+}{4}{}{{x}}^{{4}}{-}{4}{}{{x}}^{{3}}{-}{4}{}{{x}}^{{2}}{-}{3}{}{x}{+}{1}$ (4)

If r is less than 1, and the tolerance is set low, the output of AnnihilatingPolynomial could be a simple monomial.

 > $\mathrm{AnnihilatingPolynomial}\left(\frac{r}{10},x,25,{10.}^{10}\right)$
 ${{x}}^{{16}}$ (5)

Setting the tolerance higher can help avoid such trivial output.

 > $\mathrm{AnnihilatingPolynomial}\left(\frac{r}{10},x,25,{10.}^{25}\right)$
 ${{x}}^{{21}}{-}{{x}}^{{19}}{+}{2}{}{{x}}^{{18}}{+}{2}{}{{x}}^{{17}}{+}{8}{}{{x}}^{{16}}{+}{4}{}{{x}}^{{15}}{-}{{x}}^{{14}}{+}{4}{}{{x}}^{{13}}{-}{3}{}{{x}}^{{12}}{-}{3}{}{{x}}^{{11}}{-}{6}{}{{x}}^{{10}}{-}{5}{}{{x}}^{{9}}{-}{4}{}{{x}}^{{8}}{+}{3}{}{{x}}^{{7}}{+}{{x}}^{{6}}{-}{8}{}{{x}}^{{5}}{+}{4}{}{{x}}^{{3}}{-}{5}{}{{x}}^{{2}}{+}{x}$ (6)
 > $\mathrm{MinimalPolynomial}\left(1.234,3\right)$
 ${22}{}{{\mathrm{_X}}}^{{3}}{-}{5}{}{{\mathrm{_X}}}^{{2}}{+}{61}{}{\mathrm{_X}}{-}{109}$ (7)
 > $\mathrm{fsolve}\left(,\mathrm{_X}\right)$
 ${1.234000001}$ (8)
 > $s≔\sqrt{2}+\sqrt{-3}$
 ${s}{:=}\sqrt{{2}}{+}{I}{}\sqrt{{3}}$ (9)
 > $r≔\mathrm{evalf}\left(s\right)$
 ${r}{:=}{1.414213562}{+}{1.732050808}{}{I}$ (10)
 > $\mathrm{MinimalPolynomial}\left(r,x,4\right)$
 ${{x}}^{{4}}{+}{2}{}{{x}}^{{2}}{+}{25}$ (11)

The minimum polynomial of the exact expression s can be determined by:

 > $\mathrm{SquareFreePart}\left(\mathrm{evala}\left(\mathrm{Norm}\left(\mathrm{convert}\left(\mathrm{_X}-s,\mathrm{RootOf}\right)\right)\right),\mathrm{_X}\right)$
 ${{\mathrm{_X}}}^{{4}}{+}{2}{}{{\mathrm{_X}}}^{{2}}{+}{25}$ (12)

Compatibility

 • The output of MinimalPolynomial(r, n, acc) prior to Maple 18 used the variable $x$.  As of Maple 18, the default variable used is $\mathrm{_X}$. You can change this using the x option.
 • The PolynomialTools[AnnihilatingPolynomial] command was introduced in Maple 18.
 • The PolynomialTools[MinimalPolynomial] command was updated in Maple 18.
 • The x parameter was introduced in Maple 18.