4. Matrix Algebra

Multiplying Matrices Accurately

Multiplying Matrices Accurately

Welcome, students! In this lesson, you will learn how to multiply matrices accurately and why this operation is so important in Linear Algebra 📘. Matrix multiplication is one of the main tools used to combine information, model real systems, and solve problems in science, computer graphics, economics, and engineering. By the end of this lesson, you should be able to explain the rules, carry out calculations carefully, and recognize when matrix multiplication is useful in the bigger picture of Matrix Algebra.

What matrix multiplication means

A matrix is a rectangular arrangement of numbers. When we multiply matrices, we are not multiplying numbers the same way we multiply ordinary scalars. Instead, we combine rows and columns using a special rule called the row-by-column rule.

Suppose we have matrices $A$ and $B$. The product $AB$ is defined only when the number of columns in $A$ equals the number of rows in $B$. If $A$ is an $m\times n$ matrix and $B$ is an $n\times p$ matrix, then $AB$ is an $m\times p$ matrix.

This size rule is one of the most important ideas in matrix algebra. It tells you whether multiplication is possible before you even begin calculating. For example, if $A$ is $2\times 3$ and $B$ is $3\times 4$, then $AB$ is defined and the result will be $2\times 4$.

A single entry in the product matrix is found by taking one row from the first matrix and one column from the second matrix, then multiplying matching entries and adding the results. If the product is $C=AB$, then the entry in row $i$ and column $j$ of $C$ is written as $c_{ij}$ and is given by

$$c_{ij}=\sum_{k=1}^{n} a_{ik}b_{kj}$$

where $n$ is the shared inner dimension. This formula is the heart of matrix multiplication.

How to multiply matrices step by step

Let’s work through a clear example. Suppose

$$A=\begin{bmatrix}1 & 2\\3 & 4\end{bmatrix}, \quad B=\begin{bmatrix}5 & 6\\7 & 8\end{bmatrix}$$

Both matrices are $2\times 2$, so $AB$ is defined. To find the product $AB$, we compute each entry by using a row from $A$ and a column from $B$.

First entry, top left:

$$1\cdot 5 + 2\cdot 7 = 5 + 14 = 19$$

Top right:

$$1\cdot 6 + 2\cdot 8 = 6 + 16 = 22$$

Bottom left:

$$3\cdot 5 + 4\cdot 7 = 15 + 28 = 43$$

Bottom right:

$$3\cdot 6 + 4\cdot 8 = 18 + 32 = 50$$

So,

$$AB=\begin{bmatrix}19 & 22\\43 & 50\end{bmatrix}$$

This process may look long at first, but it becomes faster with practice. The main goal is accuracy: choose the correct row and column, multiply matching positions, and add carefully.

A helpful memory trick is this: the row comes from the first matrix, and the column comes from the second matrix. If you mix them up, your answer will be wrong even if your arithmetic is correct.

Why the size rule matters

The size rule is not just a formality. It prevents invalid operations. For instance, if $A$ is $2\times 3$ and $B$ is $2\times 2$, then $AB$ is not defined because the inner dimensions $3$ and $2$ do not match.

This rule is tied to how matrix multiplication works mathematically. Each entry in the product uses a row from the first matrix and a column from the second matrix. If those lengths are different, there is no way to pair every number correctly.

Let’s test another example. If

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

and

$$B=\begin{bmatrix}4\\-2\\5\end{bmatrix},$$

then $A$ is $2\times 3$ and $B$ is $3\times 1$, so $AB$ is defined and will be $2\times 1$. Compute each entry:

First row:

$$1\cdot 4 + 0\cdot (-2) + 2\cdot 5 = 4 + 0 + 10 = 14$$

Second row:

$$(-1)\cdot 4 + 3\cdot (-2) + 1\cdot 5 = -4 - 6 + 5 = -5$$

Thus,

$$AB=\begin{bmatrix}14\\-5\end{bmatrix}$$

This kind of calculation appears in systems, transformations, and data processing. Accurate multiplication lets you move from raw numbers to meaningful results.

Matrix multiplication is not commutative

One of the most important facts in matrix algebra is that matrix multiplication is usually not commutative. That means in general,

$$AB\neq BA$$

This is very different from ordinary number multiplication, where $ab=ba$ for real numbers.

Let’s use the earlier matrices:

$$A=\begin{bmatrix}1 & 2\\3 & 4\end{bmatrix}, \quad B=\begin{bmatrix}5 & 6\\7 & 8\end{bmatrix}$$

We already found

$$AB=\begin{bmatrix}19 & 22\\43 & 50\end{bmatrix}$$

Now compute $BA$:

Top left:

$$5\cdot 1 + 6\cdot 3 = 5 + 18 = 23$$

Top right:

$$5\cdot 2 + 6\cdot 4 = 10 + 24 = 34$$

Bottom left:

$$7\cdot 1 + 8\cdot 3 = 7 + 24 = 31$$

Bottom right:

$$7\cdot 2 + 8\cdot 4 = 14 + 32 = 46$$

So,

$$BA=\begin{bmatrix}23 & 34\\31 & 46\end{bmatrix}$$

Since $AB\neq BA$, the order matters. This is a major concept in Linear Algebra and is one reason matrix multiplication can model processes that happen in sequence, such as applying one transformation and then another 🔁.

Real-world meaning and applications

Matrix multiplication often represents combining actions or relationships. Imagine a school cafeteria tracking how many lunches and drinks are sold each day. A matrix could store the number of items sold, and another matrix could store prices. Multiplying them can help calculate total revenue.

In computer graphics, matrices are used to rotate, scale, and move images. If one matrix represents a rotation and another represents a stretch, multiplying them combines both effects into a single transformation. Because order matters, changing the order can change the final picture.

In science and engineering, matrix multiplication helps analyze networks, solve systems of equations, and study data. In these situations, exact calculation is critical. A small mistake in one entry can change the meaning of the whole result.

This is why careful technique matters. You are not just doing arithmetic; you are building the mathematical language used to describe real systems.

Common mistakes and how to avoid them

There are several frequent errors students make when multiplying matrices.

First, some students try to multiply matrices whose sizes do not match. Always check the inner dimensions first. If the columns of the first matrix and rows of the second matrix are not equal, the product does not exist.

Second, some students multiply entries in the same position instead of using a row and a column. Matrix multiplication is not entry-by-entry multiplication. For example,

$$\begin{bmatrix}1 & 2\\3 & 4\end{bmatrix}\begin{bmatrix}5 & 6\\7 & 8\end{bmatrix}$$

is not found by just multiplying $1\cdot 5$, $2\cdot 6$, $3\cdot 7$, and $4\cdot 8$ separately.

Third, students sometimes make arithmetic errors when adding products. A good strategy is to write each step clearly and check your work after each entry.

Fourth, it helps to label rows and columns while practicing. For example, say out loud, “first row of $A$ with first column of $B$” before calculating each entry. This slows you down just enough to reduce mistakes.

Connecting multiplication to broader matrix algebra

Matrix multiplication is not an isolated topic. It connects to many other ideas in Matrix Algebra. It helps define inverse matrices, matrix powers, linear transformations, and systems of equations.

For example, if $A$ is invertible, then its inverse $A^{-1}$ satisfies

$$AA^{-1}=A^{-1}A=I$$

where $I$ is the identity matrix. This identity matrix acts like the number $1$ in ordinary multiplication.

Matrix powers also depend on multiplication. The expression $A^2$ means

$$A^2=AA$$

and $A^3$ means

$$A^3=AAA$$

These powers are used in repeated processes, such as applying the same transformation several times.

Matrix multiplication also works with vectors. If $A$ is a matrix and $x$ is a vector, then $Ax$ represents a linear transformation or a system result. This is one of the most powerful ideas in Linear Algebra because it links formulas to geometric and practical meaning.

Conclusion

You now have the core ideas needed to multiply matrices accurately, students. The most important skills are checking dimensions, using the row-by-column rule, keeping the order correct, and calculating each entry carefully. Matrix multiplication is a central part of Matrix Algebra because it helps combine transformations, solve problems, and model real-world situations. With practice, the process becomes more natural, and the patterns behind it become easier to see ✨.

Study Notes

  • Matrix multiplication uses the row-by-column rule.
  • The product $AB$ is defined only when the number of columns in $A$ equals the number of rows in $B$.
  • If $A$ is $m\times n$ and $B$ is $n\times p$, then $AB$ is $m\times p$.
  • The entry in row $i$ and column $j$ of $AB$ is $c_{ij}=\sum_{k=1}^{n} a_{ik}b_{kj}$.
  • Matrix multiplication is usually not commutative, so $AB\neq BA$ in general.
  • A common mistake is trying to multiply matrices entry-by-entry; that is not how matrix multiplication works.
  • Matrix multiplication is important for inverse matrices, matrix powers, linear transformations, and systems of equations.
  • Careful checking of dimensions and arithmetic is the key to multiplying matrices accurately.

Practice Quiz

5 questions to test your understanding