Loading…
Treat the basic matrix operations as entry-by-entry rules, and learn exactly when the operations make sense.
A matrix records quantities in named row-and-column positions. For example, rows may represent products and columns may represent months. Adding two such tables is meaningful only when the positions describe the same kind of data. Algebra expresses that requirement by insisting that the matrices have exactly the same size and that their entries are scalars from a common field.
Once those conditions are fixed, the operations are entrywise:
Concept lensStructural
In an entrywise operation, the output at position uses only the input entries at that same position. This explains both the same-size requirement and why the output retains that size: every position has a corresponding position in each input. A proof can therefore fix one arbitrary position and use ordinary scalar algebra there.
Matrix multiplication will use a different rule: an output entry combines a whole row of one matrix with a whole column of the other. Two matrices can be added, but their matrix product is undefined. The shape check must follow the particular operation; two matrices being acceptable inputs for addition says nothing by itself about their suitability for multiplication.
Definition 3.1.1
(Matrix equality)
Let and . The equation means both that and have the same size and that
for every permitted row index and column index . Matching a few entries is not enough; equality is an entry-by-entry statement over the whole matrix.
Fix positive integers and a scalar field , usually in this course. Write for the set of all matrices whose entries belong to . Saying that matrices and scalars use the same field prevents an undeclared mixture of number systems. If a real matrix is to be placed in a larger number system, that common field must first be chosen.
Definition 3.1.2
(Matrix addition, subtraction, and scalar multiplication)
Suppose and are both in , and let .
Addition and subtraction are undefined when the two matrices have different sizes. Scalar multiplication always preserves the size of its matrix.
Definition 3.1.3
(Zero matrix)
The zero matrix in , denoted here by , is the matrix whose every entry is zero. Its size is part of its identity: a zero matrix and a zero matrix are different objects.
The notation makes the entrywise rules compact. If and , then
These three formulas also provide a reliable equality test: to prove two matrix expressions equal, verify that they have the same size and then compare their arbitrary entries.
The three operations are often used together. If belong to and belong to , then
is called a linear combination of and . Its entry is , and its size is still . The conclusion that the result remains in is called closure. Closure is not merely a vocabulary item: it assures us that a calculation made from allowed objects does not suddenly leave the collection we are studying.
Several familiar expressions are special linear combinations. The difference uses coefficients and ; over , an average such as uses coefficients that sum to one; and can be written as . The coefficients may be positive, negative, or zero. “Scaling” therefore does not always mean making entries physically larger: a negative coefficient also reverses signs, and the coefficient zero collapses every entry to zero.
The same-size condition still governs the entire expression. If is and is , then is undefined even though and are individually defined. Scalar multiplication cannot repair a dimension mismatch. Likewise, the scalars and matrix entries must be read in the chosen common field so that every scalar product and sum has an agreed meaning.
Theorem 3.1.4
(Laws of matrix addition)
Let . Then
and
Therefore matrices of one fixed size over one fixed field are closed under addition and form a commutative additive system with a unique zero matrix and a unique additive inverse for each matrix.
Theorem 3.1.5
(Laws of scalar multiplication)
Let and let . Then
Consequently,
The two distributive laws are different: the first distributes one scalar over a matrix sum, whereas the second distributes a sum of scalars over one matrix.
Every law above follows from the corresponding scalar law, but a matrix proof must explicitly pass through its entries. First note that both sides of each identity are matrices. Fix an arbitrary position .
For associativity of addition,
The middle equality is associativity in . Because this holds at every position, matrix equality gives .
For distribution of a scalar over a matrix sum,
Likewise,
and
Commutativity, the zero law, the inverse law, and follow by replacing the arbitrary entry with the matching scalar identity. This is a reusable proof method: same size plus equality of every arbitrary entry proves equality of matrices.
The two theorems let us derive useful rules instead of memorizing them as new facts. Because , distribution gives
Indeed, , as can be checked at an arbitrary entry. Be careful, however: subtraction itself is generally neither commutative nor associative. Usually , and need not equal . Rewriting every subtraction as addition of an inverse reveals the correct parentheses and signs.
Addition also has a cancellation law. If belong to the same and satisfy , add to both sides. Associativity and the zero law reduce the equation to . For fixed , the equation in the unknown therefore has the unique solution . This justifies additive “moving to the other side”; it is shorthand for applying the same permitted operation to both sides.
Scalar cancellation needs a condition that additive cancellation does not. If and , multiplication by the scalar gives . If , both sides equal for every pair , so no equality between the original matrices follows. Similarly, implies only when is nonzero. Stating this hypothesis prevents a common logical error.
Finally, over , a matrix equation is really a system of scalar equations in matching positions. If and , then every entry satisfies . Solving these scalar equations simultaneously yields . The compact matrix manipulation and the entrywise method are not rival techniques; they are two descriptions of exactly the same reasoning.
Addition, subtraction, and scalar multiplication change entries while preserving the row-and-column positions and matrix size.
Follow same-size compatibility, entrywise addition, scalar scaling, subtraction by additive inverse, and the zero-matrix identity move in one short sequence.
Same-size gate
A + B and A - B require A and B to have the same m x n size, so every entry has a corresponding partner.
Entrywise addition
The output entry at position (i,j) is built from the two input entries in that same position: [A+B]_{ij}=a_{ij}+b_{ij}.
Scalar multiplication
A scalar multiplies every entry of A. The entries change, but the result is still an m x n matrix.
Subtraction via inverse
Subtraction is defined as A - B = A + (-B), so it uses the same size rule as addition.
Zero and inverse
The zero matrix O and the additive inverse -A must have the same size as A, so A+O=A and A+(-A)=O are well-defined.
Entrywise laws
The familiar algebraic laws are proved by checking the (i,j)-entry on both sides of the proposed matrix equality.
For addition and subtraction, the size match is part of the definition. For scalar multiplication, one scalar reaches every entry while the matrix shape stays fixed.
The live block below lets you switch among , , and . Before reading its output, predict one selected entry and the size of the result. No matter which operation you choose, the output keeps the same size as the input matrix or matrices.
Read entrywise matrix operations
Change c. Compare each output with A: muted cells have a different value from the corresponding entry in A.
| 1 | −2 |
| 3 | 0 |
| 4 | 1 |
| −1 | 2 |
| 5 | −1 |
| 2 | 2 |
| −3 | −3 |
| 4 | −2 |
| 2 | −4 |
| 6 | 0 |
Holds: Each operation preserves the matrix size
Addition and subtraction combine corresponding entries. Scalar multiplication applies the same c to every entry, including zero and negative entries.
NoticeMatrices must have the same dimensions for addition and subtraction. Changing c affects cA only; c=0 produces the zero matrix.
Worked example 3.1.6
(A rectangular numerical calculation)
Let
Both matrices are over , so their sum and difference are defined. Keeping the layout visible gives
and
Finally,
All three results remain ; the scalar changes signs and magnitudes, not dimensions.
Worked example 3.1.7
(Solve a matrix equation entrywise)
Suppose the matrices have real entries and
where
Matrix algebra permits the same additive rearrangement as scalar algebra:
Now compute rather than treating the fraction as “matrix division”:
so
Verification is part of the solution:
Worked example 3.1.8
(Verify a distributive law numerically)
Take
The left-hand side of is
The right-hand side is
One example does not prove the theorem, but it checks the arithmetic and shows how the general entrywise proof manifests in a concrete case.
If is the zero matrix of the same size as , then . This matters later because the vector space of matrices needs an additive identity. That identity depends on the size: a zero matrix cannot replace a zero matrix in an equality or addition.
The equation also has exactly one solution, namely . To see uniqueness, add to both sides and use associativity. Thus the zero matrix and additive inverse are structural objects, not merely convenient notation.
Common mistake
(Checking entries but forgetting dimensions)
The expressions and require equal numbers of rows and equal numbers of columns. Having the same total number of entries is insufficient: a matrix cannot be added to a matrix.
Common mistake
(Applying a scalar to only part of a matrix)
In , the scalar multiplies every entry, including zeros and negative entries. For example, ; losing this sign is a common arithmetic error.
Common mistake
(Treating a scalar as a matrix addend)
In this course, an expression such as is not defined. Do not add to every entry or only to diagonal entries unless a separate convention has been explicitly introduced.
Common mistake
(Calling scalar multiplication matrix division)
The step from to is multiplication by the scalar . It does not assert that division by a matrix is available.
Quick check
(Why is matrix addition only defined for matrices of the same size?)
Answer in one sentence using the phrase “corresponding entries.”
Matrix addition is entrywise, so each entry of one matrix must have a corresponding entry in the other matrix; this requires equal row and column counts.
Quick check
(If is a matrix, what is the size of ?)
Focus on shape, not on the signs of the entries.
is still a matrix because multiplication by changes every entry but does not change the number of rows or columns.
Quick check
(Let be and be . Which of , , and are defined?)
State each one separately.
is undefined because the sizes do not match. is undefined for the same reason. is defined and is because scalar multiplication needs only one matrix and one scalar.
Quick check
(Compute for and .)
Write first, and then subtract corresponding entries.
Both matrices are , so the expression is defined. We obtain
and hence
Quick check
(Solve when and .)
Isolate , compute it, and check one entry of the original equation.
Subtract from both sides:
For example, the entry checks as , matching the entry of ; computing the other three entries gives the full equality.
Quick check
(Why is the zero matrix called the additive identity?)
Use the equation that expresses its identity role and state the size condition.
For every , the zero matrix satisfies . The matrices must have the same size so that the additions are defined.
Read 2.1 Matrix basics first if you want a slower introduction to rows, columns, entries, and matrix size.
Read 3.2 Matrix multiplication, identity matrices, and linear systems next to study the first matrix operation that is not entrywise.
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.
Write out (a) A, (b) B, (c) C, (d) D, (e) E. (f) Find numbers p,q such that pC=A+qD, if possible.
Each displayed row follows by fixing i and varying j. The integers i−j and i+j have the same parity. At odd positions the required equality gives 0=1−q, so q=1. At even positions it gives p=1+q=2; these values verify every 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.
Write out (a) B and (b) C in terms of the entries of A.
For B, 6−j reverses the column order while i stays fixed. For C, 6−i also reverses the row order. Substitution into each of the 25 positions proves both displays.
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 directly from definitions or established results: (a) −(A+B)=−A−B. (b) If A+C=B+C, then A=B.
Both statements follow entrywise from the corresponding real-number laws. In (a), equality at every entry proves matrix equality. In (b), subtract cᵢⱼ from both sides for each i,j; equality of all entries gives 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.
Use mathematical induction to prove nA is the sum of n copies of A.
The base case is n=1. Assume the assertion for k≥1. Scalar distributivity gives (k+1)A=kA+A; the induction hypothesis gives the displayed sum with k+1 terms. Thus the assertion holds for every positive integer n.
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.
Determine all possible X in terms of A,B.
Every step is reversible under entrywise addition and multiplication by a nonzero real scalar. Therefore the displayed matrix is both a solution and the unique solution. Substituting it into the two sides gives 15A/4+45B/8 on each side.
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 all 3×3 matrices X satisfying the equation.
Subtracting X and adding 2B gives a necessary and sufficient equation, so this is the unique solution. Substitution gives X+A=2A+2B=2(X−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.
Show the displayed factorization holds for appropriate numbers p,q,r and name them explicitly.
Subtract each pair of corresponding entries. Both resulting rows are the same. Multiplying the displayed column by the displayed row reproduces both rows. The choices work even when q or r is zero.