Im trying to find eigenvalues for the matrix
\begin{bmatrix} 2 & -1 & -1 \\ -1 & 1 & 1 \\ -1 & 1 & 4 \end{bmatrix}
Finding the eigenvalues using the Eigenvalues function I get:
N@Eigenvalues[ {
{2, -1, -1},
{-1, 1, 1},
{-1, 1, 4}
} ]
And it returns
{4.8662, 1.78924, 0.344558}
However, when I try to solve it by hand, and using the Characteristic Polynomial function
CharacteristicPolynomial[ {
{2, -1, -1},
{-1, 1, 1},
{-1, 1, 4}
} , \[Lambda]]
I get $$3 - 11 \lambda + 7 \lambda^2 - \lambda ^3$$
Solving it for zero I get non real answers.
N@Solve[3 - 11 \[Lambda] + 7 \[Lambda]^2 - \[Lambda]^3 ==
0, \[Lambda]]
{{\[Lambda] -> 4.8662 + 7.40149*10^-17 I},
{\[Lambda] ->
0.344558 + 4.44089*10^-16 I},
{\[Lambda] ->
1.78924 - 4.44089*10^-16 I}}
NSolve[charpoly == 0, \[Lambda]]instead ofN@Solve[charpoly == 0, \[Lambda]]you get all real solutions. – aardvark2012 Sep 27 '17 at 04:24Solve[]and appliedN[]to the results, you might want to recall that the results are an instance of casus irreducibilis; you are then making Mathematica compute a real result from complex numbers, and thus the tiny imaginary part is but an artifact. – J. M.'s missing motivation Sep 27 '17 at 04:26ComplexExpand:Solve[3 - 11 \[Lambda] + 7 \[Lambda]^2 - \[Lambda]^3 == 0, \[Lambda]] // ComplexExpand // N– Bob Hanlon Sep 27 '17 at 04:47