Function Repository Resource:

RadicalDenest

Source Notebook

Denest nested radical expressions

Contributed by: Swastik Banerjee (based on work by Corey Ziegler, Bill Gosper and Daniel Lichtblau)

ResourceFunction["RadicalDenest"][expr]

denests an expression containing nested radicals.

Details and Options

ResourceFunction["RadicalDenest"] uses heuristic methods and may fail to find a denesting when one exists.
ResourceFunction["RadicalDenest"][expr, TimeConstraintt] limits the maximum time to t seconds. When the time constraint is reached, ResourceFunction["RadicalDenest"] returns the most denested form it has found.
The default value of TimeConstraint is five seconds.
ResourceFunction["RadicalDenest"] can take Root objects as input. It will attempt to find radical forms of low denesting level.

Examples

Basic Examples (3) 

Denest a nested radical:

In[1]:=
ResourceFunction["RadicalDenest"][(2^(1/3) - 1)^(1/3)]
Out[1]=

Denest another:

In[2]:=
ResourceFunction[
 "RadicalDenest"][\[Sqrt](65 - 6 \[Sqrt]35 - 2 \[Sqrt]22 - 6 \[Sqrt]55 + 2 \[Sqrt]77 - 2 \[Sqrt]14 + 6 \[Sqrt]10)]
Out[2]=

Denest a third:

In[3]:=
ResourceFunction[
 "RadicalDenest"][((3 + 2*(5^(1/4)))/((3 - 2*(5^(1/4)))))^(1/4)]
Out[3]=

Scope (5) 

Radicals under square roots can be denested:

In[4]:=
ResourceFunction["RadicalDenest"][\[Sqrt](2 - 2^(1/7))]
Out[4]=

In[5]:=
ResourceFunction["RadicalDenest"][\[Sqrt](4^(1/5) - 3^(1/5))]
Out[5]=

Cube roots with arbitrary powers inside can be denested:

In[6]:=
ResourceFunction["RadicalDenest"][((32/5)^(1/5) - (27/5)^(1/5))^(1/3)]
Out[6]=

RadicalDenest can take Root objects as input:

In[7]:=
InputForm[
 sval = First[SolveValues[x^5 + 10 x^3 + 20 x == 4, x, Reals]]]
Out[7]=

Denest it:

In[8]:=
ResourceFunction["RadicalDenest"][sval]
Out[8]=

Sometimes a denesting effort will only manage to reduce the degree of the radical without reducing the nesting depth:

In[9]:=
ResourceFunction["RadicalDenest"][(7*(20^(1/3)) - 19)^(1/6)]
Out[9]=

Options (2) 

Some expressions cannot be denested within the default time constraint of five seconds:

In[10]:=
ResourceFunction[
 "RadicalDenest"][(14 Sqrt[2] + 9 Sqrt[5] - \[Sqrt](721 + 228 Sqrt[10]))^(1/3)]
Out[10]=

Use the TimeConstraint option to allow more time. When the time constraint elapses, the most denested form found is returned:

In[11]:=
Timing@ResourceFunction[
  "RadicalDenest"][(14 Sqrt[2] + 9 Sqrt[5] - \[Sqrt](721 + 228 Sqrt[10]))^(1/3), TimeConstraint -> 30]
Out[11]=

Applications (2) 

Many interesting denestings can be found:

In[12]:=
ResourceFunction[
 "RadicalDenest"][\[Sqrt](3*5^(1/3) + 16^(1/3)*3^(1/2)*5^(1/6) + 256^(
    1/3))]
Out[12]=

The denestings given by Ramanujan et al., having no definite algorithm that does not involve the complex roots of unity, can be done heuristically using this function:

In[13]:=
ResourceFunction["RadicalDenest"][\[Sqrt]((5^(1/3) - 4^(1/3)))]
Out[13]=

Possible Issues (1) 

Since the methods used are heuristic, setting a high TimeConstraint still might not return a fully denested expression:

In[14]:=
ResourceFunction[
 "RadicalDenest"][\[Sqrt](14 Sqrt[2] + 9 Sqrt[5] - \[Sqrt](721 + 228 Sqrt[10])), TimeConstraint -> 100]
Out[14]=

Publisher

Wolfram Summer School

Version History

  • 2.1.0 – 29 April 2024
  • 2.0.1 – 06 March 2023
  • 2.0.0 – 06 December 2020
  • 1.0.0 – 02 October 2020

Related Resources

Author Notes

Much of the work was done by Corey Ziegler, Bill Gosper and Daniel Lichtblau. The current function implemented by Swastik Banerjee adds time constraints to different heuristic approaches, compares the nesting degrees of the denested expressions obtained from each such approach and returns the best denesting possible.

License Information