︠a16cf10e-e5d6-4c9e-b4a2-b4a45f515a98s︠
a = var('a')
A = matrix([[1,-1,a],[2,2,1],[0,a,-3/2]])
show(A)
show(det(A))
︡d166c848-91ea-4909-8fd5-ed92b378f272︡{"html":"
$\\displaystyle \\left(\\begin{array}{rrr}\n1 & -1 & a \\\\\n2 & 2 & 1 \\\\\n0 & a & -\\frac{3}{2}\n\\end{array}\\right)$
"}︡{"html":"$\\displaystyle 2 \\, a^{2} - a - 6$
"}︡{"done":true}
︠674872d7-89bc-4a82-a7dc-d2ae3be50b17s︠
a = var('a')
A = matrix([[1,-1,a],[-1,2,-a],[a,1,1]])
show(A)
det(A)
︡b3f3a52a-08c9-4c4d-b093-bd448f258e5b︡{"html":"$\\displaystyle \\left(\\begin{array}{rrr}\n1 & -1 & a \\\\\n-1 & 2 & -a \\\\\na & 1 & 1\n\\end{array}\\right)$
"}︡{"stdout":"-a^2 + 1\n"}︡{"done":true}
︠f12ac49a-6abc-4c47-a132-19077d1d8c54s︠
A.substitute(a==1)
︡6e3beebb-b0f3-43ef-b497-ca3f2a5212e1︡{"stdout":"[ 1 -1 1]\n[-1 2 -1]\n[ 1 1 1]\n"}︡{"done":true}
︠fd2a2b9f-0240-4a2c-be13-71c733a28768s︠
L = var('L')
A = matrix([[2-L,1,1],[2,3-L,2],[1,1,2-L]])
show(A)
show(expand(det(A)))
︡1d29f5ec-ef38-4f32-81ad-885522bcd028︡{"html":"$\\displaystyle \\left(\\begin{array}{rrr}\n-L + 2 & 1 & 1 \\\\\n2 & -L + 3 & 2 \\\\\n1 & 1 & -L + 2\n\\end{array}\\right)$
"}︡{"html":"$\\displaystyle -L^{3} + 7 \\, L^{2} - 11 \\, L + 5$
"}︡{"done":true}
︠fb3dc482-d492-4f71-b908-75cac6d62009s︠
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())
︡9c845164-7c57-4f01-8eae-06b3eb0b7fbe︡{"html":"[$\\displaystyle 3$, $\\displaystyle 3.727085232845494?$, $\\displaystyle 7.636457383577253? - 2.959909379970782? \\sqrt{-1}$, $\\displaystyle 7.636457383577253? + 2.959909379970782? \\sqrt{-1}$]
"}︡{"done":true}
︠d17d2019-87db-470e-a78d-c2ba692f51d5︠