Matrix Operations: Rules, Types & Examples

#Algebra
TL;DR
Matrix operations are the rules for combining or transforming matrices: addition, subtraction, scalar multiplication, matrix multiplication, transpose, and inverse. Addition and subtraction need matrices of the same order and work element by element; matrix multiplication needs the columns of the first matrix to match the rows of the second and is not commutative ($AB \neq BA$).
BT
Bhanzu TeamLast updated on September 9, 202613 min read

What Are Matrix Operations?

Matrix operations are the defined ways of combining or transforming matrices. The main ones are addition, subtraction, scalar multiplication, matrix multiplication, transpose, and inverse. A matrix is a rectangular array of numbers arranged in rows and columns, and its order is written as (rows × columns). Each operation has a rule about when it is allowed and how the entries are combined.

The rules split into three families:

  • Same-order, element-wise: addition and subtraction. The two matrices must have the same order, and you combine matching positions.

  • Scale every entry: scalar multiplication. One number multiplies every entry.

  • Row-by-column and rearranging: matrix multiplication, transpose, and inverse. These change the shape or the arrangement of the matrix, and they carry the rules students most often get wrong.

Throughout this article we use two running matrices:

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

Both are order 2 × 2 (two rows, two columns). Every entry is named $a_{ij}$, where $i$ is the row number and $j$ is the column number, so $a_{21} = 3$ sits in row 2, column 1.

How Do You Add Two Matrices?

To add two matrices, add the entries in matching positions. This is only allowed when the two matrices have the same order.

$$A + B = \begin{bmatrix} 1+5 & 2+6 \ 3+7 & 4+8 \end{bmatrix} = \begin{bmatrix} 6 & 8 \ 10 & 12 \end{bmatrix}$$

If the orders differ, say a 2 × 2 and a 2 × 3, the sum is undefined. There is no position to pair a missing entry with.

Properties of matrix addition:

  • Commutative: $A + B = B + A$. Order of the two matrices does not matter for addition.

  • Associative: $(A + B) + C = A + (B + C)$.

  • Additive identity: the zero matrix $O$ (all entries $0$) satisfies $A + O = A$.

  • Additive inverse: every matrix $A$ has a negative $-A$ with $A + (-A) = O$.

How Do You Subtract Two Matrices?

To subtract two matrices, subtract the entries in matching positions. Like addition, the two matrices must have the same order.

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

Subtraction is really addition of a negative: $A - B = A + (-B)$, where $-B$ is $B$ with every sign flipped. That single idea is why subtraction inherits the same order rule as addition. For a fuller treatment with more cases, see subtraction of matrices.

One difference from addition: subtraction is not commutative. $A - B$ is the negative of $B - A$, so the order you write them in changes the sign of every entry.

What Is Scalar Multiplication Of A Matrix?

Scalar multiplication multiplies every entry of a matrix by a single number (the scalar). The order of the matrix does not change.

$$2A = 2\begin{bmatrix} 1 & 2 \ 3 & 4 \end{bmatrix} = \begin{bmatrix} 2 & 4 \ 6 & 8 \end{bmatrix}$$

A scalar can be any real number, including a fraction or a negative. Multiplying by $-1$ produces the additive inverse $-A$; multiplying by $0$ produces the zero matrix.

Properties of scalar multiplication (for scalars $k$, $m$):

  • Distributive over matrix addition: $k(A + B) = kA + kB$.

  • Distributive over scalar addition: $(k + m)A = kA + mA$.

  • Associative with scalars: $k(mA) = (km)A$.

A quick note on language: "scalar" simply means "a plain number," as opposed to a whole matrix. The word marks the difference between scaling every entry (one number) and multiplying two grids together (the next section).

How Do You Multiply Two Matrices?

To multiply two matrices, take each row of the first matrix against each column of the second, multiply matching elements, and add the products. This is the operation students most often misread, so the rule matters: matrix multiplication is not element-wise.

The compatibility rule: for $A \times B$, the number of columns in $A$ must equal the number of rows in $B$. If $A$ is order $m \times n$ and $B$ is order $n \times p$, then $AB$ has order $m \times p$.

$$ \underset{m \times n}{A} ; \times ; \underset{n \times p}{B} ; = ; \underset{m \times p}{AB} $$

The two inner numbers must match; the two outer numbers give the size of the answer.

Example 1: Multiply $A$ and $B$.

Each entry of $AB$ is a row of $A$ combined with a column of $B$:

$$AB = \begin{bmatrix} (1)(5)+(2)(7) & (1)(6)+(2)(8) \ (3)(5)+(4)(7) & (3)(6)+(4)(8) \end{bmatrix} = \begin{bmatrix} 19 & 22 \ 43 & 50 \end{bmatrix}$$

Now reverse the order and multiply $BA$:

$$BA = \begin{bmatrix} (5)(1)+(6)(3) & (5)(2)+(6)(4) \ (7)(1)+(8)(3) & (7)(2)+(8)(4) \end{bmatrix} = \begin{bmatrix} 23 & 34 \ 31 & 46 \end{bmatrix}$$

$AB \neq BA$. This is the defining surprise of matrix multiplication: it is not commutative. The order you multiply in changes the answer.

Properties of matrix multiplication:

  • Not commutative: $AB \neq BA$ in general (as shown above).

  • Associative: $(AB)C = A(BC)$.

  • Distributive: $A(B + C) = AB + AC$.

  • Multiplicative identity: the identity matrix $I$ leaves a matrix unchanged: $AI = IA = A$.

For the full method with larger and rectangular matrices, see multiplication of matrices.

What Is The Transpose Of A Matrix?

The transpose of a matrix flips it across its main diagonal: row 1 becomes column 1, row 2 becomes column 2, and so on. The transpose of $A$ is written $A^{T}$.

$$A = \begin{bmatrix} 1 & 2 \ 3 & 4 \end{bmatrix} \qquad A^{T} = \begin{bmatrix} 1 & 3 \ 2 & 4 \end{bmatrix}$$

If $A$ has order $m \times n$, then $A^{T}$ has order $n \times m$. A 2 × 3 matrix transposes into a 3 × 2 matrix.

Two properties worth remembering:

  • $(A^{T})^{T} = A$, transposing twice returns the original.

  • $(AB)^{T} = B^{T}A^{T}$, the transpose of a product reverses the order of the factors.

For worked cases and special matrices built from the transpose, see transpose of a matrix.

How Do You Find The Inverse Of A Matrix?

The inverse of a square matrix $A$, written $A^{-1}$, is the matrix that "undoes" $A$: $A \times A^{-1} = A^{-1} \times A = I$, the identity. Only square matrices can have an inverse, and even then only when the determinant is not zero.

For a 2 × 2 matrix $A = \begin{bmatrix} a & b \ c & d \end{bmatrix}$, the inverse is:

$$A^{-1} = \frac{1}{\det(A)} \begin{bmatrix} d & -b \ -c & a \end{bmatrix}, \qquad \det(A) = ad - bc$$

Example 2: Find the inverse of $A = \begin{bmatrix} 1 & 2 \ 3 & 4 \end{bmatrix}$.

First the determinant:

$\det(A) = (1)(4) - (2)(3) = 4 - 6 = -2$

Since $\det(A) = -2 \neq 0$, the inverse exists. Swap $a$ and $d$, negate $b$ and $c$, then divide by the determinant:

$$A^{-1} = \frac{1}{-2}\begin{bmatrix} 4 & -2 \ -3 & 1 \end{bmatrix} = \begin{bmatrix} -2 & 1 \ \tfrac{3}{2} & -\tfrac{1}{2} \end{bmatrix}$$

Check by multiplying back: $A \times A^{-1} = I$.

Final answer: $A^{-1} = \begin{bmatrix} -2 & 1 \ \tfrac{3}{2} & -\tfrac{1}{2} \end{bmatrix}$.

When $\det(A) = 0$, the matrix is singular and has no inverse. For the 3 × 3 method and the general formula, see inverse of a matrix.

Which Matrix Operations Are Allowed? (Order And Dimension Rules)

Most matrix mistakes are not arithmetic. They are doing an operation that was never allowed. This one table settles it.

Table: When each matrix operation is defined, and the order of the result.

Operation

Condition on the matrices

Order of the result

Addition $A + B$

Same order

Same as inputs

Subtraction $A - B$

Same order

Same as inputs

Scalar multiplication $kA$

Always defined

Same as $A$

Matrix multiplication $AB$

Columns of $A$ = rows of $B$

(rows of $A$) × (columns of $B$)

Transpose $A^{T}$

Always defined

Columns × rows (flipped)

Inverse $A^{-1}$

Square and $\det(A) \neq 0$

Same as $A$

Read the table before you compute. If the condition column fails, the answer does not exist, and writing one down is the single most common error on a matrices paper.

What Are The Properties Of Matrix Operations?

Matrix operations follow many of the rules of ordinary arithmetic, but not all of them. The differences are exactly where marks are lost.

Table: How matrix operations compare to ordinary number arithmetic.

Property

Numbers

Matrices

Addition commutative

Yes

Yes ($A+B = B+A$)

Multiplication commutative

Yes

No ($AB \neq BA$ in general)

Associative (+ and ×)

Yes

Yes

Distributive

Yes

Yes ($A(B+C)=AB+AC$)

Has an identity

$0$ and $1$

Zero matrix and identity matrix

Every non-zero element has an inverse

Yes

No, only if square and $\det \neq 0$

The two "No" rows carry the whole difficulty of the topic. Multiplication order matters, and not every matrix can be inverted. A consolidated reference lives at properties of matrices.

Why Do Matrix Operations Exist?

Matrix operations were not invented to make homework longer. They exist because two very different problems turned out to need the same tool.

  • Solving many equations at once. A system such as $2x + y = 5$ and $x - 3y = 1$ can be written as one matrix equation $A\mathbf{x} = \mathbf{b}$. Matrix multiplication is the act of substituting the unknowns into every equation simultaneously, and the inverse $A^{-1}$ is what solves for them in one step: $\mathbf{x} = A^{-1}\mathbf{b}$.

  • Transforming space. A rotation, a reflection, or a stretch of a shape is captured by a matrix. Applying the transformation to a point is a matrix multiplication; doing two transformations in a row is multiplying their matrices. Because the physical order of "rotate then move" differs from "move then rotate," the matrices must not commute, and they don't.

That second point is the deep reason $AB \neq BA$. It is not a quirk of the definition. Multiplication was built to model actions performed in sequence, and actions in the real world depend on their order. Matrix operations are the arithmetic of doing things to space and to systems, which is why they show up everywhere those two ideas appear.

Who Invented Matrices And Matrix Operations?

The grid came thousands of years before the name. Chinese mathematicians were solving systems of equations with rectangular arrays of numbers long before anyone in Europe wrote down a rule for multiplying them.

Two mathematicians gave matrices their modern algebra:

  • James Joseph Sylvester (1814–1897, England) coined the word "matrix" in 1850, from the Latin for "womb," picturing the array as the thing that gives birth to determinants.

  • Arthur Cayley (1821–1895, England) defined how to add, multiply, and invert matrices in A Memoir on the Theory of Matrices (1858), turning a bookkeeping layout into an algebra in its own right. Cayley was the one who noticed that $AB$ and $BA$ need not agree.

Where Are Matrix Operations Used In The Real World?

The same six operations run quietly under a surprising range of technology.

  • Computer graphics and games: every rotation, scaling, and movement of a 3D character is a transformation matrix, and the on-screen result is a chain of matrix multiplications applied to each vertex.

  • Machine learning: a neural network layer is a matrix multiplication of inputs by learned weights; training a large model is billions of these products.

  • Image processing: blurring, sharpening, and edge-detection filters are small matrices (kernels) multiplied across the grid of pixels.

  • Cryptography: the Hill cipher encrypts blocks of text by multiplying them by a key matrix, and decrypts them with the inverse.

  • Economics and engineering: input-output models, electrical circuits, and structural loads are all written as $A\mathbf{x} = \mathbf{b}$ and solved with matrix operations.

One toolkit (addition, multiplication, inverse) runs graphics, learning machines, secret codes, and national economies. Mathematics is the common language across fields that look completely unrelated.

What Are The Most Common Matrix Operation Mistakes?

These four errors account for most lost marks on matrices, verified against AP Precalculus reviews, O-Level error guides, and a published study of student mistakes in matrix multiplication.

Multiplying matrices entry by entry.

Where it slips in:

A student computes $AB$ by multiplying matching positions, top-left times top-left, and so on, as if matrices multiplied like addition works.

Don't do this:

Do not pair single entries. Matrix multiplication is never element-wise.

The correct way:

Pair each full row of the first matrix with each full column of the second: entry $(i,j)$ of $AB$ is row $i$ of $A$ combined with column $j$ of $B$, multiplied term by term and summed.

Assuming $AB = BA$.

Where it slips in:

A student swaps the order of a product to make the arithmetic easier, treating matrices like ordinary numbers.

Don't do this:

Do not reorder a matrix product. $AB$ and $BA$ are usually different matrices, and can even have different orders.

The correct way:

Keep the order exactly as written. For our $A$ and $B$, $AB = \begin{bmatrix} 19 & 22 \ 43 & 50 \end{bmatrix}$ but $BA = \begin{bmatrix} 23 & 34 \ 31 & 46 \end{bmatrix}$.

Skipping the dimension check.

Where it slips in:

A student starts adding or multiplying without confirming the orders line up, then produces an "answer" for an operation that is undefined.

Don't do this:

Do not compute before checking. Addition needs equal orders; multiplication needs columns of the first to equal rows of the second.

The correct way:

Write the orders under each matrix first. For $A_{m\times n} \times B_{n \times p}$, confirm the inner numbers match, and read the result size from the outer numbers.

Losing the sign or the position when transposing or inverting.

Where it slips in:

While finding a 2 × 2 inverse, a student forgets to negate $b$ and $c$, or divides by the determinant before rearranging the entries.

Don't do this:

Do not apply the formula from memory in the wrong order.

The correct way:

Follow the fixed sequence, swap $a$ and $d$, negate $b$ and $c$, then divide the whole matrix by $\det(A) = ad - bc$.

Practice Problems On Matrix Operations

Use $P = \begin{bmatrix} 2 & 0 \ 1 & 3 \end{bmatrix}$ and $Q = \begin{bmatrix} 4 & 5 \ 6 & 1 \end{bmatrix}$ unless a problem says otherwise. Answers follow each line.

  1. Find $P + Q$.
    (Answer: $\begin{bmatrix} 6 & 5 \ 7 & 4 \end{bmatrix}$.)

  2. Find $Q - P$.
    (Answer: $\begin{bmatrix} 2 & 5 \ 5 & -2 \end{bmatrix}$.)

  3. Find $3P$.
    (Answer: $\begin{bmatrix} 6 & 0 \ 3 & 9 \end{bmatrix}$.)

  4. Find $PQ$.
    (Answer: $\begin{bmatrix} 8 & 10 \ 22 & 8 \end{bmatrix}$.)

  5. Write $P^{T}$.
    (Answer: $\begin{bmatrix} 2 & 1 \ 0 & 3 \end{bmatrix}$.)

  6. Find $P^{-1}$.
    (Answer: $\det(P)=6$, so $P^{-1} = \begin{bmatrix} \tfrac{1}{2} & 0 \ -\tfrac{1}{6} & \tfrac{1}{3} \end{bmatrix}$.)

Where Should You Go Next After Matrix Operations?

Matrix operations are the entry point to linear algebra, and several natural doors open from here.

  1. Matrices and determinants. The determinant decides when an inverse exists and measures how a transformation scales area and volume.

  2. Multiplication of matrices. Go deeper on the one operation that carries the most rules, with larger and rectangular cases.

  3. Inverse of a matrix. The 3 × 3 method and the role of the inverse in solving systems of equations in one step.

If your child is building these foundations, a live Bhanzu trainer teaches matrix operations starting from the "why" (the transformations and systems the grid was built to model) in the Bhanzu algebra program.

Book a Free Demo

Was this article helpful?

Your feedback helps us write better content

Frequently Asked Questions

What are the six basic matrix operations?
Addition, subtraction, scalar multiplication, matrix multiplication, transpose, and inverse. The first three are straightforward; multiplication, transpose, and inverse carry the rules students most often miss.
Is matrix multiplication commutative?
No. In general $AB \neq BA$, the order changes the answer, and sometimes even the size of the result. This is the single biggest way matrices differ from ordinary numbers.
Can you add matrices of different sizes?
No. Addition and subtraction require both matrices to have exactly the same order (same number of rows and the same number of columns). Different orders make the operation undefined.
When does a matrix not have an inverse?
A matrix has no inverse when it is not square, or when its determinant equals zero. Such a matrix is called singular. Only square matrices with a non-zero determinant can be inverted.
What is the difference between scalar multiplication and matrix multiplication?
Scalar multiplication multiplies every entry by a single number and keeps the order unchanged. Matrix multiplication combines rows of one matrix with columns of another, follows the columns-equal-rows condition, and usually changes the order of the result.
Which curricula teach matrix operations?
Matrix operations appear in India's NCERT Class 12 (Chapter 3, Matrices) and in the United States under the Common Core high-school standards N-VM.7–N-VM.9. They then recur throughout linear algebra at university level.
✍️ Written By
BT
Bhanzu Team
Content Creator and Editor
Bhanzu’s editorial team, known as Team Bhanzu, is made up of experienced educators, curriculum experts, content strategists, and fact-checkers dedicated to making math simple and engaging for learners worldwide. Every article and resource is carefully researched, thoughtfully structured, and rigorously reviewed to ensure accuracy, clarity, and real-world relevance. We understand that building strong math foundations can raise questions for students and parents alike. That’s why Team Bhanzu focuses on delivering practical insights, concept-driven explanations, and trustworthy guidance-empowering learners to develop confidence, speed, and a lifelong love for mathematics.
Related Articles
Book a FREE Demo ClassBook Now →