# Why does this complex number need to be simplified before computing its power?

While playing with this mathematics.stackexchange.com problem I ran into an intriguing behavior. The problem is about proving that $$x+ \frac1x=\frac{1+\sqrt5}2\Rightarrow x^{2000}+ \frac1{x^{2000}}=2.$$ The equation on the left admits $$y=\frac{1}{4} \left(1+\sqrt{5}+i \sqrt{10-2 \sqrt{5}}\right)$$ as a solution. A critical argument in solving the linked problem is the fact that $$y^5=-1\text{ and therefore }y^{2000}=(-1)^{400}=1.$$ Now, asking Mathematica about all this yields

sol = Solve[x + 1/x == 1/2 (Sqrt + 1), x];
y = x /. sol[]
Simplify[y]

1/4 (1 + Sqrt - I Sqrt[16 - (-1 - Sqrt)^2])
1/4 (1 + Sqrt - I Sqrt[10 - 2 Sqrt])


So far, so good, although I wonder why I need to invoque Simplify. However, computing $y^5$ requires Simplifying in order to obtain $-1$:

y^5
Simplify[y^5]

(1 + Sqrt + I Sqrt[10 - 2 Sqrt])^5/1024
-1


and $y^{2000}$ is even more problematic

y^2000
Simplify[y^2000]
Simplify[y^5]^400

(1 + Sqrt + I Sqrt[10 - 2 Sqrt])^2000/1318(...)76
(1 + Sqrt + I Sqrt[10 - 2 Sqrt])^2000/1318(...)76
1


y^2000 == Simplify[y^5]^400


does not return an answer, just

(1 + Sqrt + I Sqrt[10 - 2 Sqrt])^2000/1318(...)76==1


Note that it does not appear to be related to the fact that $2000$ is large, replacing it by $20$ shows the same pattern.

My question is: what is going on? Why do I have to force simplify a complex number in order to get the correct result?

For the sake of conveinience here is my entire code:

sol = Solve[x + 1/x == 1/2 (Sqrt + 1), x];
y = x /. sol[]
Simplify[y]
"Testing y^5"
y^5
Simplify[y^5]
"Testing y^2000"
y^2000
Simplify[y^2000]
Simplify[y^5]^400
y^2000 == Simplify[y^5]^400


ps. I am running 11.0.1.0

• With version 11.0.1, Simplify[y^100] yields 1. Dec 2, 2016 at 1:49
• Put a FullSimplify on your initial definition of y, and it's all clean and obvious. In general Mathematica does the least amount of work to get you your answer on time. Simplification can be a hard task which takes a very long time. It is left to the operator to choose whether or not to do this extra work. Dec 2, 2016 at 2:02
• @bbgodfrey Same here. However Simplify[y^100] does not.
– A.G.
Dec 2, 2016 at 2:06
• @wxffles Thanks for your comment. In the present case the appearent simplicity of $y$ may be misleading. Do you suggest applying Simplify or FullSimplify on a systematic basis, even before testing something like $y^{2000}==1$ ?
– A.G.
Dec 2, 2016 at 2:10
• @wxffles FullSimplify[y^2000] does not give 1 for me. Dec 2, 2016 at 2:21

I think the easiest way to proceed is:

{a, b} = x /. Solve[x + 1/x == (1 + Sqrt)/2, x];
s = ArcTan[FullSimplify[#2/#1 & @@ ReIm[a]]]
t = ArcTan[FullSimplify[#2/#1 & @@ ReIm[b]]]


Now s and t are: $-\pi/5$ and $\pi/5$ respectively and $x=e^{\pm i \pi/5}$, hence $x^{2000}=x^{-2000}=1$ and the RHS follows.

Or perhaps even simpler by noting: for $|z|=1$, $(z+1/z)/2=\cos(z)$:

z = FullSimplify[ArcCos[(1 + Sqrt)/4]]


yields the $z=\pi/5$ with same implication.

• Thanks! Another useful step is ToPolarCoordinates@ReIm[{a, b}] // FullSimplify
– A.G.
Dec 2, 2016 at 19:59