Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Get the full list of complex nth roots of a number
ResourceFunction["ComplexRoots"][x,n] gives a list of the nth roots of a complex number x. |
Find the three third roots of unity:
In[1]:= | ![]() |
Out[1]= | ![]() |
Find the sixth roots of 2:
In[2]:= | ![]() |
Out[2]= | ![]() |
Find the fifth roots of -1:
In[3]:= | ![]() |
Out[3]= | ![]() |
Exact values are returned for exact input:
In[4]:= | ![]() |
Out[4]= | ![]() |
Use the resource function ComplexRootQ to confirm the output of ComplexRoots:
In[5]:= | ![]() |
Out[5]= | ![]() |
The output of ComplexRoots[1,n] is similar to the output of the resource function PrimitiveRootOfUnityList[n] with the exception that 1 is missing from the latter:
In[6]:= | ![]() |
Out[6]= | ![]() |
In[7]:= | ![]() |
Out[7]= | ![]() |
This work is licensed under a Creative Commons Attribution 4.0 International License