Assuming that the matrix is ββdiagonalizable, you can get the eigenvectors and eigenvalues ββthrough
from sympy import * x = Symbol('x') M = Matrix([[2,x],[x,3]]) print M.eigenvects() print M.eigenvals()
Donation:
[(-sqrt(4*x**2 + 1)/2 + 5/2, 1, [[-x/(sqrt(4*x**2 + 1)/2 - 1/2)] [ 1]]), (sqrt(4*x**2 + 1)/2 + 5/2, 1, [[-x/(-sqrt(4*x**2 + 1)/2 - 1/2)] [ 1]])] {sqrt(4*x**2 + 1)/2 + 5/2: 1, -sqrt(4*x**2 + 1)/2 + 5/2: 1}
You should check the documentation , there are many other expansions.
Note that not every matrix is ββdiagonalizable, but you can put each matrix in the Jordan Normal Form using the sympy .jordan_form
.
source share