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≠BAAB \neq BA).
MV
Madhukar VLast 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=[12 34],B=[56 78]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 aija_{ij}, where ii is the row number and jj is the column number, so a21=3a_{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=[1+52+6 3+74+8]=[68 1012]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+AA + B = B + A. Order of the two matrices does not matter for addition.

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

  • Additive identity: the zero matrix OO (all entries 00) satisfies A+O=AA + O = A.

  • Additive inverse: every matrix AA has a negative −A-A with A+(−A)=OA + (-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=[1−52−6 3−74−8]=[−4−4 −4−4]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)A - B = A + (-B), where −B-B is BB 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−BA - B is the negative of B−AB - 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[12 34]=[24 68]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-1 produces the additive inverse −A-A; multiplying by 00 produces the zero matrix.

Properties of scalar multiplication (for scalars kk, mm):

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

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

  • Associative with scalars: k(mA)=(km)Ak(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×BA \times B, the number of columns in AA must equal the number of rows in BB. If AA is order m×nm \times n and BB is order n×pn \times p, then ABAB has order m×pm \times p.

Am×n;×;Bn×p;=;ABm×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 AA and BB.

Each entry of ABAB is a row of AA combined with a column of BB:

AB=[(1)(5)+(2)(7)(1)(6)+(2)(8) (3)(5)+(4)(7)(3)(6)+(4)(8)]=[1922 4350]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 BABA:

BA=[(5)(1)+(6)(3)(5)(2)+(6)(4) (7)(1)+(8)(3)(7)(2)+(8)(4)]=[2334 3146]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≠BAAB \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≠BAAB \neq BA in general (as shown above).

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

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

  • Multiplicative identity: the identity matrix II leaves a matrix unchanged: AI=IA=AAI = 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 AA is written ATA^{T}.

A=[12 34]AT=[13 24]A = \begin{bmatrix} 1 & 2 \ 3 & 4 \end{bmatrix} \qquad A^{T} = \begin{bmatrix} 1 & 3 \ 2 & 4 \end{bmatrix}

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

Two properties worth remembering:

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

  • (AB)T=BTAT(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 AA, written A−1A^{-1}, is the matrix that "undoes" AA: A×A−1=A−1×A=IA \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=[ab cd]A = \begin{bmatrix} a & b \ c & d \end{bmatrix}, the inverse is:

A−1=1det⁡(A)[d−b −ca],det⁡(A)=ad−bcA^{-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=[12 34]A = \begin{bmatrix} 1 & 2 \ 3 & 4 \end{bmatrix}.

First the determinant:

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

Since det⁡(A)=−2≠0\det(A) = -2 \neq 0, the inverse exists. Swap aa and dd, negate bb and cc, then divide by the determinant:

A−1=1−2[4−2 −31]=[−21 32−12]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×A−1=IA \times A^{-1} = I.

Final answer: A−1=[−21 32−12]A^{-1} = \begin{bmatrix} -2 & 1 \ \tfrac{3}{2} & -\tfrac{1}{2} \end{bmatrix}.

When det⁡(A)=0\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+BA + B

Same order

Same as inputs

Subtraction A−BA - B

Same order

Same as inputs

Scalar multiplication kAkA

Always defined

Same as AA

Matrix multiplication ABAB

Columns of AA = rows of BB

(rows of AA) × (columns of BB)

Transpose ATA^{T}

Always defined

Columns × rows (flipped)

Inverse A−1A^{-1}

Square and det⁡(A)≠0\det(A) \neq 0

Same as AA

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+AA+B = B+A)

Multiplication commutative

Yes

No (AB≠BAAB \neq BA in general)

Associative (+ and ×)

Yes

Yes

Distributive

Yes

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

Has an identity

00 and 11

Zero matrix and identity matrix

Every non-zero element has an inverse

Yes

No, only if square and det⁡≠0\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=52x + y = 5 and x−3y=1x - 3y = 1 can be written as one matrix equation Ax=bA\mathbf{x} = \mathbf{b}. Matrix multiplication is the act of substituting the unknowns into every equation simultaneously, and the inverse A−1A^{-1} is what solves for them in one step: x=A−1b\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≠BAAB \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 ABAB and BABA 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 Ax=bA\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 ABAB 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)(i,j) of ABAB is row ii of AA combined with column jj of BB, multiplied term by term and summed.

Assuming AB=BAAB = 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. ABAB and BABA are usually different matrices, and can even have different orders.

The correct way:

Keep the order exactly as written. For our AA and BB, AB=[1922 4350]AB = \begin{bmatrix} 19 & 22 \ 43 & 50 \end{bmatrix} but BA=[2334 3146]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 Am×n×Bn×pA_{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 bb and cc, 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 aa and dd, negate bb and cc, then divide the whole matrix by det⁡(A)=ad−bc\det(A) = ad - bc.

Practice Problems On Matrix Operations

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

  1. Find P+QP + Q.
    (Answer: [65 74]\begin{bmatrix} 6 & 5 \ 7 & 4 \end{bmatrix}.)

  2. Find Q−PQ - P.
    (Answer: [25 5−2]\begin{bmatrix} 2 & 5 \ 5 & -2 \end{bmatrix}.)

  3. Find 3P3P.
    (Answer: [60 39]\begin{bmatrix} 6 & 0 \ 3 & 9 \end{bmatrix}.)

  4. Find PQPQ.
    (Answer: [810 228]\begin{bmatrix} 8 & 10 \ 22 & 8 \end{bmatrix}.)

  5. Write PTP^{T}.
    (Answer: [21 03]\begin{bmatrix} 2 & 1 \ 0 & 3 \end{bmatrix}.)

  6. Find P−1P^{-1}.
    (Answer: det⁡(P)=6\det(P)=6, so P−1=[120 −1613]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.

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≠BAAB \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
Madhukar V
Madhukar V
Math Columnist & Analyst
I see mathematics as more than just numbers and formulas—it is a way of thinking, questioning, and understanding the world around us. I work at the intersection of mathematics, EdTech, technology, and AI-powered learning, I enjoy exploring how mathematical ideas can be made simple, meaningful, and relatable. Through my articles, I aim to present mathematics with curiosity and a practical perspective, helping readers see the beauty and relevance behind every concept in a Bhanzu way.
LinkedIn
Related Articles
Book a FREE Demo ClassBook Now →