Tutorials › Linear Algebra › Linear Combinations Of Matrices

Matrix Operations and Algebra · Tutorial 60 of 1000

Linear Combinations Of Matrices

Learn to combine same-sized matrices and solve for unknown coefficients by translating matrix equality into entry-by-entry equations.

Beginner 9 min read

What You'll Learn

  • Define a linear combination of matrices with matching dimensions.
  • Calculate a matrix combination one entry at a time.
  • Translate a target-matrix equation into scalar equations.
  • Find and verify unique coefficient values.
  • Recognize when coefficients are not unique or no solution exists.

Combining Matrices with Scalars

Matrix addition and scalar multiplication let us build new matrices from existing ones. A linear combination is a sum of scalar multiples of matrices. It is defined entry by entry, so the matrices being combined must have the same dimensions. This makes calculations manageable: each position in the result is found from the entries in that same position in the original matrices.

Throughout this tutorial, the matrices have real entries. Suppose \(\mathbf{A}_1,\ldots,\mathbf{A}_p\) all belong to \(\mathbb{R}^{m\times n}\), where \(p,m,n\in\mathbb{N}\). The scalars \(c_1,\ldots,c_p\) are real numbers. The same dimensions matter: the sum \(c_1\mathbf{A}_1+\cdots+c_p\mathbf{A}_p\) is defined because scalar multiplication preserves a matrix’s dimensions and addition is defined for matrices of matching dimensions.

Definition: A linear combination of matrices \(\mathbf{A}_1,\ldots,\mathbf{A}_p\in\mathbb{R}^{m\times n}\) is any matrix of the form \(c_1\mathbf{A}_1+\cdots+c_p\mathbf{A}_p\), where \(c_1,\ldots,c_p\in\mathbb{R}\). Its result is again an \(m\times n\) matrix.

To calculate the combination, multiply every entry of each matrix by its scalar, then add the resulting entries at matching positions. In particular, the entry in row \(i\), column \(j\) of the result is the same linear combination of the entries in row \(i\), column \(j\) of the original matrices. Write \(a_{ij}^{(k)}\) for the entry in position \((i,j)\) of \(\mathbf{A}_k\).

Theorem (Entry formula): If \(\mathbf{A}_1,\ldots,\mathbf{A}_p\in\mathbb{R}^{m\times n}\) and \(c_1,\ldots,c_p\in\mathbb{R}\), then \(\mathbf{C}=c_1\mathbf{A}_1+\cdots+c_p\mathbf{A}_p\) belongs to \(\mathbb{R}^{m\times n}\), and its entries satisfy \(c_{ij}=\sum_{k=1}^{p}c_k a_{ij}^{(k)}\) for every \(1\le i\le m\) and \(1\le j\le n\).

Proof. We use the definitions of scalar multiplication and matrix addition, which calculate each entry separately. For \(p=1\), the \((i,j)\) entry of \(c_1\mathbf{A}_1\) is \(c_1a_{ij}^{(1)}\), as claimed. Suppose the formula holds for a combination of \(p-1\) matrices. Adding \(c_p\mathbf{A}_p\) to that combination adds \(c_pa_{ij}^{(p)}\) to its entry in position \((i,j)\). Thus the resulting entry is \(\sum_{k=1}^{p-1}c_ka_{ij}^{(k)}+c_pa_{ij}^{(p)}=\sum_{k=1}^{p}c_ka_{ij}^{(k)}\). Each operation preserves the shared dimensions \(m\times n\). This proves the formula for every positive integer \(p\). \(\square\)

Calculating a Linear Combination

Worked Example: A Combination of Two Matrices

Calculate \(2\mathbf{A}-3\mathbf{B}\) for

$$ \mathbf{A}=\begin{bmatrix}1&-2\\0&4\end{bmatrix}, \qquad \mathbf{B}=\begin{bmatrix}3&1\\-1&2\end{bmatrix}. $$

Both matrices are \(2\times2\), so the combination is defined. First multiply each matrix by its scalar:

$$ 2\mathbf{A}=\begin{bmatrix}2&-4\\0&8\end{bmatrix}, \qquad -3\mathbf{B}=\begin{bmatrix}-9&-3\\3&-6\end{bmatrix}. $$

Now add corresponding entries:

$$ 2\mathbf{A}-3\mathbf{B} =\begin{bmatrix}2+(-9)&-4+(-3)\\0+3&8+(-6)\end{bmatrix} =\begin{bmatrix}-7&-7\\3&2\end{bmatrix}. $$

Check: The entry formula gives, for example, the entry in position \((2,1)\) as \(2(0)-3(-1)=3\), and the entry in position \((1,2)\) as \(2(-2)-3(1)=-7\). These agree with the computed matrix.

When the coefficients are unknown, compare the target matrix with the proposed combination one entry at a time. Matrix equality means that corresponding entries are equal. Thus one matrix equation becomes a collection of scalar equations, one for each position.

Theorem (Entrywise coefficient test): Let \(\mathbf{A}_1,\ldots,\mathbf{A}_p,\mathbf{B}\in\mathbb{R}^{m\times n}\). A list of scalars \(c_1,\ldots,c_p\) satisfies \(c_1\mathbf{A}_1+\cdots+c_p\mathbf{A}_p=\mathbf{B}\) if and only if \(\sum_{k=1}^{p}c_k a_{ij}^{(k)}=b_{ij}\) for every \(i,j\), where \(b_{ij}\) is the entry of \(\mathbf{B}\) in position \((i,j)\).

Proof. Suppose first that \(c_1\mathbf{A}_1+\cdots+c_p\mathbf{A}_p=\mathbf{B}\). Equal matrices have equal entries in every position. By the entry formula, the entry in position \((i,j)\) on the left is \(\sum_{k=1}^{p}c_ka_{ij}^{(k)}\); the entry there on the right is \(b_{ij}\). Therefore the stated scalar equation holds for every \(i,j\). Conversely, suppose those scalar equations hold for every \(i,j\). The entry formula says that the \((i,j)\) entry of the proposed combination is \(\sum_{k=1}^{p}c_ka_{ij}^{(k)}\), which equals \(b_{ij}\) by assumption. So the combination and \(\mathbf{B}\) have equal entries in every position. By the definition of matrix equality, they are equal. \(\square\)

Solving for Unknown Coefficients

Worked Example: A Unique Set of Coefficients

Find real numbers \(x,y,z\) such that \(x\mathbf{A}_1+y\mathbf{A}_2+z\mathbf{A}_3=\mathbf{B}\), where

$$ \mathbf{A}_1=\begin{bmatrix}1&0\\0&0\end{bmatrix}, \quad \mathbf{A}_2=\begin{bmatrix}0&1\\1&0\end{bmatrix}, \quad \mathbf{A}_3=\begin{bmatrix}0&0\\0&1\end{bmatrix}, \quad \mathbf{B}=\begin{bmatrix}2&3\\3&5\end{bmatrix}. $$

Compare corresponding entries. The \((1,1)\) entry gives \(x=2\). The \((1,2)\) entry gives \(y=3\), and the \((2,1)\) entry gives \(y=3\) again. The \((2,2)\) entry gives \(z=5\). The coefficient values satisfy every equation, so the solution is \(x=2,\ y=3,\ z=5\).

Check: Substituting those values into the combination gives

$$ 2\mathbf{A}_1+3\mathbf{A}_2+5\mathbf{A}_3 =\begin{bmatrix}2&0\\0&0\end{bmatrix} +\begin{bmatrix}0&3\\3&0\end{bmatrix} +\begin{bmatrix}0&0\\0&5\end{bmatrix} =\begin{bmatrix}2&3\\3&5\end{bmatrix} =\mathbf{B}. $$

Each coefficient is fixed by an entry equation, so there is no other solution.

The entry equations need not always determine every coefficient uniquely. Some equations may repeat information, leaving choices for the coefficients. In another case, the equations may contradict one another, so no coefficients can produce the target. These possibilities are visible by checking all positions, not just some of them.

Worked Example: More Than One Choice of Coefficients

Find \(x,y\in\mathbb{R}\) such that \(x\mathbf{C}_1+y\mathbf{C}_2=\mathbf{D}\), where

$$ \mathbf{C}_1=\begin{bmatrix}1&0\\0&1\end{bmatrix}, \quad \mathbf{C}_2=\begin{bmatrix}2&0\\0&2\end{bmatrix}, \quad \mathbf{D}=\begin{bmatrix}3&0\\0&3\end{bmatrix}. $$

The combination and target are

$$ x\mathbf{C}_1+y\mathbf{C}_2 =\begin{bmatrix}x&0\\0&x\end{bmatrix} +\begin{bmatrix}2y&0\\0&2y\end{bmatrix} =\begin{bmatrix}x+2y&0\\0&x+2y\end{bmatrix}. $$

Matching entries gives the same equation twice: \(x+2y=3\). Let \(y=t\), where \(t\in\mathbb{R}\) is arbitrary. Then \(x=3-2t\). Hence all solutions are \((x,y)=(3-2t,t)\) for \(t\in\mathbb{R}\).

Check: For any real \(t\),

$$ (3-2t)\mathbf{C}_1+t\mathbf{C}_2 =\begin{bmatrix}3-2t&0\\0&3-2t\end{bmatrix} +\begin{bmatrix}2t&0\\0&2t\end{bmatrix} =\begin{bmatrix}3&0\\0&3\end{bmatrix} =\mathbf{D}. $$

Thus every parameter value gives a valid combination, rather than one unique pair.

Worked Example: No Coefficients Can Produce the Target

Determine whether there are real \(x,y\) satisfying \(x\mathbf{D}_1+y\mathbf{D}_2=\mathbf{E}\), where

$$ \mathbf{D}_1=\begin{bmatrix}1&0\\0&0\end{bmatrix}, \quad \mathbf{D}_2=\begin{bmatrix}0&1\\0&0\end{bmatrix}, \quad \mathbf{E}=\begin{bmatrix}1&0\\0&1\end{bmatrix}. $$

For any \(x,y\), the combination is

$$ x\mathbf{D}_1+y\mathbf{D}_2 =\begin{bmatrix}x&y\\0&0\end{bmatrix}. $$

The \((1,1)\) entry of the target requires \(x=1\), and its \((1,2)\) entry requires \(y=0\). But the \((2,2)\) entry of every possible combination is \(0\), while the \((2,2)\) entry of \(\mathbf{E}\) is \(1\). That entry would require \(0=1\), which is impossible. There is no solution.

Check: For the values forced by the first row, \(x\mathbf{D}_1+y\mathbf{D}_2=\begin{bmatrix}1&0\\0&0\end{bmatrix}\), which differs from \(\mathbf{E}\) in position \((2,2)\).

Common Pitfalls

Do not match entries in different positions. A tempting but incorrect calculation is to combine the entries of two matrices by taking a row from one and a column from the other. For example, suppose \(\mathbf{A}=\begin{bmatrix}1&2\\3&4\end{bmatrix}\) and \(\mathbf{B}=\begin{bmatrix}5&6\\7&8\end{bmatrix}\). The \((1,2)\) entry of \(2\mathbf{A}-\mathbf{B}\) is not \(2(1)-6\): that mistakenly uses the \((1,1)\) entry of \(\mathbf{A}\). The correct calculation uses the \((1,2)\) entries in both matrices: \(2(2)-6=-2\). In fact,

$$ 2\mathbf{A}-\mathbf{B} =\begin{bmatrix}2-5&4-6\\6-7&8-8\end{bmatrix} =\begin{bmatrix}-3&-2\\-1&0\end{bmatrix}. $$

Check: The four entries are \(2(1)-5=-3\), \(2(2)-6=-2\), \(2(3)-7=-1\), and \(2(4)-8=0\), in their original positions.

Check every entry when solving for coefficients. A candidate that matches the first row is not necessarily a solution of the matrix equation; the remaining rows and columns impose their own conditions. Also check that all matrices involved have matching dimensions before adding them. A linear combination is formed by scalar multiplication and matrix addition, so incompatible matrix dimensions do not define the proposed sum.

In applications, linear combinations express a matrix as a weighted sum of given matrices. The entry formula provides a direct way to find the weights: write one scalar equation for every matrix position, solve the resulting equations, and substitute the proposed coefficients back into the combination. The equations may determine one set of weights, allow many choices, or reveal that no such combination exists.

Check Your Understanding

Use the entry formula and check proposed coefficient values by substitution.

  1. Calculate \(3\mathbf{A}-2\mathbf{B}\) for \(\mathbf{A}=\begin{bmatrix}1&-1\\2&0\end{bmatrix}\) and \(\mathbf{B}=\begin{bmatrix}0&2\\-1&3\end{bmatrix}\).
  2. Find \(x,y\) such that \(x\begin{bmatrix}1&0\\0&0\end{bmatrix}+y\begin{bmatrix}0&0\\0&1\end{bmatrix}=\begin{bmatrix}4&0\\0&-2\end{bmatrix}\).
  3. For which real numbers \(x,y\) does \(x\begin{bmatrix}1&1\\0&0\end{bmatrix}+y\begin{bmatrix}0&0\\1&1\end{bmatrix}=\begin{bmatrix}2&2\\3&3\end{bmatrix}\)?
  4. Can any linear combination of \(\begin{bmatrix}1&0\\0&0\end{bmatrix}\) and \(\begin{bmatrix}0&1\\0&0\end{bmatrix}\) equal \(\begin{bmatrix}0&0\\1&0\end{bmatrix}\)? Explain using an entry equation.

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