Heuristic package to denest radicals

NOTE: package and examples notebooks are attached at the end of this post


If you square a surd, and then take the square root, you just get it back. But how do you take the ? if you expand it after you square it?

Sometimes FullSimplify is smart enough:

ScreenShot2016-12-13at11.05.03AM.png

Usually, it isn’t:

ScreenShot2016-12-13at11.13.18AM.png

Corey Ziegler Hunts wrote a big heuristic package to denest radicals:

ScreenShot2016-12-13at11.15.04AM.png

(Why “Strad”?) But usually radicals don’t denest:

ScreenShot2016-12-13at11.18.09AM.png

When they do, the result can be startling:

Can this be right?

ScreenShot2016-12-13at11.23.18AM.png

Yep. Hopefully this will be obsoleted by Mathematica’s developers. But maybe not. I confess near total ignorance of Galois theory, which underlies all the denesting papers. But those papers never exhibit any cool new denestings! SAGE and Maple are rumored to denest, but again, where are goodies like

There are some issues. If there is no denesting, it can take infeasibly long to give up. And it doesn’t listify. It misconstrues lists.

Illustrating the widespread underuse of denesting, Theta Function gives:

ScreenShot2016-12-13at3.32.31PM.png

Tsk.

Is it possible for the nth root of a real binomial to denest to more than five terms? I’ve never seen one.

17 Likes

Dear Bill,

This is an amazing package! What license have you published it under? May I use it and derivative work in my open source projects?

What about applying PowerExpand?

In[2]:= Sqrt[PowerExpand[(Sqrt[2] - 1)^2]]

Out[2]= -1 + Sqrt[2]

In[3]:= Sqrt[PowerExpand[(Sqrt[3] - Sqrt[2])^2]]

Out[3]= -Sqrt[2] + Sqrt[3]

Vladimir: Sorry to have only now seen your query. License? Corey wrote this years ago while of highschool age, and appears to lack further interest in it. He has moved on from mathematics (Minskys & Trinskys 3rd Edition by Julian & Corey Ziegler Hunts, R.W. Gosper & Jack Holloway | Blurb Books) to software engineering. I believe his chief concern with this package is not to be contacted when someone finds a bug! --Bill

1 Like

Dear Valeriu: PowerExpand has no effect here–you could replace it by Identity. And replacing it with Expand has the exact opposite effect of what Strad (and its verbose cousin DenestRadicals3)

In[491]:= Sqrt[Expand[(Sqrt[3] - Sqrt[2])^2]]

Out[491]= Sqrt[5 - 2 Sqrt[6]]

In[492]:= DenestRadicals3@%

During evaluation of In[492]:= {f[Sqrt[5-2 Sqrt[6]]]}

During evaluation of In[492]:=

During evaluation of In[492]:= problem Sqrt[5-2 Sqrt[6]]

During evaluation of In[492]:= outer root: 2 extra root: 1

During evaluation of In[492]:=

During evaluation of In[492]:= multiplier count: 2 multipliers: {1,Sqrt[6]}

During evaluation of In[492]:= multiplier: 1 minpoly degree: 4

During evaluation of In[492]:= adding new multipliers from: 1

During evaluation of In[492]:= multiplier: Sqrt[6] minpoly degree: 4

During evaluation of In[492]:= adding new multipliers from: Sqrt[6]

During evaluation of In[492]:= multiplier count: 3 from: {1,4}

During evaluation of In[492]:= multiplier: 2 minpoly degree: 2

During evaluation of In[492]:= success: {2,2,{{2,1}}}

During evaluation of In[492]:= history: {{0,[Infinity]},{1,4},{2,2}}

During evaluation of In[492]:= -Sqrt[2]+Sqrt[3]

During evaluation of In[492]:=

Out[492]= -Sqrt[2] + Sqrt[3]

are trying to achieve, namely, to convert the radicand back into a power that cancels the root operation.
So I don’t understand the objective of PowerExpand here. --Bill

2 Likes