FP1.5 - Matrix algebra

Syllabus
2019
Topic
Level
AS

Add and subtract matrices entry by entry

Two matrices can be added or subtracted only when they have the same order. Combine entries that occupy the same row and column; the result has that same order.

A=(aij), B=(bij) of the same orderA±B=(aij±bij)A=(a_{ij}),\ B=(b_{ij})\text{ of the same order}\quad\Longrightarrow\quad A\pm B=(a_{ij}\pm b_{ij})

For A=(2134),B=(5231),A=\begin{pmatrix}2&-1\\3&4\end{pmatrix},\qquad B=\begin{pmatrix}5&2\\-3&1\end{pmatrix}, match corresponding positions: A+B=(7105),AB=(3363).A+B=\begin{pmatrix}7&1\\0&5\end{pmatrix},\qquad A-B=\begin{pmatrix}-3&-3\\6&3\end{pmatrix}. For example, the lower-left entry of ABA-B is 3(3)=63-(-3)=6.

Do not combine whole rows or columns, and do not add matrices of different orders. Subtraction is order-sensitive: AB=(BA)A-B=-(B-A), so reversing the matrices usually changes every sign.

Multiply every matrix entry by a scalar

A scalar is a single number. Multiplying a matrix by a scalar multiplies every entry by that number while leaving the matrix order unchanged.

kA=k(aij)=(kaij)kA=k(a_{ij})=(ka_{ij})

If A=(2134),A=\begin{pmatrix}2&-1\\3&4\end{pmatrix}, then 3A=(63912).-3A=\begin{pmatrix}-6&3\\-9&-12\end{pmatrix}. The negative scalar reverses each sign as well as multiplying each magnitude by 33. Also, 0A0A is the zero matrix of the same order as AA.

The scalar must reach every entry, not just a row, a column or the diagonal. Scalar multiplication is different from a product of two matrices: it needs no row-by-column calculation and never changes the matrix order.

Form a matrix product by row and column

The product ABAB exists when the number of columns of AA equals the number of rows of BB. If AA is m×nm\times n and BB is n×pn\times p, then ABAB is m×pm\times p.

(AB)ij=r=1nairbrj(AB)_{ij}=\sum_{r=1}^{n}a_{ir}b_{rj}

To find one entry, take a row from the first matrix and the matching column from the second, multiply corresponding terms, then add. Repeat for every row-column pair.

Let A=(121034),B=(211032).A=\begin{pmatrix}1&2&-1\\0&3&4\end{pmatrix},\qquad B=\begin{pmatrix}2&1\\-1&0\\3&2\end{pmatrix}. Their inner dimensions are both 33, so AB=(1(2)+2(1)+(1)(3)1(1)+2(0)+(1)(2)0(2)+3(1)+4(3)0(1)+3(0)+4(2))=(3198).AB=\begin{pmatrix}1(2)+2(-1)+(-1)(3)&1(1)+2(0)+(-1)(2)\\0(2)+3(-1)+4(3)&0(1)+3(0)+4(2)\end{pmatrix}=\begin{pmatrix}-3&-1\\9&8\end{pmatrix}.

Matrix multiplication is generally not commutative: even when both ABAB and BABA exist, they need not be equal. Here ABAB is 2×22\times2 but BABA is 3×33\times3, so equality is impossible. A2A^2 means AAAA, not squaring each entry.

Use a determinant to test a 2 by 2 matrix

The determinant of a 2 by 2 matrix is one number found by multiplying along the main diagonal and subtracting the product along the other diagonal.

A=(abcd)detA=A=adbcA=\begin{pmatrix}a&b\\c&d\end{pmatrix}\quad\Longrightarrow\quad \det A=|A|=ad-bc

Determinant Classification Consequence
detA=0\det A=0 singular AA has no inverse
detA0\det A\ne0 non-singular AA has an inverse

For A=(4723)A=\begin{pmatrix}4&7\\2&3\end{pmatrix}, detA=4(3)7(2)=2,\det A=4(3)-7(2)=-2, so AA is non-singular. By contrast, for S=(2613)S=\begin{pmatrix}2&6\\1&3\end{pmatrix}, detS=2(3)6(1)=0,\det S=2(3)-6(1)=0, so SS is singular.

Keep the subtraction order adbcad-bc; it is not acbdac-bd and not the sum of the diagonal products. For a matrix containing a parameter, find the determinant expression first and solve detA=0\det A=0 only when testing singularity.

Find a 2 by 2 inverse and reverse product order

An inverse A1A^{-1} reverses the effect of a square matrix: AA1=A1A=IAA^{-1}=A^{-1}A=I. A 2 by 2 inverse exists exactly when the determinant is non-zero.

A=(abcd), adbc0A1=1adbc(dbca)A=\begin{pmatrix}a&b\\c&d\end{pmatrix},\ ad-bc\ne0\quad\Longrightarrow\quad A^{-1}=\frac{1}{ad-bc}\begin{pmatrix}d&-b\\-c&a\end{pmatrix}

Keep the main-diagonal entries but swap their positions, change the signs of the other two entries, then multiply the resulting matrix by the reciprocal of the determinant.

For A=(4723)A=\begin{pmatrix}4&7\\2&3\end{pmatrix}, detA=2\det A=-2, so A1=12(3724).A^{-1}=-\frac12\begin{pmatrix}3&-7\\-2&4\end{pmatrix}. Multiplying AA by this result gives II, which checks both the entry changes and the determinant factor.

(AB)1=B1A1(AB)^{-1}=B^{-1}A^{-1}

The order reverses because B1B^{-1} must first undo BB: (AB)(B1A1)=A(BB1)A1=I.(AB)(B^{-1}A^{-1})=A(BB^{-1})A^{-1}=I. This relation requires both AA and BB to be invertible.

If detA=0\det A=0, division by the determinant is impossible and no inverse exists. Do not leave the factors in their original order: A1B1A^{-1}B^{-1} does not generally invert ABAB.