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.

## Related Cells

- Matrices in Sage. Matrices in Sage.
- Elementary Row Operations on Matrices Using Sage to perform elementary row operations.
- Augmented Matrices. Augmenting a matrix with a column vector.
- The determinant of a matrix. Taking the determinant of a matrix.
- The product of two matrices. Calculating the product of two matrices.
- The rank of a matrix. Calculating the rank of a matrix.
- The RREF of a matrix. Computing the RREF of a matrix.
- Finding the Pivot Columns of a Matrix. Finding the pivot columns of a matrix.
- Finding the Free Columns of a Matrix. Finding the free columns of a matrix.
- Testing a Matrix for Singularity. Testing a given matrix to see if it is singular (noninvertible).
- Constructing Identity Matrices. A special command to create an identity matrix.

## Attribute

Permalink:

Author: R. Beezer

Date: 04 Mar 2019 21:51

Submitted by: Zane Corbiere