On this page
When you first learn matrix algebra, it is tempting to carry over all the familiar rules from regular numbers. If `(a + b)² = a² + 2ab + b²` works for any two numbers, why should matrices be any different?
The catch lies in how matrices multiply. Because matrix multiplication depends on the order of the terms, the middle of the expansion refuses to collapse into `2AB`.
Why does the matrix expansion refuse to simplify?
If `A` and `B` are square matrices of the same order, you expand their square by multiplying the sum by itself, just as you would with numbers. You use the distributive law to multiply out the brackets:
(A + B)² = (A + B)(A + B) = A(A + B) + B(A + B) = A² + AB + BA + B²
In ordinary algebra, `ab` and `ba` are exactly the same thing, so you can add them together to get `2ab`. But in matrix algebra, the NCERT Class 12 Mathematics textbook reminds us of a fundamental rule: matrix multiplication is generally not commutative.
Why is matrix multiplication not commutative?
This non-commutative property means that for most matrices, `AB ≠ BA`. The product `AB` involves multiplying the rows of `A` by the columns of `B`, while `BA` multiplies the rows of `B` by the columns of `A`. These two sets of operations cross different sets of numbers, meaning they yield entirely different results, so `AB + BA` cannot simply be added together.
To see this in practice, consider two simple 2×2 matrices. Let `A` have a 1 in the top-right corner and 0s elsewhere, and let `B` have a 1 in the bottom-left corner and 0s elsewhere. If you calculate `AB`, the 1 ends up in the top-left position. But if you calculate `BA`, the 1 ends up in the bottom-right position. Because the products are entirely different matrices, `AB + BA` gives you the identity matrix rather than twice of `AB`.
Because the order of multiplication is strictly preserved, other standard algebraic identities also fail for matrices:
(A − B)² = A² − AB − BA + B² (not A² − 2AB + B²)
(A + B)(A − B) = A² − AB + BA − B² (not A² − B²)
If you are working on higher powers, the exact same rule applies. Expanding (A + B)³ gives eight terms in total, including `A²B`, `ABA` and `BA²`. Because their order differs, they cannot be combined into `3A²B`.
When does (A + B)² = A² + 2AB + B² work for matrices?
The familiar identity only works if the specific matrices commute — that is, if `AB = BA`. If you know this is true, the middle terms become `AB + AB`, giving you the standard `2AB`.
Certain pairs of matrices always commute. You can safely use the standard identities if you are adding:
A matrix and the identity matrix: For any square matrix `A`, multiplying by the identity matrix `I` does not change it (`AI = IA = A`). Therefore, (A + I)² = A² + 2A + I.
A matrix and a zero matrix: Since `AO = OA = O`, these naturally commute.
A matrix and its inverse: By definition, multiplying a matrix by its inverse in either order yields the identity matrix (`AA⁻¹ = A⁻¹A = I`).
Powers of the same matrix: `A` always commutes with `A²` or `A³`. This makes finding Aⁿ for a matrix by spotting the pattern much easier, because a single matrix commutes with itself.
Diagonal matrices: If you multiply two diagonal matrices of the same size, the result is just the product of their corresponding diagonal elements. Because the numbers themselves commute, diagonal matrices always commute with each other.
A checklist for matrix exam questions
When a board or competitive exam question involves expanding a matrix equation, use this mental checklist before writing your answer:
Check for special matrices: Is one of the matrices `I` or `O`? If yes, use the standard algebraic identities.
Check for inverses: Is the question asking about `A` and `A⁻¹`? If yes, treat them as commuting.
Check the given conditions: Does the question explicitly state that `AB = BA`? If it does not, you must assume they do not commute.
Preserve the order: Write out every term exactly in the order it multiplies out. Never swap the positions of `A` and `B` within a term.
Matrix algebra has its own distinct set of rules, and memorising them is easier when you see the logic behind the layout. If you want to trace these properties to their roots, the Fermi Concept Library contains every concept in physics, chemistry, biology, mathematics and computing, each with its own lesson and its place in the map. The best way to avoid the `2AB` trap is to write out the full expansion every time until the matrix rules become second nature.
For more on mathematical foundations, you can explore the area of a triangle using determinants or see how roots behave in symmetric functions of roots.



