From the free course College Algebra on Lykke

7.5 Matrices and Matrix Operations

Key concepts: Matrices as rectangular arrays of numbers · Matrix dimensions (rows and columns) · Scalar multiplication of a matrix · Matrix addition · Matrix subtraction · Entrywise matrix operations · Commutativity of matrix addition · Sum of scalar multiples · Conditions for adding or subtracting matrices · Matrix multiplication (product of two matrices)

By the end of this section the student can: Find the sum and difference of two matrices; Find scalar multiples of a matrix; Find the product of two matrices

7.5 Matrices and Matrix Operations

A matrix organizes numbers into a rectangular grid so that each number has a precise location. A store might record weekly sales by product and region, while a scientist might arrange measurements by experiment and time. In both cases, the position of an entry matters just as much as its value.

Matrices and Their Dimensions

A matrix is a rectangular array of numbers arranged in rows and columns. The individual numbers are called entries. For example,

$$ A= \begin{bmatrix} 4 & -1 & 7\ 0 & 3 & 2 \end{bmatrix} $$

has two horizontal rows and three vertical columns.

The dimensions of a matrix describe its number of rows followed by its number of columns. Therefore, matrix $A$ above has dimensions $2\times 3$, read as “$2$ by $3$.” The first number always counts rows; the second counts columns.

An entry can be identified by its position. The notation $a_{ij}$ means the entry in row $i$, column $j$. For the matrix

we have

$$ a_{11}=4,\qquad a_{12}=-1,\qquad a_{23}=2. $$

The first subscript identifies the row, and the second identifies the column.

Key definition: A matrix with $m$ rows and $n$ columns has dimensions $m\times n$. Its entries are arranged as $a_{ij}$, where $1\leq i\leq m$ and $1\leq j\leq n$.

Adding Matrices

Matrices can be added only when they have like dimensions, meaning that they have the same number of rows and the same number of columns. Addition is performed entry by entry: add each entry of the first matrix to the entry in the same position of the second matrix.

For two $2\times2$ matrices,

$$ \begin{bmatrix} a & b\ c & d \end{bmatrix} + \begin{bmatrix} e & f\ g & h \end{bmatrix}

\begin{bmatrix} a+e & b+f\ c+g & d+h \end{bmatrix}. $$

The first entry combines with the first entry, the second with the second, and so on. Entries are never combined across different rows or columns.

Worked example: Adding two matrices

Let

$$ A= \begin{bmatrix} 2 & -5\ 4 & 1 \end{bmatrix} \qquad\text{and}\qquad B= \begin{bmatrix} 7 & 3\ -2 & 6 \end{bmatrix}. $$

Both matrices have dimensions $2\times2$, so addition is defined.

Add corresponding entries:

\begin{aligned}
A+B
&=
\begin{bmatrix}
2 & -5\\
4 & 1
\end{bmatrix}
+
\begin{bmatrix}
7 & 3\\
-2 & 6
\end{bmatrix}\\[4pt]
&=
\begin{bmatrix}
2+7 & -5+3\\
4+(-2) & 1+6
\end{bmatrix}\\[4pt]
&=
\begin{bmatrix}
9 & -2\\
2 & 7
\end{bmatrix}.
\end{aligned}

Matrix addition is commutative, which means the order of addition does not affect the result:

$$ A+B=B+A. $$

This property follows from the commutative property of real-number addition. For example, $2+7=7+2$ and $-5+3=3+(-5)$, so every corresponding entry has the same sum regardless of the order.

Subtracting Matrices

Matrices of like dimensions can also be subtracted entry by entry. To find $A-B$, subtract each entry of $B$ from the corresponding entry of $A$:

Unlike addition, matrix subtraction is generally not commutative: in most cases, $A-B\neq B-A$.

Worked example: Subtracting two matrices

Let

$$ A= \begin{bmatrix} -2 & 3\ 0 & 1 \end{bmatrix} \qquad\text{and}\qquad B= \begin{bmatrix} 8 & 1\ 5 & 4 \end{bmatrix}. $$

Both matrices are $2\times2$, so subtraction is defined.

Subtract corresponding entries:

\begin{aligned}
A-B
&=
\begin{bmatrix}
-2 & 3\\
0 & 1
\end{bmatrix}
-
\begin{bmatrix}
8 & 1\\
5 & 4
\end{bmatrix}\\[4pt]
&=
\begin{bmatrix}
-2-8 & 3-1\\
0-5 & 1-4
\end{bmatrix}\\[4pt]
&=
\begin{bmatrix}
-10 & 2\\
-5 & -3
\end{bmatrix}.
\end{aligned}

The signs deserve careful attention. For instance, the lower-left entry is $0-5=-5$, while the upper-left entry is $-2-8=-10$.

Adding and Subtracting $3\times3$ Matrices

The same entrywise process works for matrices of any dimensions. A $3\times3$ matrix has nine entries, so addition or subtraction proceeds through all nine corresponding positions.

Worked example: Finding a sum and difference

Let

$$ A= \begin{bmatrix} 2 & -10 & -2\ 14 & 12 & 10\ 4 & -2 & 2 \end{bmatrix} \qquad\text{and}\qquad B= \begin{bmatrix} 6 & 10 & -2\ 0 & -12 & -4\ -5 & 2 & -2 \end{bmatrix}. $$

Both matrices have dimensions $3\times3$.

For the sum, add entries in the same positions:

\begin{aligned}
A+B
&=
\begin{bmatrix}
2+6 & -10+10 & -2+(-2)\\
14+0 & 12+(-12) & 10+(-4)\\
4+(-5) & -2+2 & 2+(-2)
\end{bmatrix}\\[4pt]
&=
\begin{bmatrix}
8 & 0 & -4\\
14 & 0 & 6\\
-1 & 0 & 0
\end{bmatrix}.
\end{aligned}

For the difference, subtract entries in the same positions:

A reliable habit is to begin at row $1$, column $1$, then move across the row before continuing to the next row. This prevents skipped entries and keeps every calculation attached to the correct position.

Scalar Multiplication

A scalar is a single number used to multiply a matrix. Scalar multiplication means multiplying every entry of the matrix by that scalar. If $c$ is a scalar and

$$ A= \begin{bmatrix} a_{11} & a_{12}\ a_{21} & a_{22} \end{bmatrix}, $$

then

$$ cA= c\begin{bmatrix} a_{11} & a_{12}\ a_{21} & a_{22} \end{bmatrix}

\begin{bmatrix} ca_{11} & ca_{12}\ ca_{21} & ca_{22} \end{bmatrix}. $$

The dimensions do not change. If $A$ is $3\times2$, then $cA$ is also $3\times2$.

Worked example: Finding a scalar multiple

Find $-3A$ when

$$ A= \begin{bmatrix} 2 & -1 & 4\ 0 & 5 & -2 \end{bmatrix}. $$

Multiply every entry by $-3$:

\begin{aligned}
-3A
&=
-3
\begin{bmatrix}
2 & -1 & 4\\
0 & 5 & -2
\end{bmatrix}\\[4pt]
&=
\begin{bmatrix}
(-3)(2) & (-3)(-1) & (-3)(4)\\
(-3)(0) & (-3)(5) & (-3)(-2)
\end{bmatrix}\\[4pt]
&=
\begin{bmatrix}
-6 & 3 & -12\\
0 & -15 & 6
\end{bmatrix}.
\end{aligned}

The most common mistake is multiplying only one row or one column. The scalar applies to every entry.

Sums of Scalar Multiples

Many matrix expressions require scalar multiplication before addition. For an expression such as $3A+2B$, first calculate $3A$, then calculate $2B$, and finally add the resulting matrices. The matrices $A$ and $B$ must have like dimensions so that the final addition is defined.

Scalar multiplication follows distributive properties similar to ordinary algebra:

$$ c(A+B)=cA+cB $$

and

$$ (c+d)A=cA+dA. $$

These properties allow scalars and matrix addition to be handled entry by entry.

Worked example: Finding the sum of scalar multiples

Let

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

Find $3A+2B$.

First find $3A$:

\begin{aligned}
3A
&=
3
\begin{bmatrix}
1 & 2 & 0\\
-1 & 3 & 4\\
2 & 0 & -2
\end{bmatrix}\\[4pt]
&=
\begin{bmatrix}
3 & 6 & 0\\
-3 & 9 & 12\\
6 & 0 & -6
\end{bmatrix}.
\end{aligned}

Next find $2B$:

\begin{aligned}
2B
&=
2
\begin{bmatrix}
-1 & 2 & 1\\
0 & -3 & 2\\
0 & 1 & -4
\end{bmatrix}\\[4pt]
&=
\begin{bmatrix}
-2 & 4 & 2\\
0 & -6 & 4\\
0 & 2 & -8
\end{bmatrix}.
\end{aligned}

Now add the two resulting matrices:

\begin{aligned}
3A+2B
&=
\begin{bmatrix}
3 & 6 & 0\\
-3 & 9 & 12\\
6 & 0 & -6
\end{bmatrix}
+
\begin{bmatrix}
-2 & 4 & 2\\
0 & -6 & 4\\
0 & 2 & -8
\end{bmatrix}\\[4pt]
&=
\begin{bmatrix}
3+(-2) & 6+4 & 0+2\\
-3+0 & 9+(-6) & 12+4\\
6+0 & 0+2 & -6+(-8)
\end{bmatrix}\\[4pt]
&=
\begin{bmatrix}
1 & 10 & 2\\
-3 & 3 & 16\\
6 & 2 & -14
\end{bmatrix}.
\end{aligned}

Practice Problems

For each problem, perform the indicated matrix operation.

  1. Find $A+B$:

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

  1. Find $C-D$:

$$ C= \begin{bmatrix} -1 & 6 & 0\ 2 & -4 & 5 \end{bmatrix}, \qquad D= \begin{bmatrix} 3 & 1 & -2\ -1 & 4 & 7 \end{bmatrix}. $$

  1. Find $2P-3Q$:

$$ P= \begin{bmatrix} 1 & 0\ -2 & 3 \end{bmatrix}, \qquad Q= \begin{bmatrix} 2 & -1\ 1 & 4 \end{bmatrix}. $$

Answers

$$ A+B= \begin{bmatrix} 7 & 5\ -2 & 7 \end{bmatrix}. $$

$$ C-D= \begin{bmatrix} -4 & 5 & 2\ 3 & -8 & -2 \end{bmatrix}. $$

$$ 2P= \begin{bmatrix} 2 & 0\ -4 & 6 \end{bmatrix}, \qquad 3Q= \begin{bmatrix} 6 & -3\ 3 & 12 \end{bmatrix}, $$

so

$$ 2P-3Q= \begin{bmatrix} -4 & 3\ -7 & -6 \end{bmatrix}. $$

Content adapted from OpenStax College Algebra 2e by Jay Abramson et al., licensed CC BY 4.0.

Source Materials

Study College Algebra on Lykke

This course page is free to open: signed out, you can read its first two sections, and signing in, on any plan, opens the rest. The free Lykke Chrome extension syncs your own Canvas courses, so ChatGPT, Claude and Muse can answer from your classes and deadlines. It only reads Canvas.

Add the free extensionSign in to open every section

All sections of College Algebra · Browse more course pages

7.5 Matrices and Matrix Operations — College Algebra | Lykke