For \(AB\), the number of columns of \(A\) must equal the number of rows of \(B\). Orders \((m\times n)(n\times p)\) give order \(m\times p\). Each answer entry is a row of \(A\) multiplied against a column of \(B\), adding the products.
Example
\(A=\begin{pmatrix}1&2&3\\0&-1&4\end{pmatrix}\), \(B=\begin{pmatrix}2&1\\1&0\\3&-2\end{pmatrix}\). The inner dimensions are both \(3\), so \(AB\) has order \(2\times2\).
\(\begin{aligned}AB&=\begin{pmatrix}1(2)+2(1)+3(3)&1(1)+2(0)+3(-2)\\0(2)+(-1)(1)+4(3)&0(1)+(-1)(0)+4(-2)\end{pmatrix}\\&=\begin{pmatrix}13&-5\\11&-8\end{pmatrix}.\end{aligned}\)
Matrix multiplication is not entrywise multiplication. Here \(BA\) would be \(3\times3\), so it cannot equal \(AB\). Even when both products have the same order, their entries need not agree.
For a square matrix, \(A^2\) means \(AA\), not squaring each entry. Always check the order before calculating.
Create a free account to practise similar questions.
Need help? Join our E-Maths tuition for O-Level success.
Learn more