1. Matrix Algebra0%

Matrices · Topic 1 of 3

1. Matrix Algebra

Video coming soon4 worked examples

Theory

A matrix is a rectangular array of numbers. Its order is written as (rows ×\times columns). You can add or subtract matrices of the same order (entry by entry), and multiply any matrix by a scalar.

Matrix multiplication combines rows of the first matrix with columns of the second. For the product ABAB to exist, the number of columns of AA must equal the number of rows of BB:

(m×n)(n×p)=(m×p)(m \times n)(n \times p) = (m \times p)

For a 2×22\times 2 matrix A=(abcd)A = \begin{pmatrix} a & b \\ c & d \end{pmatrix}, the determinant is detA=adbc\det A = ad - bc, and provided detA0\det A \neq 0 the inverse is:

A1=1adbc(dbca)A^{-1} = \frac{1}{ad-bc}\begin{pmatrix} d & -b \\ -c & a \end{pmatrix}

If detA=0\det A = 0 the matrix is singular and has no inverse.

Two further pieces of notation are needed throughout the topic. The transpose ATA^{T} is formed by swapping rows and columns:

A=(2103)    AT=(2013)A = \begin{pmatrix} 2 & 1 \\ 0 & 3 \end{pmatrix} \implies A^{T} = \begin{pmatrix} 2 & 0 \\ 1 & 3 \end{pmatrix}

It obeys (AT)T=A(A^{T})^{T} = A and, importantly, (AB)T=BTAT(AB)^{T} = B^{T}A^{T} — the order reverses. A matrix with AT=AA^{T} = A is called symmetric.

The identity matrix II has 11s on the leading diagonal and 00s elsewhere. It behaves like the number 11:

I=(1001),AI=IA=A,A1A=AA1=II = \begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix}, \qquad AI = IA = A, \qquad A^{-1}A = AA^{-1} = I

That last statement is the definition of the inverse, and it is what makes the row-reduction method for larger matrices work.

The Golden Rule: matrix multiplication is not commutative — in general ABBAAB \neq BA. Check the inner dimensions match before multiplying, and the result takes the outer dimensions.

⚠️ Common Examiner Traps

  • Assuming AB=BAAB = BA: order matters. If the question asks for ABAB, do not compute BABA.
  • Multiplying entry-by-entry: matrix multiplication is row-into-column, not element-wise.
  • Inverse sign slips: in the 2×22\times 2 inverse you swap aa and dd, and negate bb and cc — don't negate all four.

Worked examples

Example 1

Given A=(2134)A = \begin{pmatrix} 2 & -1 \\ 3 & 4 \end{pmatrix} and B=(1025)B = \begin{pmatrix} 1 & 0 \\ 2 & 5 \end{pmatrix}, find ABAB. Show that BAABBA \neq AB.

Step 1: Multiply row-into-column for ABAB:

AB=((2)(1)+(1)(2)(2)(0)+(1)(5)(3)(1)+(4)(2)(3)(0)+(4)(5))=(051120)AB = \begin{pmatrix} (2)(1)+(-1)(2) & (2)(0)+(-1)(5) \\ (3)(1)+(4)(2) & (3)(0)+(4)(5) \end{pmatrix} = \begin{pmatrix} 0 & -5 \\ 11 & 20 \end{pmatrix}

Step 2: Now compute BABA:

BA=((1)(2)+(0)(3)(1)(1)+(0)(4)(2)(2)+(5)(3)(2)(1)+(5)(4))=(211918)BA = \begin{pmatrix} (1)(2)+(0)(3) & (1)(-1)+(0)(4) \\ (2)(2)+(5)(3) & (2)(-1)+(5)(4) \end{pmatrix} = \begin{pmatrix} 2 & -1 \\ 19 & 18 \end{pmatrix}

Step 3: Since (051120)(211918)\begin{pmatrix} 0 & -5 \\ 11 & 20 \end{pmatrix} \neq \begin{pmatrix} 2 & -1 \\ 19 & 18 \end{pmatrix}, we have ABBAAB \neq BA.

Example 2

Find the inverse of A=(3512)A = \begin{pmatrix} 3 & 5 \\ 1 & 2 \end{pmatrix}.

Step 1: Find the determinant:

detA=(3)(2)(5)(1)=65=1\det A = (3)(2) - (5)(1) = 6 - 5 = 1

Step 2: Since detA=10\det A = 1 \neq 0, apply the inverse formula (swap a,da,d; negate b,cb,c):

A1=11(2513)=(2513)A^{-1} = \frac{1}{1}\begin{pmatrix} 2 & -5 \\ -1 & 3 \end{pmatrix} = \begin{pmatrix} 2 & -5 \\ -1 & 3 \end{pmatrix}

Step 3: Check by confirming AA1=IA A^{-1} = I:

(3512)(2513)=(1001)\begin{pmatrix} 3 & 5 \\ 1 & 2 \end{pmatrix}\begin{pmatrix} 2 & -5 \\ -1 & 3 \end{pmatrix} = \begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix}

Example 3

Evaluate the determinant of A=(123014560)A = \begin{pmatrix} 1 & 2 & 3 \\ 0 & 1 & 4 \\ 5 & 6 & 0 \end{pmatrix}.

Step 1: Expand along the first row, each entry times its 2×22\times 2 minor, with the sign pattern +++\,-\,+:

detA=1146020450+30156\det A = 1\begin{vmatrix} 1 & 4 \\ 6 & 0 \end{vmatrix} - 2\begin{vmatrix} 0 & 4 \\ 5 & 0 \end{vmatrix} + 3\begin{vmatrix} 0 & 1 \\ 5 & 6 \end{vmatrix}

Step 2: Evaluate each 2×22\times 2 determinant:

=1(024)2(020)+3(05)= 1(0 - 24) - 2(0 - 20) + 3(0 - 5)

Step 3: Simplify:

=24+4015=1= -24 + 40 - 15 = 1

Example 4

Given A=(2103)A = \begin{pmatrix} 2 & 1 \\ 0 & 3 \end{pmatrix} and B=(1425)B = \begin{pmatrix} 1 & 4 \\ -2 & 5 \end{pmatrix}, verify that (AB)T=BTAT(AB)^{T} = B^{T}A^{T}.

Step 1: Work out ABAB first, combining rows of AA with columns of BB:

AB=(2103)(1425)=(228+5060+15)=(013615)AB = \begin{pmatrix} 2 & 1 \\ 0 & 3 \end{pmatrix}\begin{pmatrix} 1 & 4 \\ -2 & 5 \end{pmatrix} = \begin{pmatrix} 2-2 & 8+5 \\ 0-6 & 0+15 \end{pmatrix} = \begin{pmatrix} 0 & 13 \\ -6 & 15 \end{pmatrix}

Step 2: Transpose the result by swapping rows and columns:

(AB)T=(061315)(AB)^{T} = \begin{pmatrix} 0 & -6 \\ 13 & 15 \end{pmatrix}

Step 3: Now transpose AA and BB separately, and multiply them in the reversed order:

BT=(1245),AT=(2013)B^{T} = \begin{pmatrix} 1 & -2 \\ 4 & 5 \end{pmatrix}, \qquad A^{T} = \begin{pmatrix} 2 & 0 \\ 1 & 3 \end{pmatrix}
BTAT=(22068+50+15)=(061315)B^{T}A^{T} = \begin{pmatrix} 2-2 & 0-6 \\ 8+5 & 0+15 \end{pmatrix} = \begin{pmatrix} 0 & -6 \\ 13 & 15 \end{pmatrix}

Step 4: The two results agree, confirming (AB)T=BTAT(AB)^{T} = B^{T}A^{T}. Note that ATBTA^{T}B^{T} would not have worked — the reversal matters.