Loading…
Learn when matrix products are defined, how the row-by-column rule and identity matrices work, and how multiplication encodes linear systems.
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.
Return to the current explanation and board
Definition 3.2.1
(When a matrix product is defined)
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 3.2.2
(Matrix multiplication)
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:
Return to the step-by-step calculation
Worked example 3.2.3
(Compute a product carefully)
Let
Then is defined because both matrices are . Its entries are:
So
Return to the selected entry on the board
Work through a matrix product
C = AB. Match one complete row of A with one column of B, multiply matched entries, then add. Indices start at 1.
Checking the learning account…
Follow one entry on the board, then construct a different product yourself. C = AB; indices start at 1.
Target entry: · Row 2, Column 1
Both inner dimensions are 2, so AB is defined. The outer dimensions give a 2 × 2 result.
Load replaces the current calculation; Save replaces account progress.
Check account progress to load or save.
Save includes the current entries and help markers.
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 .
Follow how row-by-column multiplication turns Ax = b into a complete system, one row equation at a time.
Match the sizes
A 2 x 3 matrix can multiply a 3 x 1 vector because each row of A has exactly three entries to pair with x.
Read row 1
The first output entry is the first row of A paired with x: a11*x1 + a12*x2 + a13*x3.
Set it equal to b1
When Ax = b, that first output entry becomes the first equation of the system.
Read row 2
The second row gives the second equation: a21*x1 + a22*x2 + a23*x3 = b2.
Stack the equations
Ax = b is the vertical stack of all row equations, written as one matrix equation.
Extend to AB
If B = [u v], then AB = [Au Av]. A general product is several Ax-style products side by side.
The row-by-column rule is why one compact equation, Ax = b, can store an entire linear system. Each row of A supplies one equation; a full product AB repeats the same idea once for every column of B.
Definition 3.2.4
(Identity matrix)
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 3.2.5
(Why multiplying by the identity changes nothing)
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.
Follow one matrix product entry form from a row-column sum, then see why multiplying by an identity matrix preserves rows and columns.
Size gate
A 2 x 3 matrix can multiply a 3 x 2 matrix because the inner sizes match. The outer sizes make AB a 2 x 2 matrix.
One entry
The top-left output entry uses row 1 of A and column 1 of B: c11 = 1*4 + 2*5 + (-1)*6 = 8.
Whole product
Repeat the row-column rule for every output cell. The product is not built by multiplying corresponding positions.
Right identity
In A I_n = A, the columns of I_n select the columns of A, so right multiplication by the identity preserves A.
Left identity
In I_m A = A, the rows of I_m select the rows of A, so left multiplication by the identity also preserves A.
Order warning
Identity matrices are special. In general AB and BA ask different row-column questions and need not be equal.
A matrix product is defined by compatible inner sizes. Each output entry is a row-column sum, and identity matrices preserve compatible matrices because their rows and columns select the original rows and columns.
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.
Read one entry of AB
Select an output cell. Its row in A has a solid outline; its column in B has a dashed outline. Edit either input matrix to recompute the same inner product.
| 1 | 2 |
| 0 | 1 |
| 2 | 1 |
| 3 | 4 |
| 8 | 9 |
| 3 | 4 |
Holds: The selected entry equals its row–column inner product
8 = 1×2 + 2×3
NoticeMultiply matching positions, then add. Matrix multiplication is not entrywise multiplication. The outlines and row/column labels have the same meaning in every theme.
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 3.2.6
(One product read column by column)
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 3.2.7
(Associativity matches repeated composition)
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 3.2.8
(Grouping may change, but order may not)
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 3.2.9
(A matrix is determined by its action on vectors)
Let and be matrices. If
then .
Proof
(Proof using the standard basis)
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 3.2.10
(Recover unknowns from a partially known product)
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 3.2.11
(Expand products without pretending matrices commute)
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 3.2.12
(A zero product does not force a zero factor)
Let
Neither factor is the zero matrix, yet
So matrix multiplication behaves differently from real-number multiplication: does not imply or .
Theorem 3.2.13
(The identity matrix is unique)
If is an matrix such that
for every compatible matrix , then .
Proof
(Why no second identity matrix can exist)
Take . Then the defining property of gives . But right-multiplying any matrix by leaves it unchanged, so . Therefore .
Common mistake
(Matrix multiplication is not entrywise multiplication)
The entry is not . It is built from the whole th row of and the whole th column of .
Common mistake
(Defined products can still appear in only one order)
If is and is , then is defined but is not. Never assume the reverse order makes sense automatically.
Common mistake
(Column language belongs to the right-hand factor)
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
(Binomial formulas need commutation hypotheses)
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 .
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.
Proof X-ray
Each law is proved the same way: write one output entry as a finite sum and rearrange it with the rules of real arithmetic. For associativity, both sides are the double sum of the products over all and ; they differ only in which sum is taken first, which is harmless because both sums are finite. The size hypotheses guarantee that every entry exists. Commutativity of real numbers enters only when the scalar moves past ; it never yields , because swapping the two factors changes which entries are multiplied together.
Quick check
(If is and is , what is the size of ?)
Use the inner dimensions to test whether the product is defined, then read the outer dimensions.
is defined and has size .
Quick check
(What does multiplying by do to a compatible matrix?)
Answer in one sentence.
It leaves the matrix unchanged.
Quick check
(If the columns of are and , how should you read the columns of ?)
Use the column interpretation of matrix multiplication.
The columns of are and .
Quick check
(In , what is the coefficient of after expansion?)
Keep and as different terms.
The coefficient of is , because the term comes from .
Quick check
(Why does represent several equations at once?)
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.
Quick check
(Why does always have at least one solution, no matter what is?)
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.
Quick check
(Explain why may be undefined even when is defined.)
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.
Quick check
(Let and be the matrices from the worked example with unknowns. If the first column of is , find and .)
Use only the equations coming from the first column.
The first column of gives
So
Subtracting gives , and substituting into gives .
Quick check
(Write the first entry of when the first row of is and .)
Use the row-by-column rule.
The first entry is .
All matrices and scalar parameters are real. Matrix dimensions are positive integers; denotes the zero matrix of the compatible size.
Exercise 3.2.14
(Find (a) and (b), assuming , the values of when for the matrices below.)
Core
Compute , then compare corresponding entries of .
Compute the row-by-column product
Because: The definition of matrix multiplication.
Compare corresponding entries
Key step
The first row gives identities. The other positions give
Because: Equality of matrices of the same size is entrywise.
Use the nonzero assumption
Substitute and verify the values
Substitution gives and . These values reproduce every entry of .
Exercise 3.2.15
(Compute and for the column and row below, and state the size of each result.)
Foundation
Check the inner dimensions in each order before multiplying.
Determine both product sizes
has size and has size . Thus is , while is .
Multiply the column by the row
Each output entry is .
Compute the scalar-sized reverse product
The only entry of is the row-column dot product; the two answers have different sizes.
Exercise 3.2.16
(Compute and independently for the matrices below.)
Foundation
Compute and first; both final products have size .
Compute the intermediate products
Because: The row-by-column rule gives sizes and , respectively.
Multiply the left grouping
Multiply the right grouping
Compare the results entry by entry
Exercise 3.2.17
(Find such that the matrices below satisfy .)
Core
The first column determines ; the second then determines .
Compute the symbolic product
Use the first column equations
Key step
Because: Subtract the first simplified equation from the second.
Determine the second column and check
Substituting gives and . The product equals in all four positions.
Exercise 3.2.18
(For the matrices below, (a) decide whether , (b) compute and , and (c) decide whether . Justify both decisions.)
Core
Compare one entry of , then inspect the columns of .
Disprove equality of the factors
Compute both products
Because: For example, ; compute the other entries in the same way.
Check the shared null direction
Key step
Because: Every column of is this same vector.
Conclude why cancellation fails
Thus , so equal left products do not force equal right factors.
Exercise 3.2.19
(Find coefficients that make the following identity valid for all square matrices of the same size.)
Foundation
Distribute without interchanging any factors.
Distribute over both sums
Keep the two mixed products separate
Key step
Because: In general , so their coefficients cannot be combined.
Read off a valid coefficient tuple
Exercise 3.2.20
(Verify for the lower triangular matrix below.)
SynthesisProof
Multiply the first two factors and locate the rows that may still be nonzero.
Multiply the first two factors
Write the remaining factor
Because: Only the last row of the full product can be nonzero.
Cancel the last row entries
Key step
Because: Use ; no division is used.
Conclude the full product is zero
All three rows are zero. The argument also holds when diagonal entries coincide.
Exercise 3.2.21
((a) Compute for the symmetric matrix and vector below. (b) Express each of the four equations as with symmetric .)
Synthesis
Each symmetric off-diagonal entry contributes twice to the polynomial.
Multiply by the column first
Multiply by the row and collect terms
Key step
Match the first two equations
Because: Move all terms to the left; halve coefficients assigned to symmetric off-diagonal entries.
Match the remaining equations
State and check the four representations
Substitution into the expansion reproduces (i)–(iv), respectively.
Exercise 3.2.22
(Compute for the displayed matrices. Then let be any all-ones matrix and the cyclic matrix defined below. Prove and determine .)
Core
For a fixed column of , inspect which integers occur in its entries.
Compute the numerical product
Because: Each column sum is .
Identify every cyclic column sum
Key step
For fixed , the residues , for , run through exactly once. Each column therefore contains once.
Evaluate an arbitrary product entry
Because: Pair the sum with its reverse ordering to get twice the sum equal to .
Identify the scalar multiple
Every entry of is , so the entry calculation proves the matrix identity; (a) is the case .
Exercise 3.2.23
(For the matrices below, decide and justify whether each identity holds: (a) ; (b) .)
Core
Compute , the powers of each factor, and directly.
Compute the needed products
Test the square identity
Because: The upper-right entries differ.
Test the cube identity
Key step
Because: The diagonal entries of are and , each unchanged by cubing.
State the two decisions
(a) is false; (b) is true for these specific matrices. This does not assert a binomial identity for arbitrary noncommuting matrices.
Exercise 3.2.24
(Prove that if rows and of are identical, then the same rows of are identical, with the dimensions below.)
CoreProof
Pair the two equal rows with one arbitrary column of .
Fix an arbitrary output column
Substitute the equal input entries
Because: The hypothesis applies to every inner index .
Conclude equality of the output rows
Every column position agrees. Hence row of equals row .
Exercise 3.2.25
(Let and be the sums of the columns of and , respectively. (a) Prove implies . (b) Decide whether the converse holds, giving a proof or a counterexample.)
Core
Multiply and by an all-ones column. Equal sums need not determine the individual columns.
Express both sums as products
Prove the forward implication
Key step
Because: Use associativity and the hypothesis .
Construct compatible counterexample matrices
Check the hypothesis and reject the converse
The column sums are both zero, but the individual columns differ. Therefore (a) holds and (b) is false.
Exercise 3.2.26
(Assume for the matrices below. (a) Prove the four entry equations displayed below. (b) If also , prove the stated alternatives for .)
SynthesisProof
First compare entries of and . Under , split into cases using .
Compute the ordinary matrix product
Compare the four entries with
Subtract and from the diagonal equations. These conditions explain why ordinary multiplication generally differs from multiplying corresponding entries.
Impose equality of the two factors
Separate all zero and nonzero cases
Key step
Since over , either , or , or . In the second case divide by ; in the third divide by .
Conclude the required alternatives
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.
Work out your answer, then check it. You can revise and try again.
Loading…