Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

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=1ad−bc[d−b−ca]\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 ad−bc≠0{\colorOne{a}\colorTwo{d} - bc \ne 0}.

Example

Find the inverse of A=[21−43]A= \left[ \begin{array}{rr} \colorOne{2}&1\\ -4&\colorTwo{3} \end{array} \right].


A−1=1(2)(3)−(1)(−4)[3−1−(−4)2]=110[3−142]=[310−110210110]\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}


Matrix Inverse (Any Size)

Use Gauss-Jordan elimination to row reduce AA into II. Applying the same EROs to II will give us A−1A^{-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. A−1=XA^{-1}=X


Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

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

A−1=1(1)(5)−(3)(2)[5−3−21]=(−1)[5−3−21]=[−532−1]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]R2−2R1⟶[13100−1−21](−1)R2⟶[13100   12−1]R1−3R2⟶[10−530   12−1]=[IA−1]\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}

∴    A−1=[−532−1]\therefore\;\;A^{-1}=\left[\begin{array}{rr}-5 & 3\\2 & -1\end{array}\right]

Note: You can always check your answer.

AA−1=[1325][−532−1]=[1001]=I✓AA^{-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}

A−1A=[−532−1][1325]=[1001]=I✓A^{-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}

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

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]R3−2R1⟶[   1   1   2   1   0   00110100−10−201]R1−R2R3+R2⟶[   1   0   1   1   −1   0011010001−211]R1−R3R2−R3⟶[   1   0   0   3   −2   −101020−1001−211]=[IA−1]\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 A−1=[3−2−120−1−211]A^{-1} = \left[\begin{array}{rrr} 3&-2&-1\\ 2&0&-1\\ -2&1&1 \end{array}\right].

Exercise: check if AA−1=IAA^{-1}=I and A−1A=IA^{-1}A=I.

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=[−1−42310−2−2−71]M=\left[\begin{array}{rrr} -1 & -4&2\\[0.5em] 3 & 10&-2\\[0.5em] -2&-7&1 \end{array}\right].

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

Extra Practice