0:00 / 0:00

Matrix Inverse Algorithm

Matrix Inverse (2×2\colorOne{2\times2})

The inverse of a 2×22\times2 matrix can be found using the following formula:
[abcd]1=1adbc[dbca]\left[\begin{array}{rr} \colorOne{a} & b\\ c & \colorTwo{d} \end{array}\right]^{-1} = \dfrac{1} {\colorOne{a}\colorTwo{d} - bc} \left[ \begin{array}{rr} \colorTwo{d} & \colorFour{-}b\\ \colorFour{-}c & \colorOne{a} \end{array} \right]
Note: a 2×22\times2 matrix is invertible if and only if adbc0{\colorOne{a}\colorTwo{d} - bc \ne 0}.
Example
Find the inverse of A=[2143]A= \left[ \begin{array}{rr} \colorOne{2}&1\\ -4&\colorTwo{3} \end{array} \right].

A1=1(2)(3)(1)(4)[31(4)2]=110[3142]=[310110210110]\begin{aligned} A^{-1} &= \frac{1} {(\colorOne{2})(\colorTwo{3})-(1)(-4)} \left[ \begin{array}{cc} \colorTwo{3} & \colorFour{-}1\\ \colorFour{-}(-4) & \colorOne{2} \end{array} \right]\\[2em] &= \dfrac{1}{10} \left[\begin{array}{rr} 3&-1\\ 4&2 \end{array} \right]\\[2em] &= \left[ \begin{array}{rr} \dfrac{3}{10}&-\dfrac{1}{10}\\[1.5em] \dfrac{2}{10}&\dfrac{1}{10} \end{array} \right] \end{aligned}

PAGE BREAK

Matrix Inverse (Any Size)

Use Gauss-Jordan elimination to row reduce AA into II. Applying the same EROs to II will give us A1A^{-1}!
Steps
  1. Augment the matrix An×nA_{n \times n} with InI_n: [AI]\left[\begin{array}{c|c} A&I \end{array}\right] Example (3×33\times 3): [a11a12a131  0  0  a21a22a230  1  0  a31a32a330  0  1  ]\left[\begin{array}{rrr|rrr} a_{11} & a_{12} & a_{13} & 1\ \ & 0\ \ & 0\ \ \\ a_{21} & a_{22} & a_{23} & 0\ \ & 1\ \ & 0\ \ \\ a_{31} & a_{32} & a_{33} & 0\ \ & 0\ \ & 1\ \ \end{array}\right]
  2. Use Gauss-Jordan elimination to row reduce AA to II, creating the matrix: [IX]\left[\begin{array}{c|c} I&X \end{array}\right] Example (3×33\times 3): [1  0  0  x11x12x130  1  0  x21x22x230  0  1  x31x32x33]\left[\begin{array}{ccc|ccc} 1\ \ & 0\ \ & 0\ \ & x_{11} & x_{12} & x_{13} \\ 0\ \ & 1\ \ & 0\ \ & x_{21} & x_{22} & x_{23} \\ 0\ \ & 0\ \ & 1\ \ & x_{31} & x_{32} & x_{33} \end{array}\right]
  3. A1=XA^{-1}=X
Wize Tip
If AA cannot be row reduced to II, then A1A^{-1} does not exist, i.e. AA is not invertible.

0:00 / 0:00

Example: Matrix Inverse Algorithm

Find the inverse of A=[1325]A=\left[\begin{array}{rr}1 & 3\\2 & 5\end{array}\right] using the formula for a 2×22\times2 matrix, and using the Gauss-Jordan elimination algorithm.

Using the Formula

A1=1(1)(5)(3)(2)[5321]=(1)[5321]=[5321]A^{-1} =\dfrac{1}{(1)(5)-(3)(2)} \left[\begin{array}{rr} 5 & -3\\ -2 & 1 \end{array}\right] = (-1) \left[\begin{array}{rr} 5 & -3\\ -2 & 1 \end{array}\right] =\left[\begin{array}{rr} -5 & 3\\ 2 & -1 \end{array}\right]

Using the Algorithm

[AI]=[13102501]R22R1[13100121](1)R2[13100   121]R13R2[10530   121]=[IA1]\begin{aligned} \left[ \begin{array}{r|r} A&I \end{array} \right] =& \left[ \begin{array}{rr|rr} 1&3&1&0\\ 2&5&0&1 \end{array} \right] \begin{array}{l} \\ R_2-2R_1\\ \end{array}\\[2em] \longrightarrow& \left[ \begin{array}{rr|rr} 1&3&1&0\\ 0&-1&-2&1 \end{array} \right] \begin{array}{l} \\ (-1)R_2\\ \end{array}\\[2em] \longrightarrow& \left[ \begin{array}{rr|rr} 1&3&1&0\\ 0&\ \ \ 1&2&-1 \end{array} \right] \begin{array}{l} R_1-3R_2\\ \\ \end{array}\\[2em] \longrightarrow& \left[ \begin{array}{rr|rr} 1&0&-5&3\\ 0&\ \ \ 1&2&-1 \end{array} \right] = \left[ \begin{array}{r|r} I&A^{-1} \end{array} \right] \end{aligned}
    A1=[5321]\therefore\;\;A^{-1}=\left[\begin{array}{rr}-5 & 3\\2 & -1\end{array}\right]
Note: You can always check your answer.
AA1=[1325][5321]=[1001]=IAA^{-1} = \left[ \begin{array}{rr} 1 & 3\\ 2 & 5 \end{array} \right] \left[ \begin{array}{rr} -5 & 3\\ 2 & -1 \end{array} \right] = \left[ \begin{array}{rr} 1 & 0\\ 0 & 1 \end{array} \right] = I \quad \colorThree{\checkmark}
A1A=[5321][1325]=[1001]=IA^{-1}A= \left[\begin{array}{rr} -5 & 3\\ 2 & -1 \end{array} \right] \left[ \begin{array}{rr} 1 & 3\\ 2 & 5 \end{array} \right] = \left[ \begin{array}{rr} 1 & 0\\ 0 & 1 \end{array} \right] = I \quad \colorThree{\checkmark}
0:00 / 0:00

Example: Matrix Inverse Algorithm

Find the inverse of the matrix A=[112011214] A=\begin{bmatrix} 1 & 1 & 2 \\ 0 & 1 & 1 \\ 2 & 1 & 4 \\ \end{bmatrix}, if it exists.

[AI]=[   1   1   2   1   0   0011010214001]R32R1[   1   1   2   1   0   0011010010201]R1R2R3+R2[   1   0   1   1   1   0011010001211]R1R3R2R3[   1   0   0   3   2   1010201001211]=[IA1]\begin{aligned} \left[ \begin{array}{r|r} A&I \end{array} \right] =& \left[\begin{array}{rrr | rrr} \ \ \ 1 &\ \ \ 1 &\ \ \ 2 &\ \ \ 1 &\ \ \ 0 &\ \ \ 0 \\ 0 & 1 & 1 & 0 & 1 &0\\ 2 & 1 & 4 & 0 & 0 &1 \\ \end{array}\right] \begin{array}{l} \\ \\ R_3 - 2R_1\\ \end{array}\\[2.5em] \longrightarrow& \left[\begin{array}{rrr | rrr} \ \ \ 1 &\ \ \ 1 &\ \ \ 2 &\ \ \ 1 &\ \ \ 0 &\ \ \ 0 \\ 0 & 1 & 1 & 0 & 1 &0\\ 0 & -1 & 0 & -2 & 0 &1 \\ \end{array}\right] \begin{array}{l} R_1 - R_2\\ \\ R_3 + R_2\\ \end{array}\\[2.5em] \longrightarrow& \left[\begin{array}{rrr | rrr} \ \ \ 1 &\ \ \ 0 &\ \ \ 1 &\ \ \ 1 &\ \ \ -1 &\ \ \ 0 \\ 0 & 1 & 1 & 0 & 1 &0\\ 0 & 0 & 1 & -2 & 1 &1 \\ \end{array}\right] \begin{array}{l} R_1 - R_3\\ R_2 - R_3\\ \\ \end{array}\\[2.5em] \longrightarrow& \left[\begin{array}{rrr | rrr} \ \ \ 1 &\ \ \ 0 &\ \ \ 0 &\ \ \ 3 &\ \ \ -2 &\ \ \ -1 \\ 0 & 1 & 0 & 2 & 0 &-1\\ 0 & 0 & 1 & -2 & 1 &1 \\ \end{array}\right] = \left[ \begin{array}{r|r} I&A^{-1} \end{array} \right] \end{aligned}
Since we were able to reduce AA into II, the inverse exists and A1=[321201211]A^{-1} = \left[\begin{array}{rrr} 3&-2&-1\\ 2&0&-1\\ -2&1&1 \end{array}\right].
Exercise: check if AA1=IAA^{-1}=I and A1A=IA^{-1}A=I.
checklist
Mark Yourself Question
  1. Grab a piece of paper and try this problem yourself.
  2. When you're done, check the "I have answered this question" box below.
  3. View the solution and report whether you got it right or wrong.
Find the inverse of the matrix M=[1423102271]M=\left[\begin{array}{rrr} -1 & -4&2\\[0.5em] 3 & 10&-2\\[0.5em] -2&-7&1 \end{array}\right].