We've updated our
Privacy Policy effective December 15. Please read our updated Privacy Policy and tap

Studienführer > College Algebra CoRequisite Course

Adding and Subtracting Matrices

Learning Outcomes

  • Determine the dimensions of a matrix.
  • Add and subtract two matrices.
To solve a problem like the one described for the soccer teams, we can use a matrix, which is a rectangular array of numbers. A row in a matrix is a set of numbers that are aligned horizontally. A column in a matrix is a set of numbers that are aligned vertically. Each number is an entry, sometimes called an element, of the matrix. Matrices (plural) are enclosed in [ ] or ( ) and are usually named with capital letters. For example, three matrices named [latex]A,B,\text{}[/latex] and [latex]C[/latex] are shown below.

[latex]A=\left[\begin{array}{cc}1& 2\\ 3& 4\end{array}\right],B=\left[\begin{array}{ccc}\hfill 1& \hfill 2& \hfill 7\\ \hfill 0& \hfill -5& \hfill 6\\ \hfill 7& \hfill 8& \hfill 2\end{array}\right],C=\left[\begin{array}{c}\hfill -1\\ \hfill 0\\ \hfill 3\end{array}\begin{array}{c}3\\ 2\\ 1\end{array}\right][/latex]

Describing Matrices

A matrix is often referred to by its size or dimensions: [latex]\text{ }m\text{ }\times \text{ }n\text{ }[/latex] indicating [latex]m[/latex] rows and [latex]n[/latex] columns. Matrix entries are defined first by row and then by column. For example, to locate the entry in matrix [latex]A[/latex] identified as [latex]{a}_{ij},\text{}[/latex] we look for the entry in row [latex]i,\text{}[/latex] column [latex]j[/latex]. In matrix [latex]A[/latex] shown below, the entry in row 2, column 3 is [latex]{a}_{23}[/latex].

[latex]A=\left[\begin{array}{ccc}{a}_{11}& {a}_{12}& {a}_{13}\\ {a}_{21}& {a}_{22}& {a}_{23}\\ {a}_{31}& {a}_{32}& {a}_{33}\end{array}\right][/latex]

how are those subscripts pronounced?

Since the subscripts in a matrix refer to row and column entry locations, the numbers are pronounced distinctly from one another. To refer to the 1st row, third column entry in the matrix [latex]A[/latex] above, we say "[latex]a \text{ one }\text{three}[/latex]."
A square matrix is a matrix with dimensions [latex]\text{ }n\text{ }\times \text{ }n,\text{}[/latex] meaning that it has the same number of rows as columns. The [latex]3\times 3[/latex] matrix above is an example of a square matrix. A row matrix is a matrix consisting of one row with dimensions [latex]1\text{ }\times \text{ }n[/latex].

[latex]\left[\begin{array}{ccc}{a}_{11}& {a}_{12}& {a}_{13}\end{array}\right][/latex]

A column matrix is a matrix consisting of one column with dimensions [latex]m\text{ }\times \text{ }1[/latex].

[latex]\left[\begin{array}{c}{a}_{11}\\ {a}_{21}\\ {a}_{31}\end{array}\right][/latex]

A matrix may be used to represent a system of equations. In these cases, the numbers represent the coefficients of the variables in the system. Matrices often make solving systems of equations easier because they are not encumbered with variables. We will investigate this idea further in the next section, but first we will look at basic matrix operations.

A General Note: Matrices

A matrix is a rectangular array of numbers that is usually named by a capital letter: [latex]A,B,C,\text{}[/latex] and so on. Each entry in a matrix is referred to as [latex]{a}_{ij}[/latex], such that [latex]i[/latex] represents the row and [latex]j[/latex] represents the column. Matrices are often referred to by their dimensions: [latex]m\times n[/latex] indicating [latex]m[/latex] rows and [latex]n[/latex] columns.

Example: Finding the Dimensions of the Given Matrix and Locating Entries

Given matrix [latex]A:[/latex]
  1. What are the dimensions of matrix [latex]A?[/latex]
  2. What are the entries at [latex]{a}_{31}[/latex] and [latex]{a}_{22}?[/latex]

[latex]A=\left[\begin{array}{rrrr}\hfill 2& \hfill & \hfill 1& \hfill 0\\ \hfill 2& \hfill & \hfill 4& \hfill 7\\ \hfill 3& \hfill & \hfill 1& \hfill -2\end{array}\right][/latex]

Answer:

  1. The dimensions are [latex]\text{ }3\text{ }\times \text{ }3\text{ }[/latex] because there are three rows and three columns.
  2. Entry [latex]{a}_{31}[/latex] is the number at row 3, column 1 which is 3. The entry [latex]{a}_{22}[/latex] is the number at row 2, column 2 which is 4. Remember, the row comes first, then the column.

Try it

[ohm_question]6388[/ohm_question]

Adding and Subtracting Matrices

We use matrices to list data or to represent systems. Because the entries are numbers, we can perform operations on matrices. We add or subtract matrices by adding or subtracting corresponding entries. In order to do this, the entries must correspond. Therefore, addition and subtraction of matrices is only possible when the matrices have the same dimensions. We can add or subtract a [latex]\text{ }3\text{ }\times \text{ }3\text{ }[/latex] matrix and another [latex]\text{ }3\text{ }\times \text{ }3\text{ }[/latex] matrix, but we cannot add or subtract a [latex]\text{ }2\text{ }\times \text{ }3\text{ }[/latex] matrix and a [latex]\text{ }3\text{ }\times \text{ }3\text{ }[/latex] matrix because some entries in one matrix will not have a corresponding entry in the other matrix.

A General Note: Adding and Subtracting Matrices

Given matrices [latex]A[/latex] and [latex]B[/latex] of like dimensions, addition and subtraction of [latex]A[/latex] and [latex]B[/latex] will produce matrix [latex]C[/latex] or matrix [latex]D[/latex] of the same dimension.

[latex]A+B=C\text{ such that }{a}_{ij}+{b}_{ij}={c}_{ij}[/latex]

[latex]A-B=D\text{ such that }{a}_{ij}-{b}_{ij}={d}_{ij}[/latex]

Matrix addition is commutative.

[latex]A+B=B+A[/latex]

It is also associative.

[latex]\left(A+B\right)+C=A+\left(B+C\right)[/latex]

Example: Finding the Sum of Matrices

Find the sum of [latex]A[/latex] and [latex]B \text{}[/latex] given

[latex]A=\left[\begin{array}{cc}a& b\\ c& d\end{array}\right]\text{ and }B=\left[\begin{array}{cc}e& f\\ g& h\end{array}\right][/latex]

Answer: Add corresponding entries.

[latex]\begin{array}{l}A+B & =\left[\begin{array}{cc}a& b\\ c& d\end{array}\right]+\left[\begin{array}{cc}e& f\\ g& h\end{array}\right]\hfill \\ & =\left[\begin{array}{ccc}a+e& & b+f\\ c+g& & d+h\end{array}\right]\hfill \end{array}[/latex]

[ohm_question]1079[/ohm_question]

Example: Adding Matrix A and Matrix B

Find the sum of [latex]A[/latex] and [latex]B[/latex].

[latex]A=\left[\begin{array}{cc}4& 1\\ 3& 2\end{array}\right]\text{ and }B=\left[\begin{array}{cc}5& 9\\ 0& 7\end{array}\right][/latex]

Answer: Add corresponding entries. Add the entry in row 1, column 1, [latex]{a}_{11},\text{}[/latex] of matrix [latex]A[/latex] to the entry in row 1, column 1, [latex]{b}_{11}[/latex], of [latex]B[/latex]. Continue the pattern until all entries have been added.

[latex]\begin{array}{ll}A+B & =\left[\begin{array}{cc}4& 1\\ 3& 2\end{array}\right]+\left[\begin{array}{cc}5& 9\\ 0& 7\end{array}\right]\hfill \\ & =\left[\begin{array}{ccc}4+5& & 1+9\\ 3+0& & 2+7\end{array}\right]\hfill \\ & =\left[\begin{array}{cc}9& 10\\ 3& 9\end{array}\right]\hfill \end{array}[/latex]

Example: Finding the Difference of Two Matrices

Find the difference of [latex]A[/latex] and [latex]B[/latex]. [latex-display]A=\left[\begin{array}{cc}\hfill -2& \hfill 3\\ \hfill 0& \hfill 1\end{array}\right]\text{ and }B=\left[\begin{array}{cc}8& 1\\ 5& 4\end{array}\right][/latex-display]

Answer: We subtract the corresponding entries of each matrix.

[latex]\begin{array}{ll}A-B & =\left[\begin{array}{rr}\hfill -2& \hfill 3\\ \hfill 0& \hfill 1\end{array}\right]-\left[\begin{array}{rr}\hfill 8& \hfill 1\\ \hfill 5& \hfill 4\end{array}\right]\hfill \\ & =\left[\begin{array}{rrr}\hfill -2 - 8& \hfill & \hfill 3 - 1\\ \hfill 0 - 5& \hfill & \hfill 1 - 4\end{array}\right]\hfill \\ & =\left[\begin{array}{rrr}\hfill -10& \hfill & \hfill 2\\ \hfill -5& \hfill & \hfill -3\end{array}\right]\hfill \end{array}[/latex]

tip for success

Be sure to handle negative numbers carefully when finding the difference of two matrices. In the example using the 3 X 3 matrix below, for instance, subtracting [latex]a_{13} - b_{13}[/latex] results in [latex]-2 - (-2) = 0[/latex]

Example: Finding the Sum and Difference of Two 3 x 3 Matrices

Given [latex]A[/latex] and [latex]B:[/latex]
  1. Find the sum.
  2. Find the difference.

[latex]A=\left[\begin{array}{rrr}\hfill 2& \hfill -10& \hfill -2\\ \hfill 14& \hfill 12& \hfill 10\\ \hfill 4& \hfill -2& \hfill 2\end{array}\right]\text{ and }B=\left[\begin{array}{rrr}\hfill 6& \hfill 10& \hfill -2\\ \hfill 0& \hfill -12& \hfill -4\\ \hfill -5& \hfill 2& \hfill -2\end{array}\right][/latex]

Answer:

  1. Add the corresponding entries.
    [latex]\begin{array}{ll}\hfill \\ A+B& =\left[\begin{array}{rrr}\hfill 2& \hfill -10& \hfill -2\\ \hfill 14& \hfill 12& \hfill 10\\ \hfill 4& \hfill -2& \hfill 2\end{array}\right]+\left[\begin{array}{rrr}\hfill 6& \hfill 10& \hfill -2\\ \hfill 0& \hfill -12& \hfill -4\\ \hfill -5& \hfill 2& \hfill -2\end{array}\right]\hfill \\ & =\left[\begin{array}{rrr}\hfill 2+6& \hfill -10+10& \hfill -2 - 2\\ \hfill 14+0& \hfill 12 - 12& \hfill 10 - 4\\ \hfill 4 - 5& \hfill -2+2& \hfill 2 - 2\end{array}\right]\hfill \\ & =\left[\begin{array}{rrr}\hfill 8& \hfill 0& \hfill -4\\ \hfill 14& \hfill 0& \hfill 6\\ \hfill -1& \hfill 0& \hfill 0\end{array}\right]\hfill \end{array}[/latex]
  2. Subtract the corresponding entries.
    [latex]\begin{array}{ll}\hfill \\ A-B & =\left[\begin{array}{rrr}\hfill 2& \hfill -10& \hfill -2\\ \hfill 14& \hfill 12& \hfill 10\\ \hfill 4& \hfill -2& \hfill 2\end{array}\right]-\left[\begin{array}{rrr}\hfill 6& \hfill 10& \hfill -2\\ \hfill 0& \hfill -12& \hfill -4\\ \hfill -5& \hfill 2& \hfill -2\end{array}\right]\hfill \\ & =\left[\begin{array}{rrr}\hfill 2 - 6& \hfill -10 - 10& \hfill -2+2\\ \hfill 14 - 0& \hfill 12+12& \hfill 10+4\\ \hfill 4+5& \hfill -2 - 2& \hfill 2+2\end{array}\right]\hfill \\ & =\left[\begin{array}{rrr}\hfill -4& \hfill -20& \hfill 0\\ \hfill 14& \hfill 24& \hfill 14\\ \hfill 9& \hfill -4& \hfill 4\end{array}\right]\hfill \end{array}[/latex]

Try It

Add matrix [latex]A[/latex] and matrix [latex]B[/latex]. [latex-display]A=\left[\begin{array}{rr}\hfill 2& \hfill 6\\ \hfill 1& \hfill 0\\ \hfill 1& \hfill -3\end{array}\right]\text{ and }B=\left[\begin{array}{rr}\hfill 3& \hfill -2\\ \hfill 1& \hfill 5\\ \hfill -4& \hfill 3\end{array}\right][/latex-display]

Answer: [latex]A+B=\left[\begin{array}{c}2\\ 1\\ 1\end{array}\begin{array}{c}\text{ }\text{ }\text{ }6\\ \text{ }\text{ }\text{ }0\\ -3\end{array}\right]+\left[\begin{array}{c}3\\ 1\\ -4\end{array}\begin{array}{c}-2\\ 5\\ 3\end{array}\right]=\left[\begin{array}{c}2+3\\ 1+1\\ 1+\left(-4\right)\end{array}\begin{array}{c}6+\left(-2\right)\\ 0+5\\ -3+3\end{array}\right]=\left[\begin{array}{c}5\\ 2\\ -3\end{array}\begin{array}{c}4\\ 5\\ 0\end{array}\right][/latex]

[ohm_question]6390[/ohm_question]

Licenses & Attributions

CC licensed content, Original

CC licensed content, Shared previously

  • College Algebra. Provided by: OpenStax Authored by: Abramson, Jay et al.. License: CC BY: Attribution. License terms: Download for free at http://cnx.org/contents/[email protected].
  • Question ID 6388. Authored by: Dow,David D.. License: CC BY: Attribution. License terms: IMathAS Community License CC-BY + GPL.

CC licensed content, Specific attribution