SAGE : Operations with Matrices

1. Create the matrix $$\text{matA}=\begin{pmatrix} 3&5&2\\7&-3&8\\2&-4&1\end{pmatrix}$$



2. Find the determinant



3. Find the inverse



4. Find the transpose



5. Find the eigenvalues and eigenvectors for the matrix: $\begin{pmatrix} 1&4\\3&2\end{pmatrix}$



The output is in the form (eigenvalue, eigenvector, multiplicity). In this example, for eigenvalue $\lambda_1=5$ we have $v_1=\begin{pmatrix}1\\\frac{4}{3}\end{pmatrix}$ with multiplicity 1, and for $\lambda_2=-2$, $v_2=\begin{pmatrix}1\\-1\end{pmatrix}$, also with multiplicity of 1. A slightly better output might be:



6. For the system of equations: $\left\{\begin{align}-2x+3y&=13\\5x-2y&=6\end{align}\right.$, use the inverse matrix to solve the matrix equation $A\textbf{x}=B$.


There is also a command in Sage, .solve_right(), that will solve this equation:


Checking the solution: