Loading…
Loading…
Learn when matrix products are defined, how the row-by-column rule and identity matrices work, and how multiplication encodes linear systems.
Let be positive integers, let , , and . All the following arguments use the row-by-column definition and finite real sums. For any output position ,
The middle equality only reorders two finite sums and uses real distributivity. Both products are , so equality at every position proves associativity. No factor has changed its order.
For , the same definition gives
For , it gives
Thus both distributive laws hold with the displayed matching sizes. For every real scalar ,
proving by entrywise equality. In particular, for and real ,
This proves the matrix-vector linearity used when comparing solutions of the same linear system. All identities concern compatible finite real matrices; they do not assert commutativity or cancellation of arbitrary matrix factors.
Matrix multiplication records the combined effect of two successive linear calculations. Its row-by-column rule comes from substituting the output of the first calculation into the second.
Addition and scalar multiplication act entry by entry. Matrix multiplication is different. To compute one output entry, you compare one row of the left matrix with one column of the right matrix.
That is why dimensions matter so strictly.
There is also a structural reason for this dimension rule. An matrix sends a vector with entries to one with entries, and an matrix can then accept that output and send it to a vector with entries. Thus followed by has the size , exactly the size of . The matching inner dimension is the space through which the two actions connect; the outer dimensions record the input and output of the combined action.
For a concrete example, first form and , then form and . Substitution gives
Each coefficient combines a row of the second calculation with a column of the first. Writing those coefficient arrays as and , respectively, the array for the combined calculation is : the rightmost factor acts first.
Open the guided matrix walkthrough in MATH1030
Definition
If is an matrix and is an matrix, then the product is defined and is an matrix.
If the number of columns of does not equal the number of rows of , then the product is undefined.
The inner dimensions must match. The outer dimensions tell you the size of the result.
Definition
Suppose is an matrix and is an matrix.
Then the entry of is
So each output entry is the dot-product-style combination of row of with column of .
This rule explains three important facts at once:
Open the guided matrix walkthrough in MATH1030
Worked example
Let
Then is defined because both matrices are . Its entries are:
So
Open the guided matrix walkthrough in MATH1030
If is a column vector, then is a special case of matrix multiplication. It packages the left-hand sides of a linear system into one object.
For
we have
So the system is not merely shorthand. It is a matrix product whose entries reproduce the equations of the system.
Each row of supplies the coefficients of one equation in .
Definition
For each positive integer , the identity matrix is the square matrix with on the main diagonal and everywhere else.
For example,
The identity matrix matters because it preserves any compatible matrix:
whenever the sizes match.
Worked example
Let
Then
The first column of reproduces the first column of , and the second column reproduces the second column of .
That is exactly why inverse matrices are defined through the identity later: if exists, then .
An entry of combines one row and one column. Identity multiplication preserves each compatible row or column.
In general,
Sometimes both products are defined and differ. Sometimes one product is defined and the other is not. So order matters twice: it matters for meaning, and it matters for the final answer.
Counterexample mode
The claim “two square matrices of the same size always satisfy ” is false even though both products exist and have the same size. Take
Both are real matrices, so the hypothesis is satisfied. Direct row-by-column multiplication gives
For example, , whereas . One unequal corresponding entry is enough to prove . The failure has a structural explanation: multiplying this on the right keeps the second column and zeros the first, while multiplying it on the left keeps the second row and zeros the first.
A valid replacement is: a square matrix commutes with every scalar multiple of the identity of the same size. Indeed, if , then . For arbitrary square matrices, commutativity needs its own justification; matching dimensions guarantees that multiplication is defined, not that factors can be interchanged.
Use the figure below to watch one output entry being built from a selected row and a selected column.
The row-by-column rule is the standard local computation rule, but it is not the only useful interpretation.
Write the columns of as
Then the product can be read as
So each column of is obtained by applying to the corresponding column of .
Worked example
Let
If
then
Therefore
This is the same answer as the entrywise row-by-column computation. The point is that matrix multiplication packages several matrix-vector products together.
The multiplication rule is not arbitrary. It is the rule that makes matrices encode linear transformations in sequence.
If a vector is first sent to , and then that result is sent to , the combined effect is
That is why the inner dimensions must match. The output of the first map must be a valid input for the second one.
Theorem
Whenever the products are defined,
So we may regroup a chain of matrix products without changing the final linear transformation.
This does not mean that order may be changed. Associativity lets us change parentheses, not the order of the factors themselves.
Worked example
Suppose is , is , and is .
Then both and are defined, so both and make sense, and associativity says they are equal. More explicitly, is , so is ; meanwhile, is , so is also .
But is not defined at all, because the inner dimensions and do not match. So matrix multiplication is associative, but not commutative.
The standard basis vectors make the column interpretation precise. In , the vector has a in position and everywhere else. If is an matrix, then is exactly the th column of .
This is why the identity matrix behaves so naturally. The columns of are , so right-multiplying by simply reproduces the columns of one by one.
This also explains why a compatible zero matrix on the right forces the product to be zero: every column of the zero matrix is the zero vector, so every column of the product is .
Theorem
Let and be matrices. If
then .
Proof
For each , substitute the standard basis vector into the hypothesis. This gives . But is the th column of , and is the th column of . Hence the two matrices have the same th column for every . All their columns, and therefore all their entries, are equal, so .
The words "for every " are essential. Two different matrices can agree on one particular vector—for example, both send the zero vector to zero. The proof also shows something sharper: it is enough to check the standard basis vectors, because their images reveal the columns one at a time.
Once multiplication is defined, the next issue is how it interacts with the other matrix operations you already know.
Whenever the sizes are compatible, matrix multiplication satisfies:
and scalar multiplication may be moved in or out:
The zero matrix is the simplest sanity check for these rules. If is a compatible zero matrix, then
The reason is that every row-by-column product uses only zero entries from the zero matrix, so every output entry is zero as well.
These identities are basic, but they matter because later arguments about inverse matrices, row operations, and block-matrix computation assume them silently. If you do not know them explicitly, longer calculations become much harder to audit.
A product with unknown entries brings three ideas together: compatible dimensions, the row and column that determine each output entry, and the order of the factors. Use those structural facts before solving the resulting scalar equations.
Worked example
Let
Suppose
The product is defined because is and is , so must be . Computing only the entries we need gives
Comparing the first column with the given matrix gives
Thus
Subtracting the first equation from the second gives , and then . The remaining entries are
This kind of problem is not really about multiplying every entry in sight. It is about extracting the few equations that the known product entries force.
Worked example
Let and be square matrices of the same size. Then
Now distribute on the right:
The middle terms are and . They cannot be combined into unless you already know that .
The same warning explains a common false shortcut:
This equals only under the extra condition . Real-number algebra hides this issue because real-number multiplication is commutative. Matrix algebra does not.
Worked example
Let
Neither factor is the zero matrix, yet
So matrix multiplication behaves differently from real-number multiplication: does not imply or .
Theorem
If is an matrix such that
for every compatible matrix , then .
Proof
Take . Then the defining property of gives . But right-multiplying any matrix by leaves it unchanged, so . Therefore .
Common mistake
The entry is not . It is built from the whole th row of and the whole th column of .
Common mistake
If is and is , then is defined but is not. Never assume the reverse order makes sense automatically.
Common mistake
If , then . The columns of the product are linear combinations of the columns of , using weights from the corresponding columns of . Do not write ; that expression does not match the definition of matrix multiplication.
Common mistake
The formula is not automatic for matrices. The actual expansion is
You may combine the middle terms only when .
For of size and of size , the product has size ; incompatible inner dimensions make the product undefined. Each entry comes from one row of and one column of , while the column formula reads the same operation as several matrix-vector products. In particular, packages a linear system.
Identity matrices preserve compatible matrices. Matrix multiplication is associative and distributive, but associativity only changes parentheses: it does not justify changing the order of factors, and in general . Finally, the identities show that the action of a matrix on the standard basis determines every column. Consequently, if for every vector in , then .
Checkpoint
Use the inner dimensions to test whether the product is defined, then read the outer dimensions.
is defined and has size .
Checkpoint
Answer in one sentence.
It leaves the matrix unchanged.
Checkpoint
Use the column interpretation of matrix multiplication.
The columns of are and .
Checkpoint
Keep and as different terms.
The coefficient of is , because the term comes from .
Checkpoint
Use the word "rows" in your answer.
Each row of produces one equation when it is paired with the column vector , so the product packages all those row equations together.
Checkpoint
Think of as a column vector.
Take the zero vector . Every entry of is a linear combination of the entries of , so every entry is . Hence , and the homogeneous system always has the trivial solution.
Checkpoint
Answer in terms of the inner dimensions, not just by giving one example.
For to be defined, the number of columns of must equal the number of rows of . For to be defined, the number of columns of must equal the number of rows of . These are different conditions, so one order may be legal while the reverse order is not.
Checkpoint
Use only the equations coming from the first column.
The first column of gives
So
Subtracting gives , and substituting into gives .
Checkpoint
Use the row-by-column rule.
The first entry is .
This note depends on 2.1 Matrix basics. Continue to 3.3 Transpose, symmetric, and skew-symmetric matrices or jump ahead to 5.1 Invertible matrices.