# Can't find the eigenvectors of a simple 2x2 matrix

Bug introduced in 8.0 or earlier and fixed in 10.3.0

Why can't Mathematica find the eigenvectors of this matrix?

Eigenvectors[{{Cos[0. + x], Exp[I x]}, {1, 0}}]

Eigenvectors::eivec0: Unable to find all eigenvectors. >>
{{0, 0}, {0, 0}}


If I get rid of the (0. +) in the cosine, it works fine.

• What version of MMA are you currently using? Commented Jul 20, 2015 at 3:00
• Version 10.0.2.0, running on Mac OS X x86 Commented Jul 20, 2015 at 3:29
• V10.1 has this problem, too. Running on OS X 10.10.2. Eigenvectors[{{Cos[0. + x], Exp[I x]}, {1, 0}} // Simplify] works Commented Jul 20, 2015 at 3:51
• Yeah, the Simplify inside the Eigenvectors just gets rid of the (0. +) in the Cos, which as I mentioned in the OP fixes the problem. But obviously not always practical to Simplify if the expression's hugely complicated. Looks like a Mathematica bug, I'll report it. Commented Jul 20, 2015 at 4:34
• Try a ZeroTest -> PossibleZeroQ for a workaround. Commented Jul 20, 2015 at 4:43

[This is what Wolfram tech support told me when I filed a bug report:]

That is because using machine precision (inexact) numbers such 0. (as opposed to exact numbers like 0) forces Eigenvectors[] to seach for eigenvectors numerically and hence the error message. For example, please evaluate and compare the results of the following expression used with machine precision and exact numbers:

Eigenvectors[{{Cos[1. x], Exp[I x]}, {1, 0}}]

Eigenvectors[{{Cos[1 x], Exp[I x]}, {1, 0}}]

• No comment on this answer. I have filed a bug report. Commented Jul 22, 2015 at 2:52

This bug has been fixed as of Mathematica 10.3.

$Version (* "10.3.0 for Mac OS X x86 (64-bit) (October 9, 2015)" *) Eigenvectors[{{Cos[0. + x], Exp[I x]}, {1, 0}}] (* {{-0.5 (-Cos[0. + x] + Sqrt[4 E^(I x) + Cos[0. + x]^2]), 1.}, {-0.5 (-Cos[0. + x] - Sqrt[4 E^(I x) + Cos[0. + x]^2]), 1.}} *)  Simplify@Eigenvectors[{{Cos[0. + x], Exp[I x]}, {1, 0}}] $\left( \begin{array}{cc} e^{-1. i x} \left(-0.25 \sqrt{1.+2. e^{2 i x}+16. e^{3 i x}+e^{4 i x}}+0.25 e^{2. i x}+0.25\right) & 1. \\ 0.25 e^{-1. i x} \left(\sqrt{1.+2. e^{2 i x}+16. e^{3 i x}+e^{4 i x}}+e^{2. i x}+1.\right) & 1. \end{array} \right)$• David, I get the same result as the OP with your expression. The Simplify does nothing at all for me, as Eigenvectors returns an error. I am on MMA v. 10.2; what version are you on? I wonder if this is some recently introduce bug with the numerical methods to calculate eigenvectors. Commented Jul 20, 2015 at 2:59 • I'm on my home machine, v. 7.0.$\left( \begin{array}{cc} \frac{1}{4} e^{-i x} \left(-\sqrt{1+2 e^{2 i x}+16 e^{3 i x}+e^{4 i x}}+e^{2 i x}+1\right) & 1 \\ \frac{1}{4} e^{-i x} \left(\sqrt{1+2 e^{2 i x}+16 e^{3 i x}+e^{4 i x}}+e^{2 i x}+1\right) & 1 \end{array} \right)$Commented Jul 20, 2015 at 3:01 • I'm surprised that you get the exact$1/4\$ values in the result if you used a finite-precision 0. in the argument of Cos. Commented Jul 20, 2015 at 3:05