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 .
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 .
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.
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.
All matrices and unspecified scalar parameters in this solution are over the real numbers. Matrix dimensions are positive integers; O denotes the zero matrix of the displayed compatible size.
The parameters are real. (a) Find b. (b) Write every simplified entry equation explicitly involving a,c,d but not b. (c) Assuming a≠0, find a,c,d.
The displayed product uses the row-by-column rule. Its two first-row equations are identities, and its remaining entries give exactly the listed equations and b=8. Since a≠0, a(a+2)=0 gives a=−2; substitution gives c=4 and d=−13. These values reproduce C in every position.
All matrices and unspecified scalar parameters in this solution are over the real numbers. Matrix dimensions are positive integers; O denotes the zero matrix of the displayed compatible size.
Compute AB and BA.
AB has size 4×4 and entry ij equal to i·j. BA has size 1×1, with its sole entry the dot product of the row and column. The different sizes are part of the answer.
All matrices and unspecified scalar parameters in this solution are over the real numbers. Matrix dimensions are positive integers; O denotes the zero matrix of the displayed compatible size.
Compute (AB)C and A(BC).
First compute the two intermediate 3×2 and 2×3 products, then the displayed row-column sums. Both final products are 3×3 and agree entry by entry.
All matrices and unspecified scalar parameters in this solution are over the real numbers. Matrix dimensions are positive integers; O denotes the zero matrix of the displayed compatible size.
Find the real numbers a,b,c,d.
Equating the first column gives the two linear equations, whose difference yields a=−6; then b=8. The second column determines c,d. Substituting all four values gives precisely C, so there are no further conditions.
All matrices and unspecified scalar parameters in this solution are over the real numbers. Matrix dimensions are positive integers; O denotes the zero matrix of the displayed compatible size.
Justify (a) whether B=C; (b) compute AB,AC; (c) whether AB=AC.
For example the first entry of AB is 1·2+(−2)(−2)+1·3=9, and the same row-column rule gives all displayed entries. As an independent check, every column of C−B is (1,1,1)ᵀ, annihilated by A, so AC−AB=0. Thus (c) is true although (a) is false; cancellation by an arbitrary matrix is invalid.
All matrices and unspecified scalar parameters in this solution are over the real numbers. Matrix dimensions are positive integers; O denotes the zero matrix of the displayed compatible size.
Name appropriate real numbers a,b,c,d.
Apply distributivity, keeping the order of factors in each product. In general AB and BA differ, so their two coefficients remain separate. The expansion proves these coefficients work for every such A,B.
All matrices and unspecified scalar parameters in this solution are over the real numbers. Matrix dimensions are positive integers; O denotes the zero matrix of the displayed compatible size.
Verify (aI₃−A)(bI₃−A)(cI₃−A)=O₃×₃.
The first multiplication leaves only the last row potentially nonzero. In the second multiplication, (a−c)(b−c)=(c−a)(c−b), so the displayed last-row expressions cancel. The other two rows are zero already. Thus the full product is zero. No assumption that a,b,c are distinct is needed.
All matrices and unspecified scalar parameters in this solution are over the real numbers. Matrix dimensions are positive integers; O denotes the zero matrix of the displayed compatible size.
All scalars are real. (a) Compute the product. (b) Hence express each equation as a matrix expression equal to zero.
The symmetric off-diagonal entries each contribute twice. Moving all terms to the left in (b) gives the coefficients used in the four matrices. Substitution into the formula in (a) yields exactly the original four equations.
All matrices and unspecified scalar parameters in this solution are over the real numbers. Matrix dimensions are positive integers; O denotes the zero matrix of the displayed compatible size.
Assume m,n are positive integers. (a) Find AB. (b) B is the cyclic matrix with first row 1,2,…,n and each following row shifted one place left. Prove AB=αA and find α explicitly.
Each column of the cyclic matrix contains each integer from 1 to n once. To evaluate the sum, pair it with its reversed ordering: twice the sum is n(n+1). Every entry of A equals 1, so the constant product matrix is αA; part (a) is n=3.
All matrices and unspecified scalar parameters in this solution are over the real numbers. Matrix dimensions are positive integers; O denotes the zero matrix of the displayed compatible size.
Decide true or false and justify: (a) (A+B)²=A²+2AB+B²; (b) (A+B)³=A³+3A²B+3AB²+B³.
The preliminary identities follow by multiplying the displayed 2×2 matrices. In (a) the upper-right entries differ, so the claim is false. In (b), A²B=AB=0 and AB²=−AB=0. The diagonal matrix A+B has cube itself, so both sides are A+B and the claim is true. No general commutative binomial rule is being assumed.
All matrices and unspecified scalar parameters in this solution are over the real numbers. Matrix dimensions are positive integers; O denotes the zero matrix of the displayed compatible size.
Prove rows k and ℓ of AB are identical. Hint: organize multiplication using suitable row/column blocks.
The hypothesis says the two rows agree at every inner coordinate r. Each term in their products with any fixed column j of B is therefore equal. Thus every output column position agrees, which is equality of the two output rows.
All matrices and unspecified scalar parameters in this solution are over the real numbers. Matrix dimensions are positive integers; O denotes the zero matrix of the displayed compatible size.
For positive m,n,p: (a) prove AB=C implies Ax=y. Hint: relate B,x and C,y by multiplication. (b) Decide whether Ax=y implies AB=C and justify by proof or counterexample.
The all-ones column adds the columns of a matrix, giving the two identities in (a); associativity proves the implication. The dimensions in the counterexample match all hypotheses. Equal column sums lose information about the individual columns, and the explicit unequal products disprove (b).
All matrices and unspecified scalar parameters in this solution are over the real numbers. Matrix dimensions are positive integers; O denotes the zero matrix of the displayed compatible size.
All eight parameters are real. (a) Show bc′=0, ab′+bd′=bb′, ca′+dc′=cc′, cb′=0. Remark: ordinary multiplication generally differs from multiplying corresponding entries. (b) If also P=Q, prove b=c=0 or (b=0 and a+d=c) or (c=0 and a+d=b).
Equate the four entries in (a), subtracting aa′ and dd′ from the diagonal equations. For (b), substitute a′=a,b′=b,c′=c,d′=d. Since bc=0 over the real numbers, either both b,c vanish, or b=0,c≠0, or c=0,b≠0. In the second case divide c(a+d)=c² by nonzero c; in the third divide b(a+d)=b² by nonzero b. These exhaustive cases give exactly the required disjunction.
Work out your answer, then check it. You can revise and try again.
Loading…