The Central Idea
Suppose
\[ A= \begin{bmatrix} 1 & 2\\ 3 & 4 \end{bmatrix} \]and
\[ B= \begin{bmatrix} 5 & 6\\ 7 & 8 \end{bmatrix}. \]Addition is entrywise:
\[ A+B= \begin{bmatrix} 1+5 & 2+6\\ 3+7 & 4+8 \end{bmatrix} = \boxed{ \begin{bmatrix} 6 & 8\\ 10 & 12 \end{bmatrix} }. \]But multiplication is not entrywise.
Instead,
\[ AB= \begin{bmatrix} 1(5)+2(7) & 1(6)+2(8)\\ 3(5)+4(7) & 3(6)+4(8) \end{bmatrix} = \boxed{ \begin{bmatrix} 19 & 22\\ 43 & 50 \end{bmatrix} }. \]Matrix multiplication combines row-column structure rather than matching positions directly.
Matrix Addition
Two matrices can be added only when they have the same dimensions.
If
\[ A=[a_{ij}] \]and
\[ B=[b_{ij}], \]then
\[ \boxed{ A+B=[a_{ij}+b_{ij}] }. \]Example: Matrix Addition
Let
\[ A= \begin{bmatrix} 2 & -1\\ 5 & 3 \end{bmatrix} \]and
\[ B= \begin{bmatrix} 4 & 6\\ -2 & 7 \end{bmatrix}. \]Then
\[ A+B= \begin{bmatrix} 6 & 5\\ 3 & 10 \end{bmatrix}. \]Why Dimensions Must Match for Addition
Addition pairs corresponding entries.
A
\[ 2\times3 \]matrix has six positions arranged differently from a
\[ 3\times2 \]matrix.
Because their entry positions do not correspond, their sum is undefined.
Matrix Subtraction
Matrix subtraction is also entrywise:
\[ \boxed{ A-B=[a_{ij}-b_{ij}] }. \]The matrices must again have the same dimensions.
Example: Matrix Subtraction
Let
\[ A= \begin{bmatrix} 7 & 3\\ 4 & 9 \end{bmatrix}, \qquad B= \begin{bmatrix} 2 & 5\\ 1 & 6 \end{bmatrix}. \]Then
\[ A-B= \boxed{ \begin{bmatrix} 5 & -2\\ 3 & 3 \end{bmatrix} }. \]Scalar Multiplication
A scalar multiplies every entry of a matrix.
If
\[ k\in\mathbb{R}, \]then
\[ \boxed{ kA=[ka_{ij}] }. \]Example: Scalar Multiplication
For
\[ A= \begin{bmatrix} 2 & -1\\ 3 & 5 \end{bmatrix}, \]we have
\[ 3A= \boxed{ \begin{bmatrix} 6 & -3\\ 9 & 15 \end{bmatrix} }. \]Negative Scalars
Multiplying by
\[ -1 \]changes the sign of every entry:
\[ -A= \begin{bmatrix} -a_{11} & -a_{12}\\ -a_{21} & -a_{22} \end{bmatrix}. \]This allows subtraction to be written as
\[ A-B=A+(-B). \]The Zero Matrix in Addition
The zero matrix acts as the additive identity.
For any matrix \(A\) of matching dimensions,
\[ \boxed{ A+0=A }. \]Additive Inverses
Every matrix \(A\) has an additive inverse
\[ -A. \]Then
\[ \boxed{ A+(-A)=0 }. \]Basic Addition Properties
For matrices of compatible dimensions:
\[ A+B=B+A, \] \[ (A+B)+C=A+(B+C), \] \[ A+0=A. \]Matrix addition behaves much like vector addition.
Scalar Distribution
Scalar multiplication distributes over matrix addition:
\[ \boxed{ k(A+B)=kA+kB }. \]Also,
\[ (k+\ell)A=kA+\ell A. \]Matrix Multiplication Is Different
Matrix multiplication is not entrywise multiplication.
It is defined through row-column products.
This operation is designed so that matrices represent compositions of linear relationships.
Dimension Rule for Multiplication
If
\[ A \]is
\[ m\times n \]and
\[ B \]is
\[ n\times p, \]then
\[ AB \]is defined and has dimensions
\[ \boxed{m\times p}. \]The Inner Dimensions Must Match
For
\[ (m\times n)(n\times p), \]the inner dimensions
\[ n \]must match.
The outer dimensions
\[ m \]and
\[ p \]become the dimensions of the product.
Dimension Example
If
\[ A \]is
\[ 2\times3 \]and
\[ B \]is
\[ 3\times4, \]then
\[ AB \]is defined and has dimensions
\[ \boxed{2\times4}. \]Undefined Product Example
If
\[ A \]is
\[ 2\times3 \]and
\[ B \]is
\[ 2\times4, \]then
\[ AB \]is not defined because the inner dimensions
\[ 3 \]and
\[ 2 \]do not match.
Row by Column
Suppose
\[ A= \begin{bmatrix} a & b \end{bmatrix} \]and
\[ B= \begin{bmatrix} c\\ d \end{bmatrix}. \]Then
\[ AB= \boxed{ ac+bd }. \]A row times a column produces a scalar.
The Entry Formula
If
\[ C=AB, \]then the entry in row \(i\), column \(j\) is
\[ \boxed{ c_{ij} = \sum_{k=1}^{n}a_{ik}b_{kj} }. \]In words: take row \(i\) of \(A\), column \(j\) of \(B\), multiply corresponding entries, and add.
Two-by-Two Multiplication
Let
\[ A= \begin{bmatrix} a & b\\ c & d \end{bmatrix}, \qquad B= \begin{bmatrix} e & f\\ g & h \end{bmatrix}. \]Then
\[ \boxed{ AB= \begin{bmatrix} ae+bg & af+bh\\ ce+dg & cf+dh \end{bmatrix} }. \]Worked Multiplication Example
Let
\[ A= \begin{bmatrix} 1 & 2\\ 3 & 4 \end{bmatrix}, \qquad B= \begin{bmatrix} 5 & 6\\ 7 & 8 \end{bmatrix}. \]The first entry is
\[ 1(5)+2(7)=19. \]The upper-right entry is
\[ 1(6)+2(8)=22. \]Finish the Product
The lower-left entry is
\[ 3(5)+4(7)=43. \]The lower-right entry is
\[ 3(6)+4(8)=50. \]Therefore,
\[ \boxed{ AB= \begin{bmatrix} 19 & 22\\ 43 & 50 \end{bmatrix} }. \]Rectangular Multiplication
Let
\[ A= \begin{bmatrix} 1 & 2 & 3\\ 4 & 5 & 6 \end{bmatrix} \]and
\[ B= \begin{bmatrix} 1 & 0\\ 0 & 1\\ 1 & 1 \end{bmatrix}. \]The product is defined because
\[ (2\times3)(3\times2). \]The result will be
\[ 2\times2. \]Compute the Rectangular Product
First row, first column:
\[ 1(1)+2(0)+3(1)=4. \]First row, second column:
\[ 1(0)+2(1)+3(1)=5. \]Second row, first column:
\[ 4(1)+5(0)+6(1)=10. \]Second row, second column:
\[ 4(0)+5(1)+6(1)=11. \]Thus,
\[ \boxed{ AB= \begin{bmatrix} 4 & 5\\ 10 & 11 \end{bmatrix} }. \]Matrix–Vector Multiplication
A matrix can multiply a column vector.
Let
\[ A= \begin{bmatrix} 2 & 3\\ 4 & -1 \end{bmatrix} \]and
\[ \mathbf{x}= \begin{bmatrix} x\\ y \end{bmatrix}. \]Then
\[ A\mathbf{x} = \boxed{ \begin{bmatrix} 2x+3y\\ 4x-y \end{bmatrix} }. \]Why Matrix Multiplication Represents Systems
The equation
\[ A\mathbf{x}=\mathbf{b} \]with
\[ A= \begin{bmatrix} 2 & 3\\ 4 & -1 \end{bmatrix}, \qquad \mathbf{b}= \begin{bmatrix} 7\\ 5 \end{bmatrix} \]means
\[ \begin{cases} 2x+3y=7,\\ 4x-y=5. \end{cases} \]Matrix multiplication reproduces the linear combinations in the system exactly.
Rows as Linear Combinations
Each entry of
\[ A\mathbf{x} \]is the dot product of one row of \(A\) with the vector \(\mathbf{x}\).
Thus, each row computes one linear combination of the variables.
Columns as Contributions
Matrix multiplication can also be interpreted through columns.
If
\[ A= \begin{bmatrix} \vert & \vert\\ \mathbf{a}_1 & \mathbf{a}_2\\ \vert & \vert \end{bmatrix}, \]then
\[ A \begin{bmatrix} x_1\\ x_2 \end{bmatrix} = \boxed{ x_1\mathbf{a}_1+x_2\mathbf{a}_2 }. \]The output is a linear combination of the columns of \(A\).
Example: Column Combination
Let
\[ A= \begin{bmatrix} 1 & 3\\ 2 & 4 \end{bmatrix}, \qquad \mathbf{x}= \begin{bmatrix} 5\\ -1 \end{bmatrix}. \]Then
\[ A\mathbf{x} = 5 \begin{bmatrix} 1\\ 2 \end{bmatrix} - \begin{bmatrix} 3\\ 4 \end{bmatrix} = \boxed{ \begin{bmatrix} 2\\ 6 \end{bmatrix} }. \]Matrix Multiplication and Transformations
A matrix can represent a transformation of vectors.
For example,
\[ A= \begin{bmatrix} 2 & 0\\ 0 & 3 \end{bmatrix} \]maps
\[ \begin{bmatrix} x\\ y \end{bmatrix} \]to
\[ \begin{bmatrix} 2x\\ 3y \end{bmatrix}. \]This scales the \(x\)-coordinate by \(2\) and the \(y\)-coordinate by \(3\).
Composition of Transformations
If matrix \(B\) transforms a vector first and matrix \(A\) acts afterward, then the combined transformation is
\[ \boxed{AB}. \]Order matters because the rightmost transformation acts first.
Why Multiplication Order Matters
Matrix multiplication is generally not commutative:
\[ \boxed{ AB\ne BA } \]in general.
This differs from ordinary real-number multiplication.
Example of Noncommutativity
Let
\[ A= \begin{bmatrix} 1 & 1\\ 0 & 1 \end{bmatrix}, \qquad B= \begin{bmatrix} 2 & 0\\ 0 & 1 \end{bmatrix}. \]Then
\[ AB= \begin{bmatrix} 2 & 1\\ 0 & 1 \end{bmatrix}. \]But
\[ BA= \begin{bmatrix} 2 & 2\\ 0 & 1 \end{bmatrix}. \]Therefore,
\[ \boxed{AB\ne BA}. \]Sometimes \(BA\) Is Not Even Defined
If
\[ A \]is
\[ 2\times3 \]and
\[ B \]is
\[ 3\times4, \]then
\[ AB \]is defined.
But
\[ BA \]would require multiplying
\[ (3\times4)(2\times3), \]which is undefined because
\[ 4\ne2. \]The Identity Matrix
The identity matrix acts like multiplicative \(1\).
For a compatible matrix \(A\),
\[ \boxed{ IA=A } \]and
\[ \boxed{ AI=A }. \]Two-by-Two Identity
\[ I_2= \begin{bmatrix} 1 & 0\\ 0 & 1 \end{bmatrix}. \]For any
\[ 2\times2 \]matrix \(A\),
\[ I_2A=A \]and
\[ AI_2=A. \]Zero Matrix in Multiplication
For compatible dimensions,
\[ A0=0 \]and
\[ 0A=0. \]The zero matrix absorbs multiplication much like the number \(0\).
Associativity of Matrix Multiplication
When dimensions are compatible,
\[ \boxed{ (AB)C=A(BC) }. \]Thus, a chain of transformations can be grouped in different ways without changing the final result.
Distributive Properties
Matrix multiplication distributes over addition:
\[ \boxed{ A(B+C)=AB+AC } \]and
\[ \boxed{ (A+B)C=AC+BC }. \]Scalar Compatibility
For a scalar \(k\),
\[ \boxed{ k(AB)=(kA)B=A(kB) }. \]Scalars can be moved through a matrix product in this way.
Matrix Powers
If \(A\) is square, then powers such as
\[ A^2 \]and
\[ A^3 \]are defined by repeated matrix multiplication:
\[ A^2=AA, \] \[ A^3=AAA. \]Matrix Powers Require Square Matrices
For ordinary powers such as
\[ A^2, \]the product
\[ AA \]must be defined.
This requires \(A\) to be square.
Example: Matrix Square
Let
\[ A= \begin{bmatrix} 1 & 1\\ 0 & 1 \end{bmatrix}. \]Then
\[ A^2= \begin{bmatrix} 1 & 2\\ 0 & 1 \end{bmatrix}. \]Do Not Square Entries Individually
Matrix squaring means
\[ A^2=AA, \]not
\[ [a_{ij}^2]. \]Entrywise squaring is a different operation.
Transpose and Addition
Transpose distributes over addition:
\[ \boxed{ (A+B)^T=A^T+B^T }. \]Transpose and Multiplication
The transpose of a product reverses the order:
\[ \boxed{ (AB)^T=B^TA^T }. \]This reversal mirrors the importance of order in matrix multiplication.
Why the Order Reverses
The rows and columns used in \(AB\) switch roles under transpose.
Reversing the order preserves the required row-column pairings.
Data Example
Suppose
\[ Q= \begin{bmatrix} 3 & 2\\ 5 & 4 \end{bmatrix} \]records quantities of two products purchased by two stores.
Suppose the price vector is
\[ \mathbf{p}= \begin{bmatrix} 10\\ 6 \end{bmatrix}. \]Then
\[ Q\mathbf{p} \]computes each store's total cost.
Compute the Data Product
\[ Q\mathbf{p} = \begin{bmatrix} 3(10)+2(6)\\ 5(10)+4(6) \end{bmatrix} = \boxed{ \begin{bmatrix} 42\\ 74 \end{bmatrix} }. \]The first store spends \$42 and the second \$74.
Units in Matrix Multiplication
In the previous example:
- entries of \(Q\) are quantities;
- entries of \(\mathbf{p}\) are dollars per unit;
- entries of \(Q\mathbf{p}\) are dollars.
Matrix multiplication can therefore preserve meaningful unit structure.
Weighted Sums
Matrix multiplication naturally computes weighted sums.
If
\[ \mathbf{w}= \begin{bmatrix} w_1\\ w_2\\ \vdots\\ w_n \end{bmatrix}, \]then each row of
\[ A\mathbf{w} \]forms a weighted combination of that row's entries.
Networks and Transition Matrices Preview
Repeated multiplication by a matrix can model movement or change through a network or state system.
For example,
\[ \mathbf{x}_{n+1}=A\mathbf{x}_n \]describes a state updated by the same matrix at each step.
This later connects to recurrences, Markov chains, dynamical systems, and eigenvalues.
Matrix Products Can Encode Multi-Stage Processes
If
\[ B \]converts raw inputs to intermediate quantities and
\[ A \]converts those intermediates to outputs, then
\[ AB \]represents the combined process.
This is why matrix multiplication is built around composition rather than entrywise matching.
Dimension Checks Should Come First
Before multiplying matrices:
- state the dimensions of each matrix;
- check that the inner dimensions match;
- predict the dimensions of the result.
This catches many errors before any arithmetic begins.
Predict the Product Shape
If
\[ A \]is
\[ 4\times2 \]and
\[ B \]is
\[ 2\times5, \]then
\[ AB \]must be
\[ \boxed{4\times5}. \]If your computed product has another shape, something is wrong.
A Reliable Addition Workflow
- Check that the dimensions match.
- Add corresponding entries.
- Keep the same matrix dimensions.
- Interpret the result in context if the matrices represent data.
A Reliable Scalar-Multiplication Workflow
- Identify the scalar.
- Multiply every entry by that scalar.
- Keep the matrix dimensions unchanged.
- Check signs and units.
A Reliable Matrix-Multiplication Workflow
- Write the dimensions of both matrices.
- Verify that the inner dimensions match.
- Predict the product dimensions.
- Take one row of the first matrix and one column of the second.
- Multiply corresponding entries and add.
- Place the result in the matching row-column position.
- Repeat for every output entry.
A Reliable Matrix–Vector Workflow
- Check that the vector length equals the number of matrix columns.
- Take each matrix row dot product with the vector.
- Place each result into the corresponding output entry.
- Interpret the output as a transformed vector or collection of linear combinations.
Common Errors
Adding Matrices of Different Dimensions
Matrix addition requires identical dimensions.
Multiplying Matrices Entrywise
Ordinary matrix multiplication uses row-column products, not corresponding-entry products.
Checking the Wrong Dimensions
For \(AB\), compare the columns of \(A\) with the rows of \(B\).
Predicting the Wrong Product Dimensions
The result uses the outer dimensions.
Assuming \(AB=BA\)
Matrix multiplication is generally not commutative.
Assuming \(BA\) Exists Whenever \(AB\) Exists
The reverse product may have incompatible dimensions.
Forgetting All Terms in a Row-Column Product
Every corresponding pair must be multiplied and included in the sum.
Squaring Entries Instead of Multiplying the Matrix by Itself
\(A^2\) means \(AA\).
Ignoring Units
In applied matrix products, row-column combinations should have meaningful units.
Changing Matrix Order During Composition
In \(AB\mathbf{x}\), the rightmost transformation acts first.
Practice
1. Matrix Addition
Compute
\[ \begin{bmatrix} 1 & 2\\ 3 & 4 \end{bmatrix} + \begin{bmatrix} 5 & 6\\ 7 & 8 \end{bmatrix}. \]Check Answer
\[ \boxed{ \begin{bmatrix} 6 & 8\\ 10 & 12 \end{bmatrix} }. \]2. Matrix Subtraction
Compute
\[ \begin{bmatrix} 7 & 5\\ 4 & 9 \end{bmatrix} - \begin{bmatrix} 2 & 3\\ 1 & 6 \end{bmatrix}. \]Check Answer
\[ \boxed{ \begin{bmatrix} 5 & 2\\ 3 & 3 \end{bmatrix} }. \]3. Scalar Multiplication
Compute
\[ -2 \begin{bmatrix} 3 & -1\\ 4 & 5 \end{bmatrix}. \]Check Answer
\[ \boxed{ \begin{bmatrix} -6 & 2\\ -8 & -10 \end{bmatrix} }. \]4. Check Multiplication Compatibility
If \(A\) is \(3\times4\) and \(B\) is \(4\times2\), is \(AB\) defined? If so, what are its dimensions?
Check Answer
Yes. The inner dimensions match:
\[ 4=4. \]The result has dimensions
\[ \boxed{3\times2}. \]5. Undefined Product
If \(A\) is \(2\times3\) and \(B\) is \(4\times2\), is \(AB\) defined?
Check Answer
No.
The inner dimensions are
\[ 3 \]and
\[ 4, \]which do not match.
6. Two-by-Two Product
Compute
\[ \begin{bmatrix} 1 & 2\\ 0 & 1 \end{bmatrix} \begin{bmatrix} 3 & 4\\ 5 & 6 \end{bmatrix}. \]Check Answer
\[ \boxed{ \begin{bmatrix} 13 & 16\\ 5 & 6 \end{bmatrix} }. \]7. Matrix–Vector Product
Compute
\[ \begin{bmatrix} 2 & 3\\ 4 & -1 \end{bmatrix} \begin{bmatrix} 1\\ 2 \end{bmatrix}. \]Check Answer
\[ \begin{bmatrix} 2(1)+3(2)\\ 4(1)-1(2) \end{bmatrix} = \boxed{ \begin{bmatrix} 8\\ 2 \end{bmatrix} }. \]8. Noncommutativity
Is it always true that
\[ AB=BA? \]Check Answer
\[ \boxed{\text{No.}} \]Matrix multiplication is generally not commutative.
9. Identity Matrix
What is
\[ I_2 \begin{bmatrix} 4 & 1\\ 2 & 3 \end{bmatrix}? \]Check Answer
\[ \boxed{ \begin{bmatrix} 4 & 1\\ 2 & 3 \end{bmatrix} }. \]10. Matrix Square
Compute
\[ A^2 \]for
\[ A= \begin{bmatrix} 1 & 1\\ 0 & 1 \end{bmatrix}. \]Check Answer
\[ A^2= AA= \boxed{ \begin{bmatrix} 1 & 2\\ 0 & 1 \end{bmatrix} }. \]11. Data Matrix Product
Suppose
\[ Q= \begin{bmatrix} 2 & 3\\ 4 & 1 \end{bmatrix} \]and
\[ \mathbf{p}= \begin{bmatrix} 10\\ 5 \end{bmatrix}. \]Compute \(Q\mathbf{p}\).
Check Answer
\[ Q\mathbf{p} = \begin{bmatrix} 2(10)+3(5)\\ 4(10)+1(5) \end{bmatrix} = \boxed{ \begin{bmatrix} 35\\ 45 \end{bmatrix} }. \]12. Product Dimensions
If
\[ A \]is \(5\times2\) and
\[ B \]is \(2\times7\), what are the dimensions of \(AB\)?
Check Answer
\[ \boxed{5\times7}. \]Key Ideas
- Matrix addition and subtraction are performed entry by entry.
- Matrices must have identical dimensions to be added or subtracted.
- Scalar multiplication multiplies every entry by the scalar.
- Matrix multiplication is based on row-column products, not entrywise multiplication.
- If \(A\) is \(m\times n\) and \(B\) is \(n\times p\), then \(AB\) is \(m\times p\).
- The inner dimensions determine compatibility; the outer dimensions determine product shape.
- Matrix–vector multiplication produces linear combinations of columns and dot products with rows.
- The equation \(A\mathbf{x}=\mathbf{b}\) compactly represents a linear system.
- Matrix multiplication represents composition of linear transformations.
- Matrix multiplication is associative and distributive.
- Matrix multiplication is generally not commutative.
- The identity matrix acts as the multiplicative identity.
- Matrix powers use repeated matrix multiplication and therefore require square matrices.
- Applied matrix multiplication can compute weighted sums, costs, transitions, and multi-stage processes.
- Dimension checks should come before arithmetic.
Where This Leads
Matrix arithmetic turns matrices from passive containers into active algebraic objects. Addition combines compatible structures, scalar multiplication rescales them, and matrix multiplication composes linear relationships in a way that preserves row-column meaning.
From here, the section can develop matrix equations, identity and inverse matrices, determinants, invertibility, powers, transformations, and rank. Matrix multiplication will also become essential in geometry, recurrence systems, computer graphics, statistics, numerical methods, and later linear algebra.