#### Explain solution for rd sharma class 12 chapter Algebra of matrices exercise 4.3 question 68  math

Answer: A and B are two square matrices with $A B \neq B A$ then $(A B)^{2} \neq A^{2} B^{2}$

Hint: Matrix multiplication is only possible, when the number of columns of first matrix is equal to the number of rows of second matrix.

Given: A and B be square matrices of order $3 \times 3$

Solution: Let

$A=\left[\begin{array}{lll}1 & 0 & 0 \\ 1 & 1 & 0 \\ 0 & 0 & 1\end{array}\right] \ \ and \ \ B=\left[\begin{array}{lll}0 & 1 & 0 \\ 2 & 1 & 0 \\ 0 & 0 & 1\end{array}\right]$

Here

$A B =\left[\begin{array}{lll}1 & 0 & 0 \\ 1 & 1 & 0 \\ 0 & 0 & 1\end{array}\right]\left[\begin{array}{lll}0 & 1 & 0 \\ 2 & 1 & 0 \\ 0 & 0 & 1\end{array}\right]$

$\\=\left[\begin{array}{lll}1 \times 0+0 \times 2+0 \times 0 & 1 \times 1+0 \times 1+0 \times 0 & 1 \times 0+0 \times 0+0 \times 1 \\ 1 \times 0+1 \times 2+0 \times 0 & 1 \times 1+1 \times 1+0 \times 0 & 1 \times 0+1 \times 0+0 \times 1 \\ 0 \times 0+0 \times 2+1 \times 0 & 0 \times 1+0 \times 1+1 \times 0 & 0 \times 0+0 \times 0+1 \times 1\end{array}\right] \\ \\\\=\left[\begin{array}{lll}0 & 1 & 0 \\ 2 & 2 & 0 \\ 0 & 0 & 1\end{array}\right]$

And $B A =\left[\begin{array}{lll}0 & 1 & 0 \\ 2 & 1 & 0 \\ 0 & 0 & 1\end{array}\right]\left[\begin{array}{lll}1 & 0 & 0 \\ 1 & 1 & 0 \\ 0 & 0 & 1\end{array}\right]$

$\\=\left[\begin{array}{lll} 0 \times 1+1 \times 1+0 \times 0 & 0 \times 0+1 \times 1+0 \times 0 & 0 \times 0+1 \times 0+0 \times 1 \\ 2 \times 1+1 \times 1+0 \times 0 & 2 \times 0+1 \times 1+0 \times 0 & 2 \times 0+1 \times 0+0 \times 1 \\ 0 \times 1+0 \times 1+1 \times 0 & 0 \times 0+0 \times 1+1 \times 0 & 0 \times 0+0 \times 0+1 \times 1 \end{array}\right] \\\\ =\left[\begin{array}{lll} 1 & 1 & 0 \\ 3 & 1 & 0 \\ 0 & 0 & 1 \end{array}\right]$

Here, $AB \neq BA$Now,

$\\(A B)^{2}=\left[\begin{array}{lll} 0 & 1 & 0 \\ 2 & 2 & 0 \\ 0 & 0 & 1 \end{array}\right]\left[\begin{array}{lll} 0 & 1 & 0 \\ 2 & 2 & 0 \\ 0 & 0 & 1 \end{array}\right] \\\\\\ =\left[\begin{array}{lll} 0 \times 0+1 \times 2+0 \times 0 & 0 \times 1+1 \times 2+0 \times 0 & 0 \times 0+1 \times 0+0 \times 1 \\ 2 \times 0+2 \times 2+0 \times 0 & 2 \times 1+2 \times 2+0 \times 0 & 2 \times 0+2 \times 0+0 \times 1 \\ 0 \times 0+0 \times 2+1 \times 0 & 0 \times 1+0 \times 2+1 \times 0 & 0 \times 0+0 \times 0+1 \times 1 \end{array}\right] \\\\\\$

$=\left[\begin{array}{lll} 2 & 2 & 0 \\ 4 & 6 & 0 \\ 0 & 0 & 1 \end{array}\right]$

$\\ A^2=\left[\begin{array}{lll} 1 & 0 & 0 \\ 1 & 1 & 0 \\ 0 & 0 & 1 \end{array}\right]\left[\begin{array}{lll} 1 & 0 & 0 \\ 1 & 1 & 0 \\ 0 & 0 & 1 \end{array}\right] \\\\\\ A^{2}=\left[\begin{array}{lll} 1+0+0 & 0+0+0 & 0+0+0 \\ 1+1+0 & 0+1+0 & 0+0+0 \\ 0+0+0 & 0+0+0 & 0+0+1 \end{array}\right] \\\\ =\left[\begin{array}{lll} 1 & 0 & 0 \\ 2 & 1 & 0 \\ 0 & 0 & 1 \end{array}\right]$
$\begin{array}{l} B^{2}=\left[\begin{array}{lll} 0 & 1 & 0 \\ 2 & 1 & 0 \\ 0 & 0 & 1 \end{array}\right]\left[\begin{array}{lll} 0 & 1 & 0 \\ 2 & 1 & 0 \\ 0 & 0 & 1 \end{array}\right] \\\\ =\left[\begin{array}{lll} 0+2+0 & 0+1+0 & 0+0+0 \\ 0+2+0 & 2+1+0 & 0+0+0 \\ 0+0+0 & 0+0+0 & 0+0+1 \end{array}\right] \\\\ =\left[\begin{array}{lll} 2 & 1 & 0 \\ 2 & 3 & 0 \\ 0 & 0 & 1 \end{array}\right] \\\\ A^{2} B^{2}=\left[\begin{array}{lll} 1 & 0 & 0 \\ 2 & 1 & 0 \\ 0 & 0 & 1 \end{array}\right]\left[\begin{array}{lll} 2 & 1 & 0 \\ 2 & 3 & 0 \\ 0 & 0 & 1 \end{array}\right] \\\\ \end{array}$

$\\ A^{2} B^{2}=\left[\begin{array}{lll} 2+0+0 & 1+0+0 & 0+0+0 \\ 4+2+0 & 2+3+0 & 0+0+0 \\ 0+0+0 & 0+0+0 & 0+0+1 \end{array}\right] \\\\\\ A^{2} B^{2}=\left[\begin{array}{lll} 2 & 1 & 0 \\ 6 & 5 & 0 \\ 0 & 0 & 1 \end{array}\right]$

We can see that if we have A and B two square matrices with $AB \neq BA$  then $(A B)^{2} \neq A^{2} B^{2}$