Interactive guide · linear algebra

Types of matrices

What a matrix is and how they are classified: square, identity, diagonal, symmetric, antisymmetric and triangular. Every property has its step-by-step proof: click any card to see it.

Buy me a coffee
Your matrix
A =
Rows Columns
Examples
Transpose Aᵗ
A =
1423
At =

The rows of A become the columns of Aᵗ: row i of A is column i of Aᵗ. Move the pointer over Aᵗ to see where each number comes from.

a₁₂ = 4 sits in row 1, column 2 of A and moves to row 2, column 1 of Aᵗ.

Which types is it?
  • Square m = n Yes
    It has 2 rows and 2 columns: the same number.
  • Zero aij = 0 No
    a₁₁ = 1, which is not 0.
  • Identity aii = 1, aij = 0 (i ≠ j) No
    a₁₂ = 4 is off the diagonal and is not 0.
  • Diagonal aij = 0 (i ≠ j) No
    a₁₂ = 4 is off the diagonal and is not 0.
  • Symmetric A = Aᵗ No
    a₁₂ = 4 but a₂₁ = 2.
  • Antisymmetric Aᵗ = −A No
    a₁₁ = 1 is on the diagonal and would have to be 0 (aᵢᵢ = −aᵢᵢ only holds for 0).
  • Upper triangular aij = 0 (i > j) No
    a₂₁ = 2 is below the diagonal and is not 0.
  • Lower triangular aij = 0 (i < j) No
    a₁₂ = 4 is above the diagonal and is not 0.

One matrix can be of several types at once: the identity is square, diagonal, symmetric and triangular.

Symmetric + antisymmetric

S = (A + At) / 2   K = (A − At) / 2

S =
1333
+
K =
01−10
=
A =
1423

Checked: S + K gives exactly A, entry by entry.

S is symmetric and K is antisymmetric. Every square matrix is the sum of one of each type.

01 · Definition

What is a matrix?

A matrix is a rectangular table of numbers arranged in rows (horizontal) and columns (vertical). It stores many data together and lets you operate on them all at once.

Size m × nA matrix with m rows and n columns has size m × n. Always say the rows first and then the columns.
Entry aijThe number in row i and column j. So A = [aij]m×n is the matrix made of all its entries.
The set Mm×n(K)All the m × n matrices with entries in K, the set of numbers we work with (usually ℝ or ℂ), where you can add, subtract, multiply and divide.
Main diagonalThe entries a11, a22, a33, …, that is, those whose row number equals their column number. It runs from the top left corner down and to the right.
  1. 1Worked example. This matrix has 2 rows and 3 columns: its size is 2 × 3.A=(123456)∈M2×3(R)A = \begin{pmatrix} 1 & 2 & 3 \\ 4 & 5 & 6 \end{pmatrix} \in M_{2 \times 3}(\mathbb{R})
  2. 2The entry a₁₂ is in row 1, column 2.a12=2a_{12} = 2
  3. 3The entry a₂₃ is in row 2, column 3.a23=6a_{23} = 6

What it is for. A matrix is the tidy way to store a table of data, the coefficients of a system of equations or a transformation of the plane. Everything that follows classifies matrices by the shape of their table and by their symmetries, because each type satisfies properties that save work.

02 · Square, identity and diagonal

Square matrices

They are called square because of their shape: they have as many rows as columns. Two very important types live inside them.

Square matrixm = n. It is said to have order n. Only square matrices have a full main diagonal, a determinant and an inverse.
Identity matrix ISquare, with ones on the main diagonal and zeros elsewhere. It changes nothing when multiplying (like the number 1).
Diagonal matrixSquare, with every entry 0 except those on the main diagonal. The identity is a diagonal matrix.
  1. 1Worked example. A square matrix of order 3 (3 rows, 3 columns):(410257369)\begin{pmatrix} 4 & 1 & 0 \\ 2 & 5 & 7 \\ 3 & 6 & 9 \end{pmatrix}
  2. 2The identity of order 3: ones on the diagonal, zeros elsewhere.I3=(100010001)I_3 = \begin{pmatrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{pmatrix}
  3. 3A diagonal matrix: only the entries 2, −1 and 5 on the diagonal can be non-zero.D=(2000−10005)D = \begin{pmatrix} 2 & 0 & 0 \\ 0 & -1 & 0 \\ 0 & 0 & 5 \end{pmatrix}

What it is for. Square matrices describe transformations of a space into itself and are the only ones that can have an inverse. The identity plays the role of "1" in the matrix product, and diagonal matrices are the easiest to use: they are multiplied and raised to powers entry by entry on the diagonal.

03 · Transpose

The transpose Aᵗ

The transpose of a matrix is obtained by swapping its rows for its columns. It works for any matrix, rectangular (non-square) ones included.

If A = [aij], then At = [aji]: the entry in row i, column j moves to row j, column i. The diagonal stays put and the rest swap in pairs (each pair has its own colour). If A is m × n, At is n × m.

  1. 1Worked example with a rectangular 2 × 3 matrix.A=(123456)A = \begin{pmatrix} 1 & 2 & 3 \\ 4 & 5 & 6 \end{pmatrix}
  2. 2The rows of A (1, 2, 3 and 4, 5, 6) are written as columns. The transpose is 3 × 2.At=(142536)A^t = \begin{pmatrix} 1 & 4 \\ 2 & 5 \\ 3 & 6 \end{pmatrix}

Properties

Transposing twice: (Aᵗ)ᵗ = A

(At)t=A(A^t)^t = A

Swapping rows and columns twice gives back the original matrix.

See proof

Transpose of a product: (AB)ᵗ = BᵗAᵗ

(AB)t=BtAt(AB)^t = B^t A^t

Transposing a product transposes each factor and reverses their order.

See proof

What it is for. The transpose lets you go from rows to columns, and it is used to define symmetric and antisymmetric matrices. It also appears when computing dot products and in the least squares method.

04 · Symmetric

Symmetric matrices

A square matrix is symmetric when it equals its transpose. It is as if the diagonal were a mirror: what is on one side is repeated on the other.

Symmetric matrixA = At, that is, aij = aji for all i and j.
  1. 1Worked example. The entries 2 and 2, 5 and 5, 7 and 7 are at the same distance from the diagonal and are equal.A=(125237574)=AtA = \begin{pmatrix} 1 & 2 & 5 \\ 2 & 3 & 7 \\ 5 & 7 & 4 \end{pmatrix} = A^t
  2. 2A matrix like ((1, 4), (2, 3)) is not symmetric: a₁₂ = 4 but a₂₁ = 2.(1423)t=(1243)≠(1423)\begin{pmatrix} 1 & 4 \\ 2 & 3 \end{pmatrix}^t = \begin{pmatrix} 1 & 2 \\ 4 & 3 \end{pmatrix} \neq \begin{pmatrix} 1 & 4 \\ 2 & 3 \end{pmatrix}

Properties

The inverse of a symmetric matrix is symmetric

A=At  ⇒  (A−1)t=A−1A = A^t \;\Rightarrow\; (A^{-1})^t = A^{-1}

If A = Aᵗ and A has an inverse, then A⁻¹ is symmetric too.

See proof

Sum of symmetric and sum of antisymmetric matrices

(A+B)t=At+Bt(A + B)^t = A^t + B^t

Adding two symmetric matrices gives a symmetric one; adding two antisymmetric matrices gives an antisymmetric one.

See proof

The product of symmetric matrices is symmetric only if AB = BA

A=At, B=Bt:(AB)t=AB  ⟺  AB=BAA = A^t,\ B = B^t:\qquad (AB)^t = AB \iff AB = BA

Two symmetric matrices do not always give a symmetric product: it depends on whether they commute.

See proof

AAᵗ and AᵗA are always symmetric

(AAt)t=AAt,(AtA)t=AtA(AA^t)^t = AA^t,\qquad (A^tA)^t = A^tA

Multiplying a matrix by its transpose, in either order, gives a symmetric matrix.

See proof

What it is for. Symmetric matrices appear whenever something is measured between pairs of items: distances between cities, covariances between variables or undirected networks of contacts. Symmetry lets you store only half of the data and simplifies many computations.

05 · Antisymmetric

Antisymmetric matrices

It is the "sign-changed" version of the symmetric matrix: mirrored entries are equal in value but have opposite sign.

Antisymmetric matrixAt = −A, that is, aij = −aji. It is always square.See why
Sum of antisymmetric matricesThe sum of two antisymmetric matrices is antisymmetric.See why
  1. 1Worked example. The diagonal is all 0 and each entry has its opposite across from it: 1 and −1, 2 and −2, 3 and −3.A=(012−103−2−30)A = \begin{pmatrix} 0 & 1 & 2 \\ -1 & 0 & 3 \\ -2 & -3 & 0 \end{pmatrix}
  2. 2Its transpose is −A: every entry changes sign.At=(0−1−210−3230)=−AA^t = \begin{pmatrix} 0 & -1 & -2 \\ 1 & 0 & -3 \\ 2 & 3 & 0 \end{pmatrix} = -A

Properties

An antisymmetric matrix has a diagonal of zeros

At=−A  ⇒  aii=0A^t = -A \;\Rightarrow\; a_{ii} = 0

If Aᵗ = −A, then A is square and all its entries a_ii are 0.

See proof

Antisymmetric of odd order: determinant 0

At=−A, n=2k+1  ⇒  det⁡A=0A^t = -A,\ n = 2k + 1 \;\Rightarrow\; \det A = 0

An n × n antisymmetric matrix with n odd never has an inverse.

See proof

The square of an antisymmetric matrix is symmetric

At=−A  ⇒  (A2)t=A2A^t = -A \;\Rightarrow\; (A^2)^t = A^2

If Aᵗ = −A, then A² is symmetric (and the powers alternate: symmetric, antisymmetric...).

See proof

What it is for. They describe rotations and imbalances: the cross product is written with an antisymmetric matrix, and so is the rotation of a solid. The rule about the determinant of odd order is a shortcut to rule out an inverse without computing anything.

06 · Triangular

Triangular matrices

They have zeros on one side of the main diagonal. They are the matrices you aim for when solving systems, because with them the equations can be solved one at a time.

On the left, an upper triangular matrix: zeros below the diagonal (∗ is any number). On the right, a lower triangular matrix: zeros above the diagonal.

Upper triangularZeros below the diagonal: aij = 0 if i > j.
Lower triangularZeros above the diagonal: aij = 0 if i < j.
EchelonAn upper triangular matrix that is not square is called echelon. (A properly echelon matrix also requires the first non-zero entry of each row to lie to the right of the one in the row above.) It is the look a matrix has after Gaussian elimination.
The transpose changes typeTransposing swaps rows and columns, so what was below the diagonal ends up above it: the transpose of an upper triangular matrix is lower triangular, and that of a lower one is upper.
  1. 1Worked example. An upper triangular and a lower triangular matrix.U=(123045006),L=Ut=(100240356)U = \begin{pmatrix} 1 & 2 & 3 \\ 0 & 4 & 5 \\ 0 & 0 & 6 \end{pmatrix},\qquad L = U^t = \begin{pmatrix} 1 & 0 & 0 \\ 2 & 4 & 0 \\ 3 & 5 & 6 \end{pmatrix}
  2. 2A non-square upper triangular matrix (2 × 3): zeros below the diagonal.(123045)\begin{pmatrix} 1 & 2 & 3 \\ 0 & 4 & 5 \end{pmatrix}

Properties

Product of upper triangular matrices

cij=0 (i>j),cii=aii biic_{ij} = 0\ (i > j),\qquad c_{ii} = a_{ii}\, b_{ii}

The product of two upper triangular matrices is upper triangular and its diagonal is the product of the diagonals.

See proof

The inverse of an upper triangular matrix is upper triangular

A x=ej  ⇒  xi=0 (i>j)A\, x = e_j \;\Rightarrow\; x_i = 0\ (i > j)

An upper triangular matrix that has an inverse has an inverse that is still upper triangular.

See proof

What it is for. A system with a triangular matrix is solved by working from the bottom up (or from the top down), with no further computation. That is why the aim of Gaussian elimination is to turn any matrix into a triangular or echelon one.

07 · Decomposition

Symmetric + antisymmetric

Every square matrix splits in exactly one way as the sum of a symmetric matrix and an antisymmetric matrix.

Every square matrix = symmetric + antisymmetric

A=A+At2⏟S+A−At2⏟KA = \underbrace{\frac{A + A^t}{2}}_{S} + \underbrace{\frac{A - A^t}{2}}_{K}

Any square matrix can be written in exactly one way as the sum of a symmetric and an antisymmetric matrix.

See proof
  1. 1Worked example with the matrix A. First its transpose, swapping rows and columns.A=(1423),At=(1243)A = \begin{pmatrix} 1 & 4 \\ 2 & 3 \end{pmatrix},\qquad A^t = \begin{pmatrix} 1 & 2 \\ 4 & 3 \end{pmatrix}
  2. 2Symmetric part: add A and Aᵗ and divide by 2.S=A+At2=12(2666)=(1333)S = \frac{A + A^t}{2} = \frac{1}{2}\begin{pmatrix} 2 & 6 \\ 6 & 6 \end{pmatrix} = \begin{pmatrix} 1 & 3 \\ 3 & 3 \end{pmatrix}
  3. 3Antisymmetric part: subtract Aᵗ from A and divide by 2.K=A−At2=12(02−20)=(01−10)K = \frac{A - A^t}{2} = \frac{1}{2}\begin{pmatrix} 0 & 2 \\ -2 & 0 \end{pmatrix} = \begin{pmatrix} 0 & 1 \\ -1 & 0 \end{pmatrix}
  4. 4Check: the sum gives A back.S+K=(1333)+(01−10)=(1423)=AS + K = \begin{pmatrix} 1 & 3 \\ 3 & 3 \end{pmatrix} + \begin{pmatrix} 0 & 1 \\ -1 & 0 \end{pmatrix} = \begin{pmatrix} 1 & 4 \\ 2 & 3 \end{pmatrix} = A

What it is for. It lets you separate any matrix into its "mirror" part and its "twist" part. It is used, for example, in materials physics: the deformation of a solid is the symmetric part and its rotation the antisymmetric part.

08 · Applications

What are the types of matrices for?

Data and tablesA spreadsheet is a matrix. Rows are individuals and columns are variables: the transpose swaps their roles.
Systems of equationsThey are written as AX = b. If A is triangular or diagonal, the system is solved almost effortlessly.
StatisticsThe covariance matrix is symmetric, and AᵗA and AAᵗ always are. They appear in regression and in principal component analysis.
Graphics and gamesRotating or stretching an object is multiplying by a matrix. Infinitesimal rotations are written with antisymmetric matrices.
NetworksThe adjacency matrix of an undirected network (friends on a social network) is symmetric; with directions it no longer is.
PhysicsThe strain tensor of a solid is symmetric and the rotation tensor is antisymmetric: the decomposition A = S + K separates them.
Proof

Transposing twice: (Aᵗ)ᵗ = A

(At)t=A(A^t)^t = A
  1. A=[aij]m×n  ⇒  At=[aji]n×mA = [a_{ij}]_{m \times n} \;\Rightarrow\; A^t = [a_{ji}]_{n \times m}

    The transpose Aᵗ is formed by swapping rows and columns: the entry in row j and column i of Aᵗ is a_ji. If A has m rows and n columns, Aᵗ has n rows and m columns. This also holds for rectangular matrices.

  2. A=(123456)  ⇒  At=(142536)A = \begin{pmatrix} 1 & 2 & 3 \\ 4 & 5 & 6 \end{pmatrix} \;\Rightarrow\; A^t = \begin{pmatrix} 1 & 4 \\ 2 & 5 \\ 3 & 6 \end{pmatrix}

    Example: A has 2 rows and 3 columns. Its first row (1, 2, 3) becomes the first column of Aᵗ, and its second row (4, 5, 6) becomes the second column. In the drawing, each colour follows a row of A to its column in Aᵗ.

  3. [(At)t]ij=[At]ji=aij[(A^t)^t]_{ij} = [A^t]_{ji} = a_{ij}

    Now transpose Aᵗ. Its entry in row i, column j is the entry of Aᵗ in row j, column i, which in turn is a_ij. In other words, the two swaps of indices cancel each other.

  4. (At)t=A(A^t)^t = A

    Both matrices have the same size (m × n) and the same entry in every position, so they are equal: (Aᵗ)ᵗ = A.

What it's for

This is the rule that lets you simplify any expression with transposes: two transpositions in a row disappear. It also shows that transposing is reversible: no information is ever lost.

Proof

Transpose of a product: (AB)ᵗ = BᵗAᵗ

(AB)t=BtAt(AB)^t = B^t A^t
  1. A∈Mn×p, B∈Mp×m  ⇒  AB∈Mn×m, (AB)t∈Mm×nA \in M_{n \times p},\ B \in M_{p \times m} \;\Rightarrow\; AB \in M_{n \times m},\ (AB)^t \in M_{m \times n}

    To multiply, the columns of A must match the rows of B: A is n × p and B is p × m. The product AB is n × m, so (AB)ᵗ is m × n.

  2. Bt∈Mm×p, At∈Mp×n  ⇒  BtAt∈Mm×nB^t \in M_{m \times p},\ A^t \in M_{p \times n} \;\Rightarrow\; B^t A^t \in M_{m \times n}

    Bᵗ is m × p and Aᵗ is p × n: now the columns of Bᵗ (p) match the rows of Aᵗ (p), so BᵗAᵗ can be computed and is m × n. It has the same size as (AB)ᵗ; in the order AᵗBᵗ the product would not even be defined in general. In the drawing, the size p that cancels out is in green.

  3. [(AB)t]ij=(AB)ji=∑k=1pajk bki[(AB)^t]_{ij} = (AB)_{ji} = \sum_{k=1}^{p} a_{jk}\, b_{ki}

    Entry (i, j) of (AB)ᵗ is entry (j, i) of AB: row j of A times column i of B, that is, the sum of the products a_jk · b_ki.

  4. [BtAt]ij=∑k=1p(Bt)ik (At)kj=∑k=1pbki ajk[B^t A^t]_{ij} = \sum_{k=1}^{p} (B^t)_{ik}\, (A^t)_{kj} = \sum_{k=1}^{p} b_{ki}\, a_{jk}

    Entry (i, j) of BᵗAᵗ is row i of Bᵗ times column j of Aᵗ. Row i of Bᵗ is column i of B (entries b_ki) and column j of Aᵗ is row j of A (entries a_jk).

  5. (AB)t=BtAt(AB)^t = B^t A^t

    The two sums are equal term by term (multiplication of real numbers is commutative), so (AB)ᵗ = BᵗAᵗ.

  6. A=(120312), B=(102103):(AB)t=(5527)=BtAtA = \begin{pmatrix} 1 & 2 & 0 \\ 3 & 1 & 2 \end{pmatrix},\ B = \begin{pmatrix} 1 & 0 \\ 2 & 1 \\ 0 & 3 \end{pmatrix}:\quad (AB)^t = \begin{pmatrix} 5 & 5 \\ 2 & 7 \end{pmatrix} = B^t A^t

    Numerical check with rectangular matrices: AB = ((5, 2), (5, 7)), so (AB)ᵗ = ((5, 5), (2, 7)). Computing BᵗAᵗ separately gives exactly the same matrix.

What it's for

You use it whenever a transpose sits in front of a product: it is the key to proving that AAᵗ is symmetric, that the inverse of a symmetric matrix is symmetric, and many more properties. The order reversal is the same as when you put on socks and shoes and then take them off.

Proof

AAᵗ and AᵗA are always symmetric

(AAt)t=AAt,(AtA)t=AtA(AA^t)^t = AA^t,\qquad (A^tA)^t = A^tA
  1. A∈Mm×n  ⇒  AAt∈Mm×m,  AtA∈Mn×nA \in M_{m \times n} \;\Rightarrow\; AA^t \in M_{m \times m},\ \ A^tA \in M_{n \times n}

    If A is m × n (it need not be square), AAᵗ is m × m and AᵗA is n × n. Both are square, and only square matrices can be symmetric.

  2. (AAt)t=(At)tAt(AA^t)^t = (A^t)^t A^t

    Transpose AAᵗ with the product rule, (XY)ᵗ = YᵗXᵗ, taking X = A and Y = Aᵗ. The order is reversed and we get (Aᵗ)ᵗ Aᵗ.

  3. (AAt)t=AAt(AA^t)^t = AA^t

    Since (Aᵗ)ᵗ = A, the result is AAᵗ. The matrix equals its transpose: it is symmetric.

  4. (AtA)t=At(At)t=AtA(A^tA)^t = A^t (A^t)^t = A^tA

    The same happens with AᵗA: (AᵗA)ᵗ = Aᵗ(Aᵗ)ᵗ = AᵗA.

  5. A=(120312):AAt=(55514),AtA=(1056552624)A = \begin{pmatrix} 1 & 2 & 0 \\ 3 & 1 & 2 \end{pmatrix}:\quad AA^t = \begin{pmatrix} 5 & 5 \\ 5 & 14 \end{pmatrix},\quad A^tA = \begin{pmatrix} 10 & 5 & 6 \\ 5 & 5 & 2 \\ 6 & 2 & 4 \end{pmatrix}

    Example with a 2 × 3 matrix A. AAᵗ is 2 × 2 and its entry (i, j) is row i of A times row j of A; that is why it equals entry (j, i). AᵗA is 3 × 3 and its entries are products of columns of A. In both cases the entries that mirror each other across the diagonal (same colour in the drawing) are equal.

What it's for

It is the quickest way to build symmetric matrices from any matrix, which is why they appear all the time: in least squares (AᵗA), in statistics (covariance matrices) and in the pseudoinverse.

Proof

The inverse of a symmetric matrix is symmetric

A=At  ⇒  (A−1)t=A−1A = A^t \;\Rightarrow\; (A^{-1})^t = A^{-1}
  1. (A−1A)t=At(A−1)t(A^{-1}A)^t = A^t (A^{-1})^t

    We start from A being invertible, that is, there is an A⁻¹ with A⁻¹A = I. Transpose that equality with the product rule: (A⁻¹A)ᵗ = Aᵗ(A⁻¹)ᵗ.

  2. (A−1A)t=It=I  ⇒  At(A−1)t=I(A^{-1}A)^t = I^t = I \;\Rightarrow\; A^t (A^{-1})^t = I

    The transpose of the identity is the identity itself (I is symmetric). Therefore Aᵗ(A⁻¹)ᵗ = I.

  3. At=A  ⇒  A (A−1)t=IA^t = A \;\Rightarrow\; A\, (A^{-1})^t = I

    Since A is symmetric, Aᵗ = A. Substituting gives A(A⁻¹)ᵗ = I.

  4. A−1A (A−1)t=A−1I  ⇒  (A−1)t=A−1A^{-1} A\, (A^{-1})^t = A^{-1} I \;\Rightarrow\; (A^{-1})^t = A^{-1}

    Multiply on the left by A⁻¹ on both sides: A⁻¹A(A⁻¹)ᵗ = A⁻¹I. On the left A⁻¹A = I, and on the right A⁻¹I = A⁻¹. Result: (A⁻¹)ᵗ = A⁻¹.

  5. A=(2111),A−1=(1−1−12)A = \begin{pmatrix} 2 & 1 \\ 1 & 1 \end{pmatrix},\quad A^{-1} = \begin{pmatrix} 1 & -1 \\ -1 & 2 \end{pmatrix}

    Example: A = ((2, 1), (1, 1)) is symmetric and its inverse is ((1, −1), (−1, 2)). Multiplying checks that AA⁻¹ = I, and the inverse is symmetric too: the two −1 entries match.

What it's for

It lets you solve systems with symmetric matrices knowing the inverse keeps that structure, which saves memory and work in numerical methods.

Proof

The product of symmetric matrices is symmetric only if AB = BA

A=At, B=Bt:(AB)t=AB  ⟺  AB=BAA = A^t,\ B = B^t:\qquad (AB)^t = AB \iff AB = BA
  1. (AB)t=BtAt(AB)^t = B^t A^t

    Apply the rule for the transpose of a product: (AB)ᵗ = BᵗAᵗ.

  2. (AB)t=BA(AB)^t = BA

    Since A and B are symmetric, Bᵗ = B and Aᵗ = A. Then (AB)ᵗ = BA.

  3. (AB)t=AB  ⟺  BA=AB(AB)^t = AB \iff BA = AB

    AB is symmetric when (AB)ᵗ = AB. Using the previous step, that is equivalent to BA = AB: the product is symmetric exactly when A and B commute (they can be multiplied in either order).

  4. A=(1002), B=(0110):AB=(0120)≠(0210)=BAA = \begin{pmatrix} 1 & 0 \\ 0 & 2 \end{pmatrix},\ B = \begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix}:\quad AB = \begin{pmatrix} 0 & 1 \\ 2 & 0 \end{pmatrix} \neq \begin{pmatrix} 0 & 2 \\ 1 & 0 \end{pmatrix} = BA

    Counterexample: A and B are symmetric, but AB = ((0, 1), (2, 0)) is not (a 1 against a 2) and BA = ((0, 2), (1, 0)) is different from AB. In the drawing, the red cells should be equal and are not.

  5. A=(1221), B=(3443):AB=BA=(11101011)A = \begin{pmatrix} 1 & 2 \\ 2 & 1 \end{pmatrix},\ B = \begin{pmatrix} 3 & 4 \\ 4 & 3 \end{pmatrix}:\quad AB = BA = \begin{pmatrix} 11 & 10 \\ 10 & 11 \end{pmatrix}

    An example where it does work: with these A and B we get AB = BA = ((11, 10), (10, 11)), which is symmetric.

What it's for

It warns about a very common mistake: you cannot assume that the product of symmetric matrices is symmetric. It is symmetric in important cases, such as powers of the same matrix (A · A = A²) or two diagonal matrices.

Proof

Sum of symmetric and sum of antisymmetric matrices

(A+B)t=At+Bt(A + B)^t = A^t + B^t
  1. [(A+B)t]ij=(A+B)ji=aji+bji=[At+Bt]ij[(A + B)^t]_{ij} = (A + B)_{ji} = a_{ji} + b_{ji} = [A^t + B^t]_{ij}

    The transpose of a sum is the sum of the transposes: entry (i, j) of (A + B)ᵗ is entry (j, i) of A + B, that is, a_ji + b_ji, which is entry (i, j) of Aᵗ + Bᵗ.

  2. At=A, Bt=B  ⇒  (A+B)t=A+BA^t = A,\ B^t = B \;\Rightarrow\; (A + B)^t = A + B

    If A and B are symmetric (Aᵗ = A and Bᵗ = B), then (A + B)ᵗ = A + B: the sum is symmetric.

  3. At=−A, Bt=−B  ⇒  (A+B)t=−A−B=−(A+B)A^t = -A,\ B^t = -B \;\Rightarrow\; (A + B)^t = -A - B = -(A + B)

    If A and B are antisymmetric (Aᵗ = −A and Bᵗ = −B), then (A + B)ᵗ = −A − B = −(A + B): the sum is antisymmetric.

  4. (1223)+(0554)=(1777)\begin{pmatrix} 1 & 2 \\ 2 & 3 \end{pmatrix} + \begin{pmatrix} 0 & 5 \\ 5 & 4 \end{pmatrix} = \begin{pmatrix} 1 & 7 \\ 7 & 7 \end{pmatrix}

    Example with symmetric matrices: the entries that mirror each other across the diagonal (2 and 2, 5 and 5) are added to each other and give 7 and 7.

  5. (01−10)+(02−20)=(03−30)\begin{pmatrix} 0 & 1 \\ -1 & 0 \end{pmatrix} + \begin{pmatrix} 0 & 2 \\ -2 & 0 \end{pmatrix} = \begin{pmatrix} 0 & 3 \\ -3 & 0 \end{pmatrix}

    Example with antisymmetric matrices: the diagonal is still 0 and the opposite entries 1 and −1, 2 and −2 give 3 and −3.

What it's for

It means the symmetric matrices form a set closed under addition (and under multiplication by a number), and so do the antisymmetric ones. You can add and combine them without losing the structure.

Proof

An antisymmetric matrix has a diagonal of zeros

At=−A  ⇒  aii=0A^t = -A \;\Rightarrow\; a_{ii} = 0
  1. At=−A  ⇒  aji=−aij(∀ i,j)A^t = -A \;\Rightarrow\; a_{ji} = -a_{ij} \quad (\forall\, i, j)

    Aᵗ = −A means, entry by entry, that a_ji = −a_ij for all i and j: entries that mirror each other across the diagonal are equal in size but of opposite sign.

  2. m×n=n×m  ⇒  m=nm \times n = n \times m \;\Rightarrow\; m = n

    If A is m × n, Aᵗ is n × m. For Aᵗ = −A to hold they must have the same size, so m = n. An antisymmetric matrix is always square (the notes say "not always square", but the condition forces it).

  3. i=j:aii=−aiii = j:\quad a_{ii} = -a_{ii}

    On the diagonal i = j, the relation of the first step says a_ii = −a_ii: each entry equals its own opposite.

  4. 2 aii=0  ⇒  aii=02\, a_{ii} = 0 \;\Rightarrow\; a_{ii} = 0

    Moving the term to the other side, 2a_ii = 0 and, since 2 ≠ 0, a_ii = 0.

  5. A=(012−103−2−30)A = \begin{pmatrix} 0 & 1 & 2 \\ -1 & 0 & 3 \\ -2 & -3 & 0 \end{pmatrix}

    Example: in the drawing, the diagonal (pink) is 0 and each entry has its opposite across from it in the same colour: 1 and −1, 2 and −2, 3 and −3.

What it's for

It lets you recognise an antisymmetric matrix at a glance: a diagonal of zeros and mirrored opposite entries. You only need the entries above the diagonal, because the rest follow from them.

Proof

Antisymmetric of odd order: determinant 0

At=−A, n=2k+1  ⇒  det⁡A=0A^t = -A,\ n = 2k + 1 \;\Rightarrow\; \det A = 0
  1. det⁡(At)=det⁡A\det(A^t) = \det A

    The determinant does not change when transposing: det(Aᵗ) = det(A). (A well-known property of determinants.)

  2. det⁡(−A)=(−1)ndet⁡A\det(-A) = (-1)^n \det A

    Multiplying the whole matrix by −1 takes a factor −1 out of each of the n rows: det(−A) = (−1)ⁿ det(A).

  3. det⁡A=det⁡(At)=det⁡(−A)=(−1)ndet⁡A\det A = \det(A^t) = \det(-A) = (-1)^n \det A

    Since Aᵗ = −A, the two determinants above are equal: det(A) = det(Aᵗ) = det(−A) = (−1)ⁿ det(A).

  4. n=2k+1  ⇒  (−1)n=−1  ⇒  det⁡A=−det⁡An = 2k + 1 \;\Rightarrow\; (-1)^n = -1 \;\Rightarrow\; \det A = -\det A

    If n is odd (n = 2k + 1), (−1)ⁿ = −1 and we get det(A) = −det(A).

  5. 2det⁡A=0  ⇒  det⁡A=02 \det A = 0 \;\Rightarrow\; \det A = 0

    Then 2 det(A) = 0 and det(A) = 0. A square matrix has an inverse only if its determinant is not 0, so this one has none.

  6. det⁡A=0⋅(0⋅0−3⋅(−3))−1⋅((−1)⋅0−3⋅(−2))+2⋅((−1)(−3)−0⋅(−2))=0−6+6=0\det A = 0 \cdot \bigl(0 \cdot 0 - 3 \cdot (-3)\bigr) - 1 \cdot \bigl((-1) \cdot 0 - 3 \cdot (-2)\bigr) + 2 \cdot \bigl((-1)(-3) - 0 \cdot (-2)\bigr) = 0 - 6 + 6 = 0

    Example: expanding the 3 × 3 antisymmetric matrix of the drawing along the first row gives 0 · 9 − 1 · 6 + 2 · 3 = 0 − 6 + 6 = 0.

What it's for

A very useful shortcut: an antisymmetric 3 × 3, 5 × 5, etc. is singular without computing anything. With even order it can have an inverse; for example ((0, 1), (−1, 0)) has determinant 1.

Proof

The square of an antisymmetric matrix is symmetric

At=−A  ⇒  (A2)t=A2A^t = -A \;\Rightarrow\; (A^2)^t = A^2
  1. (A2)t=(AA)t=AtAt(A^2)^t = (AA)^t = A^t A^t

    Transpose A² = AA with the product rule: (AA)ᵗ = AᵗAᵗ.

  2. (A2)t=(−A)(−A)=A2(A^2)^t = (-A)(-A) = A^2

    Since Aᵗ = −A, we get (−A)(−A). The two minus signs cancel and the result is A². So (A²)ᵗ = A²: it is symmetric.

  3. A=(012−103−2−30):A2=(−5−63−6−10−23−2−13)A = \begin{pmatrix} 0 & 1 & 2 \\ -1 & 0 & 3 \\ -2 & -3 & 0 \end{pmatrix}:\quad A^2 = \begin{pmatrix} -5 & -6 & 3 \\ -6 & -10 & -2 \\ 3 & -2 & -13 \end{pmatrix}

    Example with the 3 × 3 antisymmetric matrix: although A has zeros on its diagonal, A² has −5, −10 and −13, and the mirrored entries (−6 and −6, 3 and 3, −2 and −2) coincide.

  4. (Ak)t=(At)k=(−A)k=(−1)kAk(A^k)^t = (A^t)^k = (-A)^k = (-1)^k A^k

    More generally, (Aᵏ)ᵗ = (Aᵗ)ᵏ = (−A)ᵏ = (−1)ᵏAᵏ. Even powers are symmetric and odd powers are antisymmetric.

What it's for

It shows that "antisymmetric" is not preserved by multiplication: only odd powers are. It appears, for example, in the cross product and in infinitesimal rotations in physics.

Proof

Product of upper triangular matrices

cij=0 (i>j),cii=aii biic_{ij} = 0\ (i > j),\qquad c_{ii} = a_{ii}\, b_{ii}
  1. aik=0 (i>k),bkj=0 (k>j)a_{ik} = 0\ (i > k),\qquad b_{kj} = 0\ (k > j)

    Upper triangular means everything below the diagonal is 0: a_ik = 0 if i > k, and b_kj = 0 if k > j.

  2. C=AB:cij=∑k=1naik bkjC = AB:\quad c_{ij} = \sum_{k=1}^{n} a_{ik}\, b_{kj}

    Entry (i, j) of C = AB is row i of A times column j of B: c_ij is the sum of the products a_ik · b_kj, with k from 1 to n.

  3. i>j:k<i⇒aik=0,k≥i>j⇒bkj=0i > j:\quad k < i \Rightarrow a_{ik} = 0, \qquad k \geq i > j \Rightarrow b_{kj} = 0

    Take an entry of C below the diagonal (i > j) and look at each term. If k < i, then a_ik = 0. If k ≥ i, since i > j we have k > j and then b_kj = 0. Every term has a zero factor.

  4. cij=0+0+⋯+0=0(i>j)c_{ij} = 0 + 0 + \dots + 0 = 0 \qquad (i > j)

    Therefore c_ij = 0 for i > j: AB has zeros below the diagonal, so it is upper triangular.

  5. cii=∑k=1naik bki=aii biic_{ii} = \sum_{k=1}^{n} a_{ik}\, b_{ki} = a_{ii}\, b_{ii}

    On the diagonal (i = j), the term a_ik · b_ki can only be non-zero if k ≥ i (because of A) and k ≤ i (because of B), that is, for k = i. So c_ii = a_ii · b_ii.

  6. (123045006)(210031005)=(2717012290030)\begin{pmatrix} 1 & 2 & 3 \\ 0 & 4 & 5 \\ 0 & 0 & 6 \end{pmatrix} \begin{pmatrix} 2 & 1 & 0 \\ 0 & 3 & 1 \\ 0 & 0 & 5 \end{pmatrix} = \begin{pmatrix} 2 & 7 & 17 \\ 0 & 12 & 29 \\ 0 & 0 & 30 \end{pmatrix}

    Example: the diagonals 1, 4, 6 and 2, 3, 5 give 1·2 = 2, 4·3 = 12 and 6·5 = 30, exactly the diagonal of the product. The zeros stay below.

  7. (AB)t=BtAt(AB)^t = B^t A^t

    For lower triangular matrices use the transpose: Aᵗ and Bᵗ are upper, so (AB)ᵗ = BᵗAᵗ is upper and, therefore, AB is lower.

What it's for

It lets you compute powers and determinants of triangular matrices with no effort: the diagonal of Aⁿ is the diagonal of A raised to the n.

Proof

The inverse of an upper triangular matrix is upper triangular

A x=ej  ⇒  xi=0 (i>j)A\, x = e_j \;\Rightarrow\; x_i = 0\ (i > j)
  1. AA−1=I  ⇒  A x=ej(x=(A−1)∙j)A A^{-1} = I \;\Rightarrow\; A\, x = e_j \quad \bigl(x = (A^{-1})_{\bullet j}\bigr)

    Column j of A⁻¹, which we call x, satisfies A·x = e_j, where e_j is column j of the identity (a 1 in position j and zeros elsewhere). This comes from AA⁻¹ = I read column by column.

  2. ann xn=(ej)n,ann≠0a_{nn}\, x_n = (e_j)_n, \qquad a_{nn} \neq 0

    Since A is upper triangular, its last equation has a single unknown: a_nn · x_n = (e_j)_n. Moreover a_nn ≠ 0, because the determinant is the product of the diagonal and A has an inverse.

  3. j<n:xn=0,  xn−1=0, …, xj+1=0j < n:\quad x_n = 0,\ \ x_{n-1} = 0,\ \dots,\ x_{j+1} = 0

    If j < n, the right-hand side is 0 and x_n = 0. Going up the equations: the previous one is a_(n−1,n−1)·x_(n−1) + a_(n−1,n)·x_n = 0 and, with x_n = 0, we get x_(n−1) = 0. Keep going in the same way until x_(j+1) = 0.

  4. (A−1)ij=xi=0(i>j)(A^{-1})_{ij} = x_i = 0 \qquad (i > j)

    So the entries of column j of A⁻¹ below the diagonal (row i > j) are 0: the inverse is upper triangular.

  5. (123014001)(1−2501−4001)=(100010001)\begin{pmatrix} 1 & 2 & 3 \\ 0 & 1 & 4 \\ 0 & 0 & 1 \end{pmatrix} \begin{pmatrix} 1 & -2 & 5 \\ 0 & 1 & -4 \\ 0 & 0 & 1 \end{pmatrix} = \begin{pmatrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{pmatrix}

    Example: A⁻¹ = ((1, −2, 5), (0, 1, −4), (0, 0, 1)) multiplied by A gives the identity. The zeros below the diagonal stay in the inverse.

What it's for

Inverting a triangular matrix is much cheaper than a general one: back substitution is enough. It is the basis of how systems are solved in practice, after reducing them to triangular form. For lower triangular matrices the same argument works with the transpose.

Proof

Every square matrix = symmetric + antisymmetric

A=A+At2⏟S+A−At2⏟KA = \underbrace{\frac{A + A^t}{2}}_{S} + \underbrace{\frac{A - A^t}{2}}_{K}
  1. St=At+(At)t2=At+A2=SS^t = \frac{A^t + (A^t)^t}{2} = \frac{A^t + A}{2} = S

    Call S = (A + Aᵗ)/2. Its transpose is (Aᵗ + (Aᵗ)ᵗ)/2 = (Aᵗ + A)/2 = S, so S is symmetric.

  2. Kt=At−(At)t2=At−A2=−KK^t = \frac{A^t - (A^t)^t}{2} = \frac{A^t - A}{2} = -K

    Call K = (A − Aᵗ)/2. Its transpose is (Aᵗ − A)/2, which is the opposite of K, so K is antisymmetric.

  3. S+K=A+At+A−At2=2A2=AS + K = \frac{A + A^t + A - A^t}{2} = \frac{2A}{2} = A

    Adding them, the Aᵗ terms cancel: S + K = (2A)/2 = A. This proves the decomposition.

  4. A=(1423):A+At=(2666),A−At=(02−20)A = \begin{pmatrix} 1 & 4 \\ 2 & 3 \end{pmatrix}:\quad A + A^t = \begin{pmatrix} 2 & 6 \\ 6 & 6 \end{pmatrix},\quad A - A^t = \begin{pmatrix} 0 & 2 \\ -2 & 0 \end{pmatrix}

    Example with A = ((1, 4), (2, 3)): A + Aᵗ = ((2, 6), (6, 6)) and A − Aᵗ = ((0, 2), (−2, 0)).

  5. S=(1333),K=(01−10),S+K=(1423)S = \begin{pmatrix} 1 & 3 \\ 3 & 3 \end{pmatrix},\quad K = \begin{pmatrix} 0 & 1 \\ -1 & 0 \end{pmatrix},\quad S + K = \begin{pmatrix} 1 & 4 \\ 2 & 3 \end{pmatrix}

    Dividing by 2: S = ((1, 3), (3, 3)) and K = ((0, 1), (−1, 0)). In the drawing, the 4 and the 2 of A are shared out: their average 3 goes to S and half their difference (±1) goes to K. S + K gives A again.

  6. A=S′+K′  ⇒  At=S′−K′  ⇒  S′=A+At2, K′=A−At2A = S' + K' \;\Rightarrow\; A^t = S' - K' \;\Rightarrow\; S' = \frac{A + A^t}{2},\ K' = \frac{A - A^t}{2}

    The decomposition is unique: if A = S' + K' with S' symmetric and K' antisymmetric, transposing gives Aᵗ = S' − K'. Adding and subtracting with A produces exactly the formulas for S and K.

What it's for

It lets you study any matrix by separating its "mirror" part (symmetric) from its "twist" part (antisymmetric). It is used, for example, in solid mechanics, where strain is the symmetric part and rotation the antisymmetric one.

Found this useful?

This guide is free and ad-free. If it helps you study, you can buy me a coffee.

Buy me a coffee