Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Get the polynomial degree of an algebraic number
| ResourceFunction["RootDegree"][s] returns the polynomial degree of the algebraic number s. | 
Find the root degree of the plastic constant, which satisfies the relation  :
:
| In[1]:= | ![ResourceFunction["RootDegree"][
Root[-1 - # + #^3& , 1, 0]]](https://www.wolframcloud.com/obj/resourcesystem/images/d38/d385cadd-6167-42a3-9d7a-118e96685b66/5aad501a13de112c.png) | 
| Out[1]= |  | 
Find the root degree for roots of polynomials of orders 2 to 8:
| In[2]:= | ![Table[ResourceFunction["RootDegree"][
  First[x /. Solve[x^k == x + 1]]], {k, 2, 8}]](https://www.wolframcloud.com/obj/resourcesystem/images/d38/d385cadd-6167-42a3-9d7a-118e96685b66/0ae113ce3c7a6191.png) | 
| Out[2]= |  | 
Find the root degree of some trigonometric roots:
| In[3]:= | ![Table[ResourceFunction["RootDegree"][Sin[\[Pi]/k]], {k, 3, 20}]](https://www.wolframcloud.com/obj/resourcesystem/images/d38/d385cadd-6167-42a3-9d7a-118e96685b66/539c7218b8cd0655.png) | 
| Out[3]= |  | 
| In[4]:= | ![Table[ResourceFunction["RootDegree"][Tan[\[Pi]/k]], {k, 3, 20}]](https://www.wolframcloud.com/obj/resourcesystem/images/d38/d385cadd-6167-42a3-9d7a-118e96685b66/3065a24699dedebd.png) | 
| Out[4]= |  | 
Root degree of an AlgebraicNumber:
| In[5]:= | ![ResourceFunction["RootDegree"][
 AlgebraicNumber[Root[#^3 + # + 1 &, 3], {1, -2, 2, -1, 1}]]](https://www.wolframcloud.com/obj/resourcesystem/images/d38/d385cadd-6167-42a3-9d7a-118e96685b66/336cae0f2dcff495.png) | 
| Out[5]= |  | 
Show the root degree of cumulative sums of roots of primes:
| In[6]:= | ![primesqrt = FoldList[Plus, 1, Sqrt[{2, 3, 5, 7, 11}]];
ResourceFunction["RootDegree"] /@ primesqrt](https://www.wolframcloud.com/obj/resourcesystem/images/d38/d385cadd-6167-42a3-9d7a-118e96685b66/2983a1b06f354694.png) | 
| Out[7]= |  | 
The default $MaxRootDegree is 1000:
| In[8]:= |  | 
| Out[8]= |  | 
Under default conditions, a degree-1000 root may be evaluated:
| In[9]:= | ![ResourceFunction["RootDegree"][
 Root[#^1000 - 123 #^777 + 211 #^356 - 127 #^123 + 888 #^11 - 2 &, 1]]](https://www.wolframcloud.com/obj/resourcesystem/images/d38/d385cadd-6167-42a3-9d7a-118e96685b66/311d4722565a8323.png) | 
| Out[9]= |  | 
A degree-1001 root will fail under default conditions:
| In[10]:= | ![ResourceFunction["RootDegree"][
 Root[#^1001 - 123 #^777 + 211 #^356 - 127 #^123 + 888 #^11 - 2 &, 1]]](https://www.wolframcloud.com/obj/resourcesystem/images/d38/d385cadd-6167-42a3-9d7a-118e96685b66/6a4f787d5a3a8194.png) | 
| Out[10]= |  | 
RootDegree only works on exact algebraic numbers:
| In[11]:= | ![ResourceFunction["RootDegree"][1.618033988749895]](https://www.wolframcloud.com/obj/resourcesystem/images/d38/d385cadd-6167-42a3-9d7a-118e96685b66/332789689044342a.png) | 
| Out[11]= |  | 
Use RootApproximant to get a number that can be given to RootDegree:
| In[12]:= | ![ResourceFunction["RootDegree"][RootApproximant[1.618033988749895]]](https://www.wolframcloud.com/obj/resourcesystem/images/d38/d385cadd-6167-42a3-9d7a-118e96685b66/21042254445eef33.png) | 
| Out[12]= |  | 
Some algebraic numbers might not be recognized by RootDegree:
| In[13]:= | ![ResourceFunction["RootDegree"][
 HypergeometricPFQ[{1/5, 2/5, 3/5, 4/5}, {1/2, 3/4, 5/4}, 3125/256]]](https://www.wolframcloud.com/obj/resourcesystem/images/d38/d385cadd-6167-42a3-9d7a-118e96685b66/1662b398d3c72b2d.png) | 
| Out[13]= |  | 
| In[14]:= | ![N[HypergeometricPFQ[{1/5, 2/5, 3/5, 4/5}, {1/2, 3/4, 5/4}, 3125/256] ==
   Root[1 - # + #^5 &, 4], 50]](https://www.wolframcloud.com/obj/resourcesystem/images/d38/d385cadd-6167-42a3-9d7a-118e96685b66/05ab676c8e39d121.png) | 
| Out[14]= |  | 
This work is licensed under a Creative Commons Attribution 4.0 International License