Tutorials › Linear Algebra › Solving Several Systems with One Matrix Inverse

Elementary Matrices and Inverses · Tutorial 101 of 1000

Solving Several Systems with One Matrix Inverse

Learn how a single inverse gives the solutions for multiple right-hand sides, and how the same answers appear through row reduction.

Beginner 9 min read

What You'll Learn

  • Set up several systems as one matrix equation.
  • Check the dimensions needed to multiply by an inverse.
  • Find every solution column using one computed inverse.
  • Prove why the inverse method gives the unique solutions.
  • Compare inverse multiplication with row-reducing an augmented matrix.
  • Avoid reversing the order of matrix multiplication.

Several Right-Hand Sides, One Coefficient Matrix

Suppose several systems have the same coefficient matrix but different right-hand sides. Solving each system separately repeats work: the coefficients are unchanged, so the elimination steps needed to simplify them are unchanged too. If the coefficient matrix is invertible, its inverse gives a direct way to reuse that work. Arrange the right-hand sides as columns of one matrix, multiply once by the inverse, and read the individual solutions from the resulting columns.

Let \(\mathbf{A}\) be an invertible \(n\times n\) matrix, and let \(\mathbf{b}_1,\dots,\mathbf{b}_k\) be right-hand sides in \(\mathbb{R}^n\). Put those right-hand sides into the columns of \(\mathbf{B}\in\mathbb{R}^{n\times k}\). The systems \(\mathbf{A}\mathbf{x}_j=\mathbf{b}_j\) can then be gathered into one matrix equation. This works because the \(j\)-th column of a matrix product \(\mathbf{A}\mathbf{X}\) is \(\mathbf{A}\) times the \(j\)-th column of \(\mathbf{X}\).

Definition: A square matrix \(\mathbf{A}\in\mathbb{R}^{n\times n}\) is invertible if there is a matrix \(\mathbf{A}^{-1}\) such that \(\mathbf{A}\mathbf{A}^{-1}=\mathbf{A}^{-1}\mathbf{A}=\mathbf{I}_n\). For a matrix of right-hand sides \(\mathbf{B}\in\mathbb{R}^{n\times k}\), the corresponding matrix of solutions is \(\mathbf{X}\in\mathbb{R}^{n\times k}\), with its \(j\)-th column \(\mathbf{x}_j\) solving \(\mathbf{A}\mathbf{x}_j=\mathbf{b}_j\).

The Inverse Method and Why It Works

Writing all systems together gives \(\mathbf{A}\mathbf{X}=\mathbf{B}\). When \(\mathbf{A}\) is invertible, multiply on the left by \(\mathbf{A}^{-1}\). The order matters: the inverse is placed to the left of \(\mathbf{B}\), because it cancels \(\mathbf{A}\) in the product \(\mathbf{A}^{-1}\mathbf{A}\).

$$ \mathbf{A}\mathbf{X}=\mathbf{B} \qquad\Longrightarrow\qquad \mathbf{X}=\mathbf{A}^{-1}\mathbf{B}. $$
Theorem: Let \(\mathbf{A}\in\mathbb{R}^{n\times n}\) be invertible and let \(\mathbf{B}\in\mathbb{R}^{n\times k}\). The unique matrix \(\mathbf{X}\in\mathbb{R}^{n\times k}\) satisfying \(\mathbf{A}\mathbf{X}=\mathbf{B}\) is \(\mathbf{A}^{-1}\mathbf{B}\). Its \(j\)-th column is the unique solution to \(\mathbf{A}\mathbf{x}_j=\mathbf{b}_j\).

Proof. Set \(\mathbf{X}=\mathbf{A}^{-1}\mathbf{B}\). Then associativity of matrix multiplication and the definition of the inverse give \(\mathbf{A}\mathbf{X}=\mathbf{A}(\mathbf{A}^{-1}\mathbf{B})=(\mathbf{A}\mathbf{A}^{-1})\mathbf{B}=\mathbf{I}_n\mathbf{B}=\mathbf{B}\). Thus this \(\mathbf{X}\) is a solution. To prove uniqueness, suppose \(\mathbf{Y}\) is any other solution, so \(\mathbf{A}\mathbf{Y}=\mathbf{B}\). Multiplying on the left by \(\mathbf{A}^{-1}\) gives \(\mathbf{Y}=\mathbf{A}^{-1}(\mathbf{A}\mathbf{Y})=(\mathbf{A}^{-1}\mathbf{A})\mathbf{Y}=\mathbf{I}_n\mathbf{Y}=\mathbf{Y}\), and, using \(\mathbf{A}\mathbf{Y}=\mathbf{B}\), this is \(\mathbf{Y}=\mathbf{A}^{-1}\mathbf{B}=\mathbf{X}\). Finally, the \(j\)-th column of \(\mathbf{A}\mathbf{X}\) is \(\mathbf{A}\mathbf{x}_j\), and the \(j\)-th column of \(\mathbf{B}\) is \(\mathbf{b}_j\). Equality of the matrices therefore gives \(\mathbf{A}\mathbf{x}_j=\mathbf{b}_j\) for each \(j\). The unique matrix solution gives the unique solution for each system. \(\square\)

Worked Example: One Inverse for Two Systems

Use one inverse to solve \(\mathbf{A}\mathbf{x}_1=\mathbf{b}_1\) and \(\mathbf{A}\mathbf{x}_2=\mathbf{b}_2\), where

$$ \mathbf{A}=\begin{bmatrix}1&2\\3&5\end{bmatrix}, \qquad \mathbf{B}=\begin{bmatrix}5&3\\13&8\end{bmatrix}. $$

The columns of \(\mathbf{B}\) are \(\mathbf{b}_1=\begin{bmatrix}5\\13\end{bmatrix}\) and \(\mathbf{b}_2=\begin{bmatrix}3\\8\end{bmatrix}\). The inverse is \(\mathbf{A}^{-1}=\begin{bmatrix}-5&2\\3&-1\end{bmatrix}\). Check it before using it:

$$ \mathbf{A}\mathbf{A}^{-1} = \begin{bmatrix}1&2\\3&5\end{bmatrix} \begin{bmatrix}-5&2\\3&-1\end{bmatrix} = \begin{bmatrix}-5+6&2-2\\-15+15&6-5\end{bmatrix} = \begin{bmatrix}1&0\\0&1\end{bmatrix}. $$

Now multiply the inverse by both right-hand sides at once:

$$ \mathbf{X}=\mathbf{A}^{-1}\mathbf{B} = \begin{bmatrix}-5&2\\3&-1\end{bmatrix} \begin{bmatrix}5&3\\13&8\end{bmatrix} = \begin{bmatrix}-25+26&-15+16\\15-13&9-8\end{bmatrix} = \begin{bmatrix}1&1\\2&1\end{bmatrix}. $$

The first solution is the first column, \(\mathbf{x}_1=\begin{bmatrix}1\\2\end{bmatrix}\), and the second is \(\mathbf{x}_2=\begin{bmatrix}1\\1\end{bmatrix}\). Check each in its original system:

$$ \mathbf{A}\mathbf{x}_1 = \begin{bmatrix}1+4\\3+10\end{bmatrix} = \begin{bmatrix}5\\13\end{bmatrix} =\mathbf{b}_1, \qquad \mathbf{A}\mathbf{x}_2 = \begin{bmatrix}1+2\\3+5\end{bmatrix} = \begin{bmatrix}3\\8\end{bmatrix} =\mathbf{b}_2. $$

Because \(\mathbf{A}\) is invertible, the theorem also guarantees that these verified solutions are unique.

Using Row Reduction on All Right-Hand Sides

The inverse multiplication is not the only way to solve the collection. Form one augmented matrix by placing every right-hand side beside the coefficient matrix: \([\mathbf{A}\mid\mathbf{B}]\). Row-reduce the coefficient block to \(\mathbf{I}_n\), applying each row operation to the entire augmented matrix. The block on the right then contains all the solutions.

This is the same row-operation idea used to compute an inverse from \([\mathbf{A}\mid\mathbf{I}_n]\), except the block on the right starts as \(\mathbf{B}\), not \(\mathbf{I}_n\). The justification is that a row operation changes every right-hand side consistently, just as it changes the coefficient matrix. When the coefficient block becomes the identity, each column of the right block is the corresponding solution.

Theorem: If \(\mathbf{A}\in\mathbb{R}^{n\times n}\) is invertible and row operations take \([\mathbf{A}\mid\mathbf{B}]\) to \([\mathbf{I}_n\mid\mathbf{C}]\), then \(\mathbf{C}=\mathbf{A}^{-1}\mathbf{B}\). Thus row-reducing the augmented matrix containing all right-hand sides gives the same solutions as multiplying once by the inverse.

Proof. Each elementary row operation is left multiplication by an elementary matrix. If the operations, in order, correspond to \(\mathbf{E}_1,\dots,\mathbf{E}_r\), their combined effect is left multiplication by \(\mathbf{P}=\mathbf{E}_r\cdots\mathbf{E}_1\). Consequently the final blocks satisfy \(\mathbf{P}\mathbf{A}=\mathbf{I}_n\) and \(\mathbf{P}\mathbf{B}=\mathbf{C}\). Since \(\mathbf{A}\) is invertible, \(\mathbf{P}=\mathbf{P}\mathbf{I}_n=\mathbf{P}(\mathbf{A}\mathbf{A}^{-1})=(\mathbf{P}\mathbf{A})\mathbf{A}^{-1}=\mathbf{I}_n\mathbf{A}^{-1}=\mathbf{A}^{-1}\). Substituting this into \(\mathbf{P}\mathbf{B}=\mathbf{C}\) gives \(\mathbf{C}=\mathbf{A}^{-1}\mathbf{B}\), as required. \(\square\)

Worked Example: Row-Reduce Two Right-Hand Sides Together

Solve both systems with \(\mathbf{A}=\begin{bmatrix}2&1\\1&1\end{bmatrix}\) and \(\mathbf{B}=\begin{bmatrix}5&2\\3&1\end{bmatrix}\) by row-reducing the augmented matrix. The first row reduction swaps rows, the second subtracts twice the new first row from the second, and the remaining operations scale the second row by \(-1\) and clear above its pivot:

$$ \begin{bmatrix}2&1&5&2\\1&1&3&1\end{bmatrix} \overset{R_1\leftrightarrow R_2}{\sim} \begin{bmatrix}1&1&3&1\\2&1&5&2\end{bmatrix} \overset{R_2\to R_2-2R_1}{\sim} \begin{bmatrix}1&1&3&1\\0&-1&-1&0\end{bmatrix}. $$
$$ \begin{bmatrix}1&1&3&1\\0&-1&-1&0\end{bmatrix} \overset{R_2\to -R_2}{\sim} \begin{bmatrix}1&1&3&1\\0&1&1&0\end{bmatrix} \overset{R_1\to R_1-R_2}{\sim} \begin{bmatrix}1&0&2&1\\0&1&1&0\end{bmatrix}. $$

The left block is now the identity, so the solution columns are \(\mathbf{x}_1=\begin{bmatrix}2\\1\end{bmatrix}\) and \(\mathbf{x}_2=\begin{bmatrix}1\\0\end{bmatrix}\). Check them by multiplication:

$$ \begin{bmatrix}2&1\\1&1\end{bmatrix}\begin{bmatrix}2\\1\end{bmatrix} = \begin{bmatrix}4+1\\2+1\end{bmatrix} = \begin{bmatrix}5\\3\end{bmatrix}, \qquad \begin{bmatrix}2&1\\1&1\end{bmatrix}\begin{bmatrix}1\\0\end{bmatrix} = \begin{bmatrix}2+0\\1+0\end{bmatrix} = \begin{bmatrix}2\\1\end{bmatrix}. $$

Each product gives the matching column of \(\mathbf{B}\). The theorem explains why the final right block is the same matrix that would result from computing \(\mathbf{A}^{-1}\mathbf{B}\).

Compare the Two Approaches

Both methods use the same underlying row operations. Their practical difference is where the right-hand sides enter the calculation:

  • Compute the inverse first: reduce \([\mathbf{A}\mid\mathbf{I}_n]\) to obtain \(\mathbf{A}^{-1}\), then multiply \(\mathbf{A}^{-1}\mathbf{B}\). This is useful when the same coefficient matrix will be used with further right-hand sides.
  • Reduce the combined augmented matrix: row-reduce \([\mathbf{A}\mid\mathbf{B}]\) directly. This gives the requested solutions without separately displaying the full inverse.

For a single right-hand side, writing it as a one-column matrix changes nothing mathematically. For several right-hand sides, the matrix form makes the shared work visible. In either approach, the coefficient matrix must be square and invertible for the inverse method and for reduction of its left block to the identity. If \(\mathbf{A}\) is not invertible, the expression \(\mathbf{A}^{-1}\mathbf{B}\) is unavailable; the systems must instead be examined by methods appropriate to their consistency and solution sets.

Common Pitfall: Reversing the Multiplication Order

A frequent error is to multiply \(\mathbf{B}\mathbf{A}^{-1}\) instead of \(\mathbf{A}^{-1}\mathbf{B}\). Even when both products are defined, they generally differ, and the wrong order does not solve \(\mathbf{A}\mathbf{X}=\mathbf{B}\). For the first example, the incorrect order gives

$$ \mathbf{B}\mathbf{A}^{-1} = \begin{bmatrix}5&3\\13&8\end{bmatrix} \begin{bmatrix}-5&2\\3&-1\end{bmatrix} = \begin{bmatrix}-25+9&10-3\\-65+24&26-8\end{bmatrix} = \begin{bmatrix}-16&7\\-41&18\end{bmatrix}. $$

This cannot be the solution matrix: multiplying it on the left by \(\mathbf{A}\) gives

$$ \begin{bmatrix}1&2\\3&5\end{bmatrix} \begin{bmatrix}-16&7\\-41&18\end{bmatrix} = \begin{bmatrix}-98&43\\-253&111\end{bmatrix} \ne \begin{bmatrix}5&3\\13&8\end{bmatrix} =\mathbf{B}. $$

The correction follows directly from the equation: to cancel the left factor \(\mathbf{A}\) in \(\mathbf{A}\mathbf{X}=\mathbf{B}\), multiply both sides on the left by \(\mathbf{A}^{-1}\). This yields \(\mathbf{X}=\mathbf{A}^{-1}\mathbf{B}\), not \(\mathbf{B}\mathbf{A}^{-1}\).

Check Your Understanding

Use the equation and the column interpretation to justify your answers.

  1. If \(\mathbf{A}\) is an invertible \(3\times3\) matrix and \(\mathbf{B}\) is \(3\times4\), what are the dimensions of \(\mathbf{A}^{-1}\mathbf{B}\)?
  2. Explain why the \(j\)-th column of \(\mathbf{A}^{-1}\mathbf{B}\) solves the system with right-hand side \(\mathbf{b}_j\).
  3. For an invertible \(\mathbf{A}\), what must be true of the left block after row-reducing \([\mathbf{A}\mid\mathbf{B}]\) to read off solutions?
  4. For \(\mathbf{A}=\begin{bmatrix}1&1\\0&1\end{bmatrix}\) and \(\mathbf{B}=\begin{bmatrix}3&1\\2&4\end{bmatrix}\), find \(\mathbf{A}^{-1}\mathbf{B}\) and check both solution columns.
  5. Why does \(\mathbf{B}\mathbf{A}^{-1}\) not generally solve \(\mathbf{A}\mathbf{X}=\mathbf{B}\)?

Test yourself: Linear Algebra final exam practice

Ready to check what you know? Work a full-length practice final, then open the complete worked solutions.

Want all 1,114 practice problems?

This tutorial covers one topic. Calc Pass covers the full Calculus AB & BC curriculum (the core of Calculus I and II): full review, every practice question, and step-by-step solutions to each one.

QR code to download the Calc Pass app

Get the Calc Pass App

Scan to download and practice on the go, with instant scoring.

Calc Pass Volume 1: 1,114 Practice Questions book cover

Vol. 1: 1,114 Questions

The complete practice question bank, organized by AB & BC topic.

View on Amazon
Calc Pass Volume 2: Solutions Manual book cover

Vol. 2: Solutions Manual

Fully worked solutions to every question in Volume 1.

View on Amazon