# How to stop FullSimplify from returning Root objects

I have several expressions in a series, such as

1/4 (-(1/4) + Sqrt[5]/4 + I Sqrt[5/8 + Sqrt[5]/8]) (-1 - Sqrt[5] + 2 Sqrt[7/2 + (5 Sqrt[5])/2])


If I run FullSimplify over it, it returns a Root object,

Root[1 + #1 + 3 #1^2 + 5 #1^3 + 6 #1^4 + 5 #1^5 + 7 #1^6 + 2 #1^7 + #1^8 &, 8]


which is rather useless for further computation. Of course, using ToRadicals (which seems to be the general answer I've found for this situation) does not work with a degree 8 polynomial. The full expressions are very cumbersome, and using only Simplify is not enough. So I need to run FullSimplify over them.

The only solutions I've found so far, as I said, rely either on ToRadicals, or in not using FullSimplify at all.

Does anybody know how to stop FullSimplify from returning these objects, while still being able to do the simplifications?

Thanks!

• sol=FullSimplify[ Root[…]/. Root-> root]/. root-> Root ? – chris May 6 '15 at 16:34

Root-expressions are very useful. It is worth reading the documentation about it. Often, doing computations with Root-expressions is simpler and more general than with Radicals.

Having said that, it might be that you are looking for something like this:

FullSimplify[1/4 (-(1/4)+Sqrt[5]/4+I Sqrt[5/8+Sqrt[5]/8]) (-1-Sqrt[5]+2 Sqrt[7/2+(5 Sqrt[5])/2]),
ComplexityFunction -> (1000 Count[#, Root[__], All] + LeafCount[#] &)]

(*  -(1/16) (-1+Sqrt[5]+I Sqrt[2 (5+Sqrt[5])]) (1+Sqrt[5]-Sqrt[14+10 Sqrt[5]]) *)


I ran into this myself just a moment ago. The trick is to use a user-defined Complexity function:

expression = x^3 - 2*x^2 - 6*x + 5
f[e] = 100 Count[e, _Root, {0, Infinity}] + LeafCount[e]
Simplify@Solve[expression == 0, x]
FullSimplify@Solve[expression == 0, x]
FullSimplify[Solve[expression == 0, x], ComplexityFunction -> f]


$$\left\{\left\{x\to \frac{1}{3} \left(\sqrt[3]{\frac{11}{2} \left(-1+3 i \sqrt{39}\right)}+\frac{2\ 11^{2/3}}{\sqrt[3]{\frac{1}{2} \left(-1+3 i \sqrt{39}\right)}}+2\right)\right\},\left\{x\to \frac{1}{6} i \left(\sqrt{3}+i\right) \sqrt[3]{\frac{11}{2} \left(-1+3 i \sqrt{39}\right)}+\frac{2}{3}-\frac{11^{2/3} \left(1+i \sqrt{3}\right)}{3 \sqrt[3]{\frac{1}{2} \left(-1+3 i \sqrt{39}\right)}}\right\},\left\{x\to -\frac{1}{6} \left(1+i \sqrt{3}\right) \sqrt[3]{\frac{11}{2} \left(-1+3 i \sqrt{39}\right)}+\frac{2}{3}+\frac{11^{2/3} i \left(\sqrt{3}+i\right)}{3 \sqrt[3]{\frac{1}{2} \left(-1+3 i \sqrt{39}\right)}}\right\}\right\}$$

$$\left\{\left\{x\to \text{Root}\left[\text{\#1}^3-2 \text{\#1}^2-6 \text{\#1}+5\&,3\right]\right\},\left\{x\to \text{Root}\left[\text{\#1}^3-2 \text{\#1}^2-6 \text{\#1}+5\&,1\right]\right\},\left\{x\to \text{Root}\left[\text{\#1}^3-2 \text{\#1}^2-6 \text{\#1}+5\&,2\right]\right\}\right\}$$

$$\left\{\left\{x\to \frac{1}{3} \left(\sqrt[3]{\frac{11}{2} \left(-1+3 i \sqrt{39}\right)}+\sqrt[3]{\frac{11}{2} \left(-1-3 i \sqrt{39}\right)}+2\right)\right\},\left\{x\to \frac{1}{6} \left((-2)^{2/3} \sqrt[3]{-11+33 i \sqrt{39}}-2^{2/3} \sqrt[3]{11+33 i \sqrt{39}}+4\right)\right\},\left\{x\to -\frac{1}{3} \sqrt[3]{-\frac{11}{2}} \sqrt[3]{-1+3 i \sqrt{39}}+\frac{2}{3}+\frac{2 (-11)^{2/3}}{\sqrt[3]{-\frac{27}{2}+\frac{81 i \sqrt{39}}{2}}}\right\}\right\}$$

This is adapted from the basic example in the ComplexityFunction documentation page.

expr = 1/4 (-(1/4) + Sqrt[5]/4 + I Sqrt[5/8 + Sqrt[5]/8]) (-1 - Sqrt[5] +
2 Sqrt[7/2 + (5 Sqrt[5])/2]);

expr2 = expr // Simplify


You can in this case -- and may with the full expressions -- get a simpler form if you express in terms of the GoldenRatio

(expr3 = (expr /. Sqrt[5] -> 2 Inactive[GoldenRatio] - 1) // Simplify //

expr == expr2 == expr3 // Simplify