CoCalc Shared FilesMTH 505 / determinants.sagews
Author: Jonathan Mitchell
Views : 48
a = var('a') A = matrix([[1,-1,a],[2,2,1],[0,a,-3/2]]) show(A) show(det(A))
$\displaystyle \left(\begin{array}{rrr} 1 & -1 & a \\ 2 & 2 & 1 \\ 0 & a & -\frac{3}{2} \end{array}\right)$
$\displaystyle 2 \, a^{2} - a - 6$
a = var('a') A = matrix([[1,-1,a],[-1,2,-a],[a,1,1]]) show(A) det(A)
$\displaystyle \left(\begin{array}{rrr} 1 & -1 & a \\ -1 & 2 & -a \\ a & 1 & 1 \end{array}\right)$
-a^2 + 1
A.substitute(a==1)
[ 1 -1 1] [-1 2 -1] [ 1 1 1]
L = var('L') A = matrix([[2-L,1,1],[2,3-L,2],[1,1,2-L]]) show(A) show(expand(det(A)))
$\displaystyle \left(\begin{array}{rrr} -L + 2 & 1 & 1 \\ 2 & -L + 3 & 2 \\ 1 & 1 & -L + 2 \end{array}\right)$
$\displaystyle -L^{3} + 7 \, L^{2} - 11 \, L + 5$
A = matrix([[6, -2, 3, 0],[1, 3, 0, 1],[1, -2, 6, -2],[2, 1, 3, 7]]) D = matrix([[6, 0,0, 0],[0, 3, 0, 0],[0, 0, 6, 0],[0, 0, 0, 7]]) L = matrix([[0,0,0, 0],[-1, 0,0,0],[-1, 2, 0,0],[-2, -1, -3, 0]]) U = matrix([[0, 2, -3, 0],[0,0, 0, -1],[0,0,0, 2],[0,0,0,0]]) tmp = (D - L).inverse() T = tmp*U show(A.eigenvalues())
[$\displaystyle 3$, $\displaystyle 3.727085232845494?$, $\displaystyle 7.636457383577253? - 2.959909379970782? \sqrt{-1}$, $\displaystyle 7.636457383577253? + 2.959909379970782? \sqrt{-1}$]