1.4 - Matrix algebra and powers

1.4 - Matrix algebra and powers

Some familiar algebraic laws survive for matrices, while others fail because order matters. Learn to keep products in the correct order, use identity and zero matrices safely, and recognise patterns in powers of square matrices.

Order of multiplication

Can two matrices have both products defined and still give AB≠BA\mathbf{AB}\ne\mathbf{BA}? Yes: even two square matrices of the same size need not commute.

Take A=(1201)\mathbf A=\begin{pmatrix}1&2\\0&1\end{pmatrix} and B=(2003)\mathbf B=\begin{pmatrix}2&0\\0&3\end{pmatrix}. Multiplying on the left by B\mathbf B scales rows of A\mathbf A; multiplying on the right by B\mathbf B scales columns. There is no reason for those operations to give the same array.

Commuting matrices

Matrices commute when both products are defined and AB=BA\mathbf{AB}=\mathbf{BA}. Matrix multiplication is not commutative in general. Some particular pairs do commute, including a square matrix and the matching identity.

To show two matrices do not commute, one unequal corresponding entry is enough. Computing both complete products also checks the arithmetic.

Worked example 1: unequal products

Question. For the matrices above, calculate AB\mathbf{AB} and BA\mathbf{BA}.

Plan. Keep the row-column rule fixed and change which matrix supplies the rows.

AB=(1(2)+2(0)1(0)+2(3)0(2)+1(0)0(0)+1(3))=(2603)BA=(2(1)+0(0)2(2)+0(1)0(1)+3(0)0(2)+3(1))=(2403).\begin{aligned} \mathbf{AB}&=\begin{pmatrix}1(2)+2(0)&1(0)+2(3)\\0(2)+1(0)&0(0)+1(3)\end{pmatrix} =\begin{pmatrix}2&6\\0&3\end{pmatrix}\\ \mathbf{BA}&=\begin{pmatrix}2(1)+0(0)&2(2)+0(1)\\0(1)+3(0)&0(2)+3(1)\end{pmatrix} =\begin{pmatrix}2&4\\0&3\end{pmatrix}. \end{aligned}

Answer. The matrices do not commute: their top-right entries are 66 and 44.

Check. Apply each sequence to (01)\begin{pmatrix}0\\1\end{pmatrix}. First B\mathbf B, then A\mathbf A, gives (63)\begin{pmatrix}6\\3\end{pmatrix}; first A\mathbf A, then B\mathbf B, gives (43)\begin{pmatrix}4\\3\end{pmatrix}. These are the different second columns found above.

Change just the second diagonal entry of B\mathbf B from 33 to 22. The matrix becomes a scalar multiple of the identity; now both rows and columns are scaled equally.

Worked example 2: a pair that commutes

Question. Keeping A=(1201)\mathbf A=\begin{pmatrix}1&2\\0&1\end{pmatrix}, let C=(2002)\mathbf C=\begin{pmatrix}2&0\\0&2\end{pmatrix}. Show that A\mathbf A and C\mathbf C commute.

Plan. Calculate both products, recognising that C=2I\mathbf C=2\mathbf I.

AC=(2402),CA=(2402).\mathbf{AC}=\begin{pmatrix}2&4\\0&2\end{pmatrix},\qquad \mathbf{CA}=\begin{pmatrix}2&4\\0&2\end{pmatrix}.

For instance, both top-right calculations give 44, because the two diagonal scale factors are now equal.

Answer. AC=CA=2A\mathbf{AC}=\mathbf{CA}=2\mathbf A, so this pair commutes.

Check. For any column (xy)\begin{pmatrix}x\\y\end{pmatrix}, both products give (2x+4y2y)\begin{pmatrix}2x+4y\\2y\end{pmatrix}. Equality holds for every input, not just a selected one.

The first example disproves a general commutative law; the second shows why “matrices never commute” would also be false.

Watch out

(A+B)2=A2+2AB+B2(\mathbf A+\mathbf B)^2=\mathbf A^2+2\mathbf{AB}+\mathbf B^2 is generally wrong. Expansion gives A2+AB+BA+B2\mathbf A^2+\mathbf{AB}+\mathbf{BA}+\mathbf B^2; combine the middle terms only when AB=BA\mathbf{AB}=\mathbf{BA}.

Test order with another pair.

Identity and zero products

The identity behaves like the number one in a product, but a zero matrix product has a surprise: neither factor need be zero.

For any m×nm\times n matrix A\mathbf A, ImA=A=AIn\mathbf I_m\mathbf A=\mathbf A=\mathbf A\mathbf I_n. On the left, an identity row selects the matching row of A\mathbf A; on the right, an identity column selects its matching column. The identities may have different sizes when A\mathbf A is rectangular.

Matrix algebra laws

For compatible dimensions,

A(B+C)=AB+AC(A+B)C=AC+BC(AB)C=A(BC).\begin{aligned} \mathbf A(\mathbf B+\mathbf C)&=\mathbf{AB}+\mathbf{AC}\\ (\mathbf A+\mathbf B)\mathbf C&=\mathbf{AC}+\mathbf{BC}\\ (\mathbf{AB})\mathbf C&=\mathbf A(\mathbf{BC}). \end{aligned}

Multiplication distributes over addition and is associative: brackets may change, but factor order must stay fixed. Also AO=O\mathbf A\mathbf O=\mathbf O and OA=O\mathbf O\mathbf A=\mathbf O whenever the products exist. Not in the formula booklet: learn it.

For distributivity, each row-column sum distributes term by term. Associativity says that grouping successive combinations differently gives the same final combination; it does not permit swapping two factors. Addition is commutative for equal-sized matrices, because ordinary entry addition is commutative.

Worked example 3: nonzero factors, zero product

Question. Calculate AB\mathbf{AB}, where A=(1000)\mathbf A=\begin{pmatrix}1&0\\0&0\end{pmatrix} and B=(0023)\mathbf B=\begin{pmatrix}0&0\\2&3\end{pmatrix}.

Plan. Calculate the row-column products rather than applying the number rule for a zero product.

AB=(1(0)+0(2)1(0)+0(3)0(0)+0(2)0(0)+0(3))=(0000).\mathbf{AB}=\begin{pmatrix}1(0)+0(2)&1(0)+0(3)\\0(0)+0(2)&0(0)+0(3)\end{pmatrix} =\begin{pmatrix}0&0\\0&0\end{pmatrix}.

Answer. AB=O\mathbf{AB}=\mathbf O, although A≠O\mathbf A\ne\mathbf O and B≠O\mathbf B\ne\mathbf O.

Check. Every output of B\mathbf B has first coordinate zero. Multiplication by A\mathbf A keeps only the first coordinate, so it sends each such output to zero.

Now change only the second row of the right factor. The left matrix still discards that whole row's contribution.

Worked example 4: why cancellation can fail

Question. Let A=(1000)\mathbf A=\begin{pmatrix}1&0\\0&0\end{pmatrix}, B=(0023)\mathbf B=\begin{pmatrix}0&0\\2&3\end{pmatrix} and C=(0045)\mathbf C=\begin{pmatrix}0&0\\4&5\end{pmatrix}. Does AB=AC\mathbf{AB}=\mathbf{AC} imply B=C\mathbf B=\mathbf C?

Plan. Compute AC\mathbf{AC} and compare the right factors.

AC=(1(0)+0(4)1(0)+0(5)00)=O=AB.\mathbf{AC}=\begin{pmatrix}1(0)+0(4)&1(0)+0(5)\\0&0\end{pmatrix}=\mathbf O=\mathbf{AB}.

But B\mathbf B and C\mathbf C have unequal second rows.

Answer. No: AB=AC\mathbf{AB}=\mathbf{AC} here, yet B≠C\mathbf B\ne\mathbf C.

Check. Subtracting gives A(B−C)=A(00−2−2)=O\mathbf A(\mathbf B-\mathbf C)=\mathbf A\begin{pmatrix}0&0\\-2&-2\end{pmatrix}=\mathbf O, verifying the equality by a separate product.

Later, an inverse will tell us when cancellation is valid. A nonzero matrix alone is not sufficient. There is no general matrix “division” operation that allows a factor to be crossed out.

Watch out

AB=O\mathbf{AB}=\mathbf O does not imply that either factor is zero. Likewise, cancelling a merely nonzero matrix from AB=AC\mathbf{AB}=\mathbf{AC} can lose valid possibilities.

Find a zero product directly.

Powers of square matrices

A power of a square matrix means repeated matrix multiplication, not raising each entry to that power.

For example, (1201)2=(1401)\begin{pmatrix}1&2\\0&1\end{pmatrix}^2=\begin{pmatrix}1&4\\0&1\end{pmatrix}. The top-right entry is a sum of products, 1(2)+2(1)=41(2)+2(1)=4, not simply 222^2; the agreement with 222^2 in this entry is accidental.

Matrix powers

For a square matrix A\mathbf A, An\mathbf A^n is the product of nn copies of A\mathbf A, for positive integer nn. Define A0=I\mathbf A^0=\mathbf I. Thus ArAs=Ar+s\mathbf A^r\mathbf A^s=\mathbf A^{r+s} for nonnegative integers r,sr,s. A non-square matrix has no ordinary square power because its self-product is incompatible.

Repeated multiplication may reveal a short pattern. Check the mechanism that continues it; the first two values alone do not prove a general formula.

Worked example 5: an accumulating entry

Question. For U=(1201)\mathbf U=\begin{pmatrix}1&2\\0&1\end{pmatrix}, calculate U2\mathbf U^2 and U3\mathbf U^3, then determine U12\mathbf U^{12}.

Plan. Multiply successively and identify how each additional factor changes the upper-right entry.

U2=(1401),U3=(1601).\mathbf U^2=\begin{pmatrix}1&4\\0&1\end{pmatrix},\qquad \mathbf U^3=\begin{pmatrix}1&6\\0&1\end{pmatrix}.

For any number aa,

(1a01)U=(1a+201).\begin{pmatrix}1&a\\0&1\end{pmatrix}\mathbf U =\begin{pmatrix}1&a+2\\0&1\end{pmatrix}.

Each new factor therefore adds 22, leaving the other entries unchanged. Starting from U0=I\mathbf U^0=\mathbf I, twelve factors give an upper-right entry 2424.

Answer. U12=(12401)\mathbf U^{12}=\begin{pmatrix}1&24\\0&1\end{pmatrix}.

Check. Three blocks of U4=(1801)\mathbf U^4=\begin{pmatrix}1&8\\0&1\end{pmatrix} combine to give upper-right entry 8+8+8=248+8+8=24, independently grouping the twelve factors.

Change just the sign of the upper-right entry. The same mechanism now subtracts 22 at each multiplication.

Worked example 6: a negative increment

Question. For V=(1−201)\mathbf V=\begin{pmatrix}1&-2\\0&1\end{pmatrix}, find V2\mathbf V^2, V3\mathbf V^3 and V12\mathbf V^{12}.

Plan. Track the upper-right entry while preserving matrix multiplication.

V2=(1−401),V3=(1−601).\mathbf V^2=\begin{pmatrix}1&-4\\0&1\end{pmatrix},\qquad \mathbf V^3=\begin{pmatrix}1&-6\\0&1\end{pmatrix}.

Multiplying (1a01)\begin{pmatrix}1&a\\0&1\end{pmatrix} by V\mathbf V changes aa to a−2a-2, so twelve copies give −24-24.

Answer. V12=(1−2401)\mathbf V^{12}=\begin{pmatrix}1&-24\\0&1\end{pmatrix}.

Check. Direct calculation gives UV=VU=I\mathbf{UV}=\mathbf{VU}=\mathbf I. Multiplying the proposed twelfth powers also gives I\mathbf I, as twelve cancelling pairs must.

Other powers cycle instead of growing. For R=(0−110)\mathbf R=\begin{pmatrix}0&-1\\1&0\end{pmatrix}, multiplication gives R2=−I\mathbf R^2=-\mathbf I and hence R4=I\mathbf R^4=\mathbf I. A block of four factors can then be removed: R10=(R4)2R2=−I\mathbf R^{10}=(\mathbf R^4)^2\mathbf R^2=-\mathbf I. Always establish the short identity before reducing a large power.

Problem-solving

Look for a stable entry pattern or a small power equal to I\mathbf I, −I-\mathbf I or O\mathbf O. Keep factors in order; powers of the same matrix commute because they are copies of that one matrix.

Use the accumulating-entry method with a fresh increment.

Quick Recap

  • Matrix multiplication is associative and distributive; it is generally not commutative.
  • Matching identities leave a matrix unchanged, but zero products can have nonzero factors.
  • Do not cancel a matrix just because it is nonzero.
  • Powers use repeated matrix multiplication; justify any pattern you use.

The opening pair has AB≠BA\mathbf{AB}\ne\mathbf{BA}, even though both are defined. Order remains essential in every later calculation.