Skip to content
Tutorials Center
My learning

Topics

Lesson 10 of 62 ยท Matrices

Transpose and Symmetric Matrices

Learn the rules of the transpose, why (AB)^T reverses the order, how to recognize symmetric and skew-symmetric matrices, and why A^T A is always symmetric.

You already know that the transpose swaps rows and columns. In this lesson you will see how it interacts with matrix multiplication, which is where it becomes more than a bookkeeping trick. The central rule is that the transpose of a product reverses the order: (AB)^T = B^T A^T.

You will also meet two important families of square matrices. A symmetric matrix equals its own transpose. A skew-symmetric matrix equals the negative of its transpose. Symmetric matrices show up everywhere in practice (covariance matrices, distance tables, second derivatives) and they have unusually nice properties that you will use in the spectral theorem. Finally, we will show that the matrix A^T A is always symmetric, no matter what A is.

Rules for the transpose

For matrices with compatible shapes and a scalar c:

  • (A^T)^T = A
  • (A + B)^T = A^T + B^T
  • (cA)^T = c A^T
  • (AB)^T = B^T A^T

The last one is the surprising one. Check the shapes: if A is m by n and B is n by p, then AB is m by p, so (AB)^T is p by m. Meanwhile B^T is p by n and A^T is n by m, so B^T A^T is p by m. The order A^T B^T would usually not even exist. The same reversal appears when you take the inverse of a product, as you will see in Inverse Matrices.

For a chain of three, (ABC)^T = C^T B^T A^T. A good mental picture is socks and shoes: you put socks on first and shoes second, but to undo it you remove the shoes first.

Python The transpose reverses a product

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Symmetric matrices

A square matrix S is symmetric if S^T = S, meaning S[i, j] = S[j, i] for every pair. The matrix is a mirror image across its main diagonal.

TEXT
[ 2  -1   0]
[-1   2  -1]
[ 0  -1   2]

Where do symmetric matrices come from? A table of distances between cities is symmetric, since the distance from A to B equals the distance from B to A. So is a covariance matrix, a correlation table, the adjacency matrix of an undirected graph, and any identity or diagonal matrix.

Mirror images

Symmetric S equals its transpose: entries mirror across the diagonal.
Skew-symmetric K equals minus its transpose: mirrored entries flip sign.

Both must be square matrices.

1 / 2

Sums and scalar multiples of symmetric matrices are symmetric. Products are not always symmetric: if S and T are symmetric then (ST)^T = T^T S^T = TS, which equals ST only when S and T commute.

Python Testing for symmetry

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

For floating-point data, compare with np.allclose(M, M.T) instead of exact equality, because tiny rounding differences are common.

Skew-symmetric matrices

A square matrix K is skew-symmetric if K^T = -K, so K[i, j] = -K[j, i]. Taking i = j gives K[i, i] = -K[i, i], which forces every diagonal entry to be 0.

TEXT
[ 0   2  -3]
[-2   0   5]
[ 3  -5   0]

In three dimensions, skew-symmetric matrices are closely tied to the cross product: a cross product with a fixed vector is a multiplication by a skew-symmetric matrix.

A neat fact: any square matrix is a sum of a symmetric part and a skew-symmetric part:

TEXT
A = (A + A^T)/2  +  (A - A^T)/2

The first term is symmetric and the second is skew-symmetric, and the split is unique.

Python Symmetric plus skew-symmetric

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Properties of skew-symmetric matrices

The split A = S + K is more than a curiosity, because the skew part behaves very differently from the symmetric part. For a real skew-symmetric matrix K (Kแต€ = -K), four facts hold.

  1. xแต€ K x = 0 for every vector x. The number xแต€Kx is its own transpose, xแต€Kแต€x = -xแต€Kx, so it equals its own negative and must be 0. A skew-symmetric matrix never "has energy": Kx is always perpendicular to x, which is why K generates rotations.
  2. The eigenvalues are zero or purely imaginary, and they come in conjugate pairs ยฑbi. (If Kv = ฮปv then ฮปโ€–vโ€–ยฒ = v^H K v, which is purely imaginary.)
  3. For odd size, det K = 0. From det K = det Kแต€ = det(-K) = (-1)^n det K, an odd n forces det K = 0. So an odd-dimensional skew-symmetric matrix is always singular, with at least one zero eigenvalue. For even size the determinant is the square of a polynomial in the entries (the Pfaffian) and is never negative.
  4. The matrix exponential e^K is orthogonal, a rotation. Skew-symmetric matrices are the "infinitesimal rotations": e^(tK) rotates by an amount that grows with t. This is how rotations are parameterized in robotics and 3D graphics, and it ties to the cross product: in 3D, K with entries [[0, -c, b], [c, 0, -a], [-b, a, 0]] computes K x = (a, b, c) ร— x.

The symmetric part carries all of the quadratic form: xแต€Ax = xแต€Sx, because the skew part contributes nothing. That is why quadratic forms and positive definiteness only ever depend on the symmetric part of a matrix.

Python Skew-symmetric facts: zero energy, imaginary eigenvalues, rotation by exponential

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

For odd sizes the determinant comes out as 0, for even sizes it is a nonnegative number, and the exponential of the 3 ร— 3 skew matrix is a genuine rotation about the axis (a, b, c) by an angle equal to 0.7 times the length of that vector.

Why A^T A is always symmetric

Take any matrix A, even a rectangular one. Then A^T A is square, and using the product rule:

TEXT
(A^T A)^T = A^T (A^T)^T = A^T A

So it equals its own transpose. If A is m by n, then A^T A is n by n, and A A^T is m by m; both are symmetric.

These matrices are very useful. The entry (i, j) of A^T A is the dot product of column i with column j of A, so the matrix records all the pairwise dot products of the columns. Its diagonal holds the squared lengths of the columns. This is the engine behind least squares and the SVD.

Python The Gram matrix A^T A

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. What is (AB)^T equal to?

    The transpose of a product reverses the order of the factors.
  2. 2. What must be true of the diagonal of a skew-symmetric matrix?

    K[i,i] = -K[i,i] forces each diagonal entry to be zero.
  3. 3. A has shape (5, 3). What is true about A^T A?

    A^T is 3 by 5, so A^T A is 3 by 3, and (A^T A)^T = A^T A.
  4. 4. The product of two symmetric matrices S and T is symmetric when...

    (ST)^T = T S, which equals ST only when the two matrices commute.

Summary

  • (A + B)^T = A^T + B^T, (cA)^T = cA^T and (AB)^T = B^T A^T (order reverses).
  • Symmetric means S^T = S; skew-symmetric means K^T = -K with zeros on the diagonal.
  • Every square matrix splits uniquely into a symmetric and a skew-symmetric part.
  • A^T A and A A^T are always symmetric; their entries are dot products of columns or rows.
  • With floats, test symmetry with np.allclose, not exact equality.

Next: put matrices to work on equations in Systems of Linear Equations.