Hi, Sorry if this is a stupid question but i struggle to make sage compute the exact eigenvalues of a matrix. I am also confused that when I ask for the roots of the characterstic polynomial sage answer with complex roots ... I am new to sage so please forgive me :)
Here is my worksheet :
sage : A=matrix([[1,1,2],[1,-2,0],[2,0,1]])
sage : A
[ 1 1 2]
[ 1 -2 0]
[ 2 0 1]
sage :A.eigenvalues()
[-2.439311671683875?, -0.6611203141265045?, 3.100431985810380?]
sage : x=var('x')
sage : H=A.charpoly()
sage : H
x^3 - 8*x - 5
sage :H.roots()
--->[]
sage : (x^3-8*x-5).roots()
-- > [(-1/2(1/18Isqrt(1373)sqrt(3) + 5/2)^(1/3)(Isqrt(3) + 1) + 1/3(4Isqrt(3) - 4)/(1/18Isqrt(1373)sqrt(3) + 5/2)^(1/3), 1), (-1/2(1/18Isqrt(1373)sqrt(3) + 5/2)^(1/3)(-Isqrt(3) + 1) + 1/3(-4Isqrt(3) - 4)/(1/18Isqrt(1373)sqrt(3) + 5/2)^(1/3), 1), ((1/18Isqrt(1373)sqrt(3) + 5/2)^(1/3) + 8/3/(1/18Isqrt(1373)sqrt(3) + 5/2)^(1/3), 1)]