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.

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 (4) 

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

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

Radicals under square roots and cube roots with arbitrary powers inside can be denested:

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

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

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

Options (2) 

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

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

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

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

Applications (2) 

Many interesting denestings can be found:

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

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[11]:=
ResourceFunction["RadicalDenest"][\[Sqrt]((5^(1/3) - 4^(1/3)))]
Out[11]=

Possible Issues (1) 

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

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

Publisher

Wolfram Summer School

Version History

  • 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