LINEAR ALGEBRA • SYSTEMS OF LINEAR EQUATIONS & MATRICES

Matrix Operations — Matrix Addition, Scalar Multiplication, and Multiplication

Learn how to add, scale, and multiply matrices to solve real-world problems efficiently.

Historical Context & Motivation

Have you ever tried to organize a lot of numbers at once? Maybe you had scores from several games, prices from different stores, or grades across many subjects. Keeping track of all those numbers in a neat, organized way is exactly the problem that matrices (the plural of matrix) were invented to solve. A matrix is simply a rectangular grid of numbers arranged in rows and columns.

Mathematicians developed rules for adding matrices, scaling them, and multiplying them together. These operations let us solve systems of equations, transform images in video games, and even train artificial intelligence. Let's look at how these ideas developed over time.

1850s
Arthur Cayley Formalizes Matrices
British mathematician Arthur Cayley published the first formal paper on matrix algebra, defining how to add and multiply rectangular arrays of numbers.
1858
Matrix Multiplication Rules
Cayley established the rules for matrix multiplication, showing that the order in which you multiply matters — a property that makes matrices different from regular numbers.
1920s
Quantum Mechanics Connection
Physicist Werner Heisenberg used matrix multiplication to describe the behavior of atoms, showing that matrices were not just abstract math — they described the real world.
1950s–Today
Computers & Modern Applications
With the rise of computers, matrix operations became essential for graphics, data science, machine learning, and engineering simulations used every day.

The big question is: how exactly do we perform arithmetic on these grids of numbers? What rules must we follow, and why do those rules exist? That is what this lesson is all about.

Core Principles & Definitions

Before we start computing, we need to understand a few key ideas. A matrix is described by its dimensions — the number of rows and columns it has. A matrix with 2 rows and 3 columns is called a 2 × 3 matrix (read as "two by three"). Each number inside the matrix is called an entry or element.

1

Matrix Addition

Add two matrices by adding the numbers that sit in the same position. Both matrices must have the same dimensions.
2

Scalar Multiplication

Multiply every entry of a matrix by a single number called a scalar. The matrix keeps the same dimensions.
3

Matrix Multiplication

Combine two matrices using a dot product of rows and columns. The number of columns in the first matrix must equal the number of rows in the second.
4

Dimensions Matter

You can only add matrices of the same size. For multiplication, an m × n matrix times an n × p matrix gives an m × p result.
KEY TAKEAWAY
Think of a matrix like a seating chart for a classroom. Each seat has a specific row and column. Matrix addition is like combining two seating charts by adding the scores at each seat. Scalar multiplication is like doubling everyone's score at once. Matrix multiplication is trickier — it's like calculating weighted totals where each row works with each column.

Visual Explanation

Matrix Addition & Scalar Multiplication at a Glance

The top section shows matrix addition: matching entries from Matrix A (cyan) and Matrix B (violet) are added to produce Result C (green). The bottom section shows scalar multiplication: the scalar 3 multiplies every single entry in Matrix A.

In the diagram above, notice that both operations preserve the shape of the matrix. A 2 × 3 matrix stays 2 × 3 after addition or scalar multiplication. The key rule for addition is that both matrices must share the same dimensions. You cannot add a 2 × 3 matrix to a 3 × 2 matrix — the entries simply don't line up.

Mathematical Framework

Formal Definitions

Let's write out the precise rules. We'll use capital letters like A and B for matrices, and lowercase letters like aij to mean the entry in row i and column j of matrix A.

MATRIX ADDITION
If A and B are both m × n matrices, then (A + B)ᵢⱼ = aᵢⱼ + bᵢⱼ
Add the entry in row i, column j of A to the entry in the same position in B. Both matrices must have the same number of rows (m) and columns (n).
SCALAR MULTIPLICATION
If k is a scalar and A is m × n, then (kA)ᵢⱼ = k × aᵢⱼ
Multiply every single entry of A by the number k. The result has the same dimensions as A.
MATRIX MULTIPLICATION
If A is m × n and B is n × p, then (AB)ᵢⱼ = Σ (from r=1 to n) aᵢᵣ × bᵣⱼ
To find the entry in row i, column j of the product, take row i of A and column j of B. Multiply matching entries and add them up. The columns of A must equal the rows of B. The result is an m × p matrix.
⚠️ Dimension Check
Before multiplying two matrices, always check: does the number of columns in the first matrix equal the number of rows in the second? If not, the multiplication is undefined — it simply cannot be done.

Matrix Multiplication — Step by Step

Matrix multiplication is the trickiest of the three operations. To understand it, let's visualize exactly how one entry of the result matrix is calculated. The idea is called the dot product — you take a row from the first matrix and a column from the second matrix, multiply matching pairs, and add the products together.

This diagram shows how a 2 × 3 matrix multiplied by a 3 × 2 matrix produces a 2 × 2 result. The highlighted row (pink) from A is paired with the highlighted column (amber) from B. Matching entries are multiplied and the products are summed to get the green entry C₁₁ = 58.

To find every entry of the result matrix C, you repeat this dot-product process. For C₁₂, use Row 1 of A and Column 2 of B. For C₂₁, use Row 2 of A and Column 1 of B. And for C₂₂, use Row 2 of A and Column 2 of B. Each entry is its own little calculation.

💡 Quick Tip: The Inner Dimensions Must Match
When you write the dimensions side by side — (2×3) × (3×2) — the two inner numbers (both 3 here) must be equal. The outer numbers (2 and 2) tell you the dimensions of the answer.

Worked Example

Let's walk through a complete example that uses all three operations. Suppose a teacher records quiz scores for two students across three subjects in matrix S, and she wants to adjust and combine them.

Combined Matrix Operations
1
Step 1 — Define the MatricesLet S = [[80, 90, 70], [60, 85, 95]] represent quiz scores for two students (rows) in three subjects (columns). Let B = [[5, 0, 10], [5, 5, 0]] represent bonus points. We want to find 2S + B, then multiply the result by a weight matrix W = [[0.3], [0.4], [0.3]].
2
Step 2 — Scalar Multiplication (2S)Multiply every entry of S by 2. 2S = [[2×80, 2×90, 2×70], [2×60, 2×85, 2×95]] = [[160, 180, 140], [120, 170, 190]].
2S = [[160, 180, 140], [120, 170, 190]]
3
Step 3 — Matrix Addition (2S + B)Both 2S and B are 2 × 3, so we can add them entry by entry. 2S + B = [[160+5, 180+0, 140+10], [120+5, 170+5, 190+0]] = [[165, 180, 150], [125, 175, 190]].
2S + B = [[165, 180, 150], [125, 175, 190]]
4
Step 4 — Check Dimensions for MultiplicationOur result (2S + B) is 2 × 3 and W is 3 × 1. The inner dimensions match (both 3), so multiplication is allowed. The result will be a 2 × 1 matrix — one weighted score per student.
5
Step 5 — Matrix MultiplicationFor Student 1 (Row 1): (165 × 0.3) + (180 × 0.4) + (150 × 0.3) = 49.5 + 72 + 45 = 166.5. For Student 2 (Row 2): (125 × 0.3) + (175 × 0.4) + (190 × 0.3) = 37.5 + 70 + 57 = 164.5.
Final result = [[166.5], [164.5]]. Student 1 has a weighted score of 166.5 and Student 2 has 164.5.

Properties & Comparisons

Matrix operations share some properties with regular number arithmetic, but they also have surprising differences. The table below compares key properties across the three operations.

Properties of the three matrix operations
PropertyAdditionScalar Mult.Matrix Mult.
Commutative (order doesn't matter)✅ A + B = B + A✅ kA = Ak❌ AB ≠ BA in general
Associative (grouping doesn't matter)✅ (A + B) + C = A + (B + C)✅ k(mA) = (km)A✅ (AB)C = A(BC)
Distributive✅ k(A + B) = kA + kB✅ (k + m)A = kA + mA✅ A(B + C) = AB + AC
Dimension requirementSame dimensionsAny dimensionInner dimensions must match
KEY TAKEAWAY
The biggest surprise for most students is that matrix multiplication is not commutative. With regular numbers, 3 × 5 = 5 × 3 always. But with matrices, A × B usually does not equal B × A. Think of it like getting dressed: putting on socks then shoes gives a very different result than shoes then socks!

Connection to Advanced Topics

The three operations you just learned are the building blocks for much more powerful tools. As you advance in math and science, you'll use them constantly. Here is a preview of where these ideas lead.

How today's lesson connects to future topics
What You Know NowWhere It Leads
Matrix addition & scalar multiplicationLinear combinations & vector spaces — the foundation of linear algebra
Matrix multiplicationSolving systems of equations — writing Ax = b and finding x
Dimension checkingDeterminants & invertibility — testing if a matrix can be "undone"
Dot product ideaTransformations & computer graphics — rotating and scaling images on screen

Every time you play a 3D video game, the graphics engine performs millions of matrix multiplications per second to rotate, scale, and position objects on your screen. Machine learning models — the technology behind voice assistants and image recognition — are essentially giant matrix multiplication pipelines. By mastering these basic operations, you are learning the language that powers modern technology.

Practice Problems

PROBLEM 1CONCEPTUAL
Matrix P is 3 × 4 and matrix Q is 4 × 3. Can you compute P + Q? Can you compute P × Q? Explain your reasoning for each.
PROBLEM 2BASIC CALCULATION
Let A = [[4, −1], [2, 5]] and B = [[−3, 6], [0, −2]]. Compute A + B and 3A.
PROBLEM 3INTERMEDIATE
Let M = [[2, 1], [0, 3]] and N = [[1, 4], [−2, 5]]. Compute M × N and then N × M. Are they equal?
PROBLEM 4APPLIED
A bakery sells muffins and cookies at two locations. Location 1 sold [120, 80] items and Location 2 sold [90, 150] items (muffins first, cookies second). The prices are muffins = $3, cookies = $2. Represent the sales as a 2 × 2 matrix S (rows = locations, columns = items) and the prices as a 2 × 1 matrix P. Calculate S × P to find each location's revenue.
PROBLEM 5CRITICAL THINKING
Suppose A is a 2 × 3 matrix and B is a 3 × 2 matrix. You can compute both AB and BA. What are the dimensions of AB and BA? Could AB ever equal BA? Explain why or why not.

Lesson Summary

A matrix is a rectangular grid of numbers organized in rows and columns. Matrix addition combines two matrices of the same dimensions by adding entries in matching positions. Scalar multiplication multiplies every entry in a matrix by a single number, stretching or shrinking all values uniformly. Matrix multiplication uses the dot product — pairing a row from the first matrix with a column from the second, multiplying matching entries, and summing the products to get one entry of the result.

Always check dimensions before computing. Addition requires the same dimensions. Multiplication requires the inner dimensions to match (columns of the first = rows of the second). Remember that matrix multiplication is not commutative — the order matters. These three operations form the foundation for solving systems of equations, performing geometric transformations, and powering modern technologies like computer graphics and machine learning.

Varsity Tutors • Linear Algebra • Matrix Operations — Matrix Addition, Scalar Multiplication, and Multiplication