This is documentation for Mathematica 5, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)

Documentation / Mathematica / Add-ons & Links / Standard Packages / NumberTheory /


This package defines the function Recognize for determining a polynomial with integer coefficients, given an approximate real zero of the polynomial and the degree of the polynomial. The resulting polynomial is normally not unique.

Determining a polynomial from a solution.

This loads the package.

In[1]:= << NumberTheory`Recognize`

This finds a linear polynomial in t with solution 1.7.

In[2]:= Recognize[1.7, 1, t]


NSolve gives the numerical solutions of a cubic equation.

In[3]:= NSolve[3 x^3 - 2 x + 5 == 0]


Here is the first solution.

In[4]:= sol = First[x /. %]


This result is proportional to the original polynomial used in NSolve.

In[5]:= Recognize[sol, 3, t]


Here is a quadratic polynomial for which sol is an approximate solution.

In[6]:= Recognize[sol, 2, t]


This result is a polynomial of degree 5.

In[7]:= Recognize[N[Sqrt[3^(2/5)]], 5, t]


If the penalty is large enough, a lower-order polynomial may be returned.

In[8]:= Recognize[N[Sqrt[3^(2/5)]], 5, t, 10]