Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

In this approach you can check that the eigenvalues are real:

reset()
f=lambda x:matrix([[1+x, 0, x],[0, 2, 2*x],[x, 2*x, 1+x]]).eigenvalues()
#the first ***real*** eigenvalue versus x 
l0=[[x,f(x)[0]] for x in srange(0,0.5,0.01)]
p0=list_plot(l0,plotjoined=true)
#the second eigenvalue
l1=[[x,f(x)[1]] for x in srange(0,0.5,0.01)]
p1=list_plot(l1,plotjoined=true)
#the third eigenvalue
l2=[[x,f(x)[2]] for x in srange(0,0.5,0.01)]
p2=list_plot(l2,plotjoined=true)
# all
show(p0+p1+p2)