# Eigensystem, Eigenvalue doesn't output nonreal eigenvalues

Basically I have a matrix and when I used either Eigenvalue or Eigensystem, it doesn't output nonreal eigenvalues, instead it leaves it in the form of $$\sqrt{-1}^{1/3}$$ or something in terms of $\sqrt{-1}$

The matrix I have is

F = {{-1/4, 1/4 + 1/Sqrt, -1/2 + 1/(2  Sqrt)},
{1/4 - 1/Sqrt, -1/4, -1/2 - 1/(2 Sqrt)},
{-1/2 - 1/(2 Sqrt), -1/2 + 1/(2 Sqrt), 1/2}}


I am trying to diagonalize this.

EDIT Adding Simplify seems to have solved half of the problem, it displays the eigenvectors in complex numbers, but the eigenvalues still in unsimplified form.

• Why do you think $\sqrt{-1}$ is not non-real? In any case, use N@Eigenvalues@F. – rm -rf Nov 16 '12 at 7:11
• What does '@' do? – Hawk Nov 16 '12 at 7:14
• if you type F-Transpose[F] you will find out that your matrix is not symmetric so its eigenvalues need not be real. And indeed they are not. – chris Nov 16 '12 at 7:29
• @jak N @ Eigenvalues @ F is the same as N[ Eigenvalues[ F ] ] and the same as F // Eigenvalues // N. So these are the three ways of using functions on some arguments. – au700 Nov 16 '12 at 7:36
• Have a look at reference.wolfram.com/mathematica/tutorial/… – Sjoerd C. de Vries Nov 16 '12 at 8:33

## 2 Answers

This might be what you were expecting:

In[]:=
{{-1/4, 1/4 + 1/Sqrt, -1/2 + 1/(2 Sqrt)},
{1/4 - 1/Sqrt, -1/4, -1/2 - 1/(2 Sqrt)},
{-1/2 - 1/(2 Sqrt), -1/2 + 1/(2 Sqrt), 1/2}} // Eigenvalues // ExpToTrig

Out[]=
{-1/2 + (I Sqrt)/2, -1/2 - (I Sqrt)/2, 1}


where ExpToTrig[] converts the exponentials like $(-1)^{2/3}$ accordingly.

The appropriate function for symbolic representation of complex functions and numbers is ComplexExpand, e.g.

ComplexExpand @ Table[(-1)^(k/3), {k, 3}]

{1/2 + (I Sqrt)/2, -(1/2) + (I Sqrt)/2, -1}


For this specific task ExpToTrig yields the expected result, but for more general cases I recommend using ComplexExpand instead of ExpToTrig, for F (defined in the question) it yields the same :

ComplexExpand @ Eigenvalues @ F == ExpToTrig @ Eigenvalues @ F

True


Consider for example this matrix :

m = Array[GCD, {3, 3}];


it yields eigenvalues of m in terms of Root objects, to get the result in terms of radicals one could add this option Cubics->True to Eigenvalues, Eigensystem etc. (this answer would be helpful as well).

Let's compare how ExpToTrig and ComplexExpand deal with Eigenvalues in this case :

ExpToTrig @ Eigenvalues[ m, Cubics -> True] // TraditionalForm Therefore we can't even be sure that the eigenvalues are real numbers until we don't evaluate e.g. :

# ∈ Reals & /@ Eigenvalues[ m]

{True, True, True}


we can see that ExpToTrig is not really helpful here, unlike ComplexExpand yielding symbolic eigenvalues, manifestly real:

ComplexExpand @ Eigenvalues[ m, Cubics -> True] // TraditionalForm 