Finding the Inverse of a Matrix

## Description

Here is a Sage cell that calculates the inverse of matrix $\it{A}$, where

(1)
\begin{align} \it{A} = \begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix} \end{align}

## Sage Cell

#### Code

A = matrix(2, 2, [1, 2, 3, 4])
B = A.inverse()
B


## Options

We can test if a matrix is invertible without actually inverting it with the .is_invertible() method:

#### Code

A = matrix(QQ, [[1, 2], [3, 4]])
print(A.is_invertible())
B =  matrix(QQ, [[1, 2], [2, 4]])
print(B.is_invertible())


## Tags

CC:

Primary Tags: Linear algebra: Matrices.

Secondary Tags: Matrices: Matrix basics, Matrix inverses.