Class 12 Maths, Worked in Full Past papersGet updates
Chapter 3 · Matrices

Example 24: For symmetric A,BA, B⁠: ABAB symmetric iff AB=BAAB=BA

ExamplesMiscellaneous examples · Chapter 3
The question

If AA and BB are symmetric matrices of the same order, then show that ABAB is symmetric if and only if AA and BB commute, that is AB=BAAB = BA⁠.

Exam answer

Given A′=AA' = A and B′=BB' = B⁠. So

(AB)′=B′A′=BA…(i)(AB)' = B'A' = BA \quad\ldots(\text{i})

Let ABAB be symmetric, that is (AB)′=AB(AB)' = AB⁠. Then by (i), BA=ABBA = AB⁠.

Conversely, let AB=BAAB = BA⁠. Then by (i),

(AB)′=BA=AB(AB)' = BA = AB

so ABAB is symmetric.

Hence ABAB is symmetric if and only if AB=BAAB = BA⁠.

Want the reason behind every step, the basics and the checks?

The one idea this problem is built on

Transposing a product reverses it: (AB)′=B′A′(AB)' = B'A'⁠. For symmetric matrices B′=BB' = B and A′=AA' = A⁠, so (AB)′=BA(AB)' = BA⁠. That single line says: the transpose of ABAB is BABA. Now "ABAB is symmetric" means (AB)′=AB(AB)' = AB⁠, which is the same as BA=ABBA = AB⁠. Both directions of the "if and only if" come out of this one identity.

Given, to show, and the plan
Given
Square matrices AA and BB of the same order n×nn\times n⁠, with A′=AA' = A and B′=BB' = B⁠.
To show
Both directions: (1) if ABAB is symmetric, then AB=BAAB = BA⁠; (2) if AB=BAAB = BA⁠, then ABAB is symmetric.
Plan
Check that everything is defined; establish (AB)′=BA(AB)' = BA⁠; prove each direction from it; then look at examples showing both outcomes, and at what goes wrong when AA⁠, BB are not symmetric.

Basics you need

1Symmetric matrix

A square matrix SS is symmetric if S′=SS' = S⁠, that is sji=sijs_{ji} = s_{ij} for all i,ji, j⁠. Basics: mirror patterns

2Transpose of a product

(AB)′=B′A′(AB)' = B'A' whenever ABAB is defined: the order of the factors reverses. (Section 3.5.1, property (iv); a proof is given in Step 2.)

3"If and only if"

"XX if and only if YY" is two statements: "if YY then XX" and "if XX then YY". A complete proof proves both directions separately.

4Matrix products need not commute

For matrices, ABAB and BABA are often different, even when both are defined. "AA and BB commute" means the special case AB=BAAB = BA⁠. Basics: pair up, multiply, add

Solution

  1. Check that ABAB and BABA are defined

    A symmetric matrix must be square (otherwise A′A' would have a different order from AA and could not equal it). Since AA and BB have the same order, both are n×nn\times n for some nn⁠. Then ABAB is defined (columns of AA = nn = rows of BB⁠) and is n×nn\times n⁠; likewise BABA is defined and is n×nn\times n⁠. So it makes sense to compare ABAB with BABA⁠, and to ask whether the square matrix ABAB is symmetric.

    "AB=BAAB = BA" can only hold between matrices of the same order, and "symmetric" only applies to square matrices. Checking orders first makes sure the statement we are proving is meaningful.
    Definition 4, Section 3.6 (symmetric matrices are square); Section 3.4.5 (orders of a product). Lesson: symmetric and skew symmetric
  2. The key identity: (AB)′=BA(AB)' = BA

    By the reversal rule and then the symmetry of AA and BB⁠,

    (AB)′=B′A′=BA.(AB)' = B'A' = BA.

    Why the reversal rule holds: the (i,j)(i,j) entry of (AB)′(AB)' is the (j,i)(j,i) entry of ABAB⁠, which is

    ∑r=1najr bri.\textstyle\sum_{r=1}^{n} a_{jr}\,b_{ri}.

    The (i,j)(i,j) entry of B′A′B'A' is (row ii of B′B'⁠) times (column jj of A′A'⁠), and row ii of B′B' is column ii of BB⁠, column jj of A′A' is row jj of AA⁠. So it is

    ∑r=1nbri ajr,\textstyle\sum_{r=1}^{n} b_{ri}\,a_{jr},

    the same numbers multiplied in the other order. Hence (AB)′=B′A′(AB)' = B'A' for every i,ji, j⁠.

    This answers the textbook's "(Why?)". The first equality is the reversal rule; the second replaces B′B' by BB and A′A' by AA⁠, which is allowed because both matrices are symmetric (Given). Everything else in the proof rests on this line.
    Property (iv), Section 3.5.1; see also Example 21. Lesson: transpose
  3. Direction 1: if ABAB is symmetric, then AB=BAAB = BA

    Assume ABAB is symmetric, so (AB)′=AB(AB)' = AB⁠. By Step 2, (AB)′=BA(AB)' = BA⁠. Both are equal to (AB)′(AB)'⁠, so

    BA=(AB)′=AB.BA = (AB)' = AB.

    Thus AB=BAAB = BA: AA and BB commute.

    We start from the assumption of this direction and use only it, the givens, and the identity of Step 2. Two things equal to the same thing are equal to each other.
  4. Direction 2: if AB=BAAB = BA⁠, then ABAB is symmetric

    Assume AB=BAAB = BA⁠. By Step 2 and then this assumption,

    (AB)′=BA=AB.(AB)' = BA = AB.

    So (AB)′=AB(AB)' = AB⁠, which says exactly that ABAB is symmetric.

    This is the "conversely" part of the textbook solution. Again we start from this direction's own assumption. The two directions together prove the "if and only if".
    Definition 4, Section 3.6: SS is symmetric when S′=SS' = S⁠.
  5. See both cases in examples

    A pair that does not commute. Take the symmetric 2×22\times2 matrices

    A=[1002],B=[0110].A = \begin{bmatrix} 1 & 0 \\ 0 & 2 \end{bmatrix}, \qquad B = \begin{bmatrix} 0 & 1 \\ 1 & 0 \end{bmatrix}.

    Entry by entry,

    (AB)11=1⋅0+0⋅1=0,(AB)12=1⋅1+0⋅0=1,(AB)21=0⋅0+2⋅1=2,(AB)22=0⋅1+2⋅0=0,(BA)11=0⋅1+1⋅0=0,(BA)12=0⋅0+1⋅2=2,(BA)21=1⋅1+0⋅0=1,(BA)22=1⋅0+0⋅2=0.\begin{aligned} (AB)_{11} &= 1\cdot0 + 0\cdot1 = 0,\\ (AB)_{12} &= 1\cdot1 + 0\cdot0 = 1,\\ (AB)_{21} &= 0\cdot0 + 2\cdot1 = 2,\\ (AB)_{22} &= 0\cdot1 + 2\cdot0 = 0,\\ (BA)_{11} &= 0\cdot1 + 1\cdot0 = 0,\\ (BA)_{12} &= 0\cdot0 + 1\cdot2 = 2,\\ (BA)_{21} &= 1\cdot1 + 0\cdot0 = 1,\\ (BA)_{22} &= 1\cdot0 + 0\cdot2 = 0. \end{aligned} AB=[0120],BA=[0210].AB = \begin{bmatrix} 0 & 1 \\ 2 & 0 \end{bmatrix}, \qquad BA = \begin{bmatrix} 0 & 2 \\ 1 & 0 \end{bmatrix}.

    Here AB≠BAAB \ne BA⁠, and ABAB is not symmetric (1≠21 \ne 2 across the diagonal). Notice that BABA is exactly (AB)′(AB)'⁠, as Step 2 says.

    A pair that commutes. Now take

    A=[1223],B=[2224],A = \begin{bmatrix} 1 & 2 \\ 2 & 3 \end{bmatrix}, \qquad B = \begin{bmatrix} 2 & 2 \\ 2 & 4 \end{bmatrix},

    both symmetric (BB is A+IA + I⁠). Entry by entry,

    (AB)11=1⋅2+2⋅2=6,(AB)12=1⋅2+2⋅4=10,(AB)21=2⋅2+3⋅2=10,(AB)22=2⋅2+3⋅4=16,(BA)11=2⋅1+2⋅2=6,(BA)12=2⋅2+2⋅3=10,(BA)21=2⋅1+4⋅2=10,(BA)22=2⋅2+4⋅3=16.\begin{aligned} (AB)_{11} &= 1\cdot2 + 2\cdot2 = 6,\\ (AB)_{12} &= 1\cdot2 + 2\cdot4 = 10,\\ (AB)_{21} &= 2\cdot2 + 3\cdot2 = 10,\\ (AB)_{22} &= 2\cdot2 + 3\cdot4 = 16,\\ (BA)_{11} &= 2\cdot1 + 2\cdot2 = 6,\\ (BA)_{12} &= 2\cdot2 + 2\cdot3 = 10,\\ (BA)_{21} &= 2\cdot1 + 4\cdot2 = 10,\\ (BA)_{22} &= 2\cdot2 + 4\cdot3 = 16. \end{aligned} AB=BA=[6101016],AB = BA = \begin{bmatrix} 6 & 10 \\ 10 & 16 \end{bmatrix},

    which is symmetric, as the theorem predicts.

    The examples are not part of the proof (the proof is Steps 3 and 4), but they show that both situations really occur, so neither condition is automatic for symmetric matrices.
  6. Why the word "symmetric" in the hypothesis matters

    Without it, Direction 1 can fail. Take the (non-symmetric) matrices

    A=[0100],B=[0010].A = \begin{bmatrix} 0 & 1 \\ 0 & 0 \end{bmatrix}, \qquad B = \begin{bmatrix} 0 & 0 \\ 1 & 0 \end{bmatrix}.

    Entry by entry,

    (AB)11=0⋅0+1⋅1=1,(AB)12=0⋅0+1⋅0=0,(AB)21=0⋅0+0⋅1=0,(AB)22=0⋅0+0⋅0=0,(BA)11=0⋅0+0⋅0=0,(BA)12=0⋅1+0⋅0=0,(BA)21=1⋅0+0⋅0=0,(BA)22=1⋅1+0⋅0=1.\begin{aligned} (AB)_{11} &= 0\cdot0 + 1\cdot1 = 1,\\ (AB)_{12} &= 0\cdot0 + 1\cdot0 = 0,\\ (AB)_{21} &= 0\cdot0 + 0\cdot1 = 0,\\ (AB)_{22} &= 0\cdot0 + 0\cdot0 = 0,\\ (BA)_{11} &= 0\cdot0 + 0\cdot0 = 0,\\ (BA)_{12} &= 0\cdot1 + 0\cdot0 = 0,\\ (BA)_{21} &= 1\cdot0 + 0\cdot0 = 0,\\ (BA)_{22} &= 1\cdot1 + 0\cdot0 = 1. \end{aligned} AB=[1000],BA=[0001].AB = \begin{bmatrix} 1 & 0 \\ 0 & 0 \end{bmatrix}, \qquad BA = \begin{bmatrix} 0 & 0 \\ 0 & 1 \end{bmatrix}.

    ABAB is symmetric, yet AB≠BAAB \ne BA⁠. The proof breaks at Step 2: here B′A′=BAB'A' = BA is false, because A′≠AA' \ne A and B′≠BB' \ne B⁠.

    A counterexample is the right tool for showing that a statement is false in general. It also shows exactly which given the proof depends on.
Result

For symmetric AA⁠, BB of the same order, (AB)′=B′A′=BA(AB)' = B'A' = BA⁠. Hence ABAB is symmetric   ⟺  (AB)′=AB  ⟺  BA=AB\iff (AB)' = AB \iff BA = AB⁠. Both directions are proved: ABAB is symmetric if and only if AA and BB commute.

Check it with numbers

A computer test over 2000 random pairs of symmetric 3×33\times3 integer matrices (and many specially built commuting pairs, such as B=A2−2A+3IB = A^2 - 2A + 3I⁠) found that "ABAB is symmetric" and "AB=BAAB = BA" were either both true or both false in every case, and that (AB)′=BA(AB)' = BA every time.

Common mistakes
  1. Proving only one direction. "If and only if" needs both. The textbook marks the second with "Conversely".
  2. Writing (AB)′=A′B′(AB)' = A'B'⁠. The order reverses: (AB)′=B′A′(AB)' = B'A'⁠.
  3. Thinking symmetric matrices always commute. The first pair in Step 5 is symmetric but AB≠BAAB \ne BA⁠.
  4. Using the hypotheses in the wrong direction. In Direction 1 you may assume (AB)′=AB(AB)' = AB⁠; in Direction 2 you may assume AB=BAAB = BA⁠. Do not use the conclusion of a direction inside its own proof.
What to take away
  1. For symmetric AA⁠, BB⁠: the transpose of ABAB is BABA⁠.
  2. So ABAB is symmetric exactly when AB=BAAB = BA⁠.
  3. Prove "if and only if" as two separate implications, each starting from its own assumption.

Every fact used, and where it comes from

FactUsed inSource
Symmetric: S′=SS' = S (so SS is square)Steps 1 to 4Definition 4, Section 3.6 (Lesson: symmetric and skew symmetric)
Orders of a product; entry ruleSteps 1, 2, 5, 6Section 3.4.5 (Lesson: matrix multiplication)
(AB)′=B′A′(AB)' = B'A'Step 2Section 3.5.1, property (iv) (Lesson: transpose)
AB≠BAAB \ne BA in generalSteps 5, 6Section 3.4.5, non-commutativity (Lesson: properties)
Proof of both directionsSteps 3, 4Miscellaneous Examples, Example 24
Found an error, or want more?

Tell us if something on this page is wrong or unclear, or if you would like a fuller explanation, another method or a new feature. Send feedback on this problem →