Linear Algebra
5.58 min read

Triple Products and the Row Perspective

Given an m×nm \times n matrix AA, a vector xRn\mathbf{x} \in \mathbb{R}^n, and a vector yRm\mathbf{y} \in \mathbb{R}^m, the expression ytAx\mathbf{y}^t A \mathbf{x} is a product of three matrices: a 1×m1 \times m, an m×nm \times n, and an n×1n \times 1. The result is a 1×11 \times 1 matrix — just a real number.

Expanding, ytAx=i,jyiaijxj\mathbf{y}^t A \mathbf{x} = \sum_{i,j} y_i a_{ij} x_j. Since transposing a 1×11 \times 1 matrix does nothing, we also have ytAx=xtAty\mathbf{y}^t A \mathbf{x} = \mathbf{x}^t A^t \mathbf{y}. This symmetry is surprisingly useful.

The expression AtyA^t \mathbf{y} also has a clean row interpretation: the ii-th entry of AtyA^t \mathbf{y} is the dot product of the ii-th column of AA with y\mathbf{y}. This bridges the column and row perspectives of a linear map.

Formal View

Definition 5.9 — Triple Product
For ARm×nA \in \mathbb{R}^{m \times n}, xRn\mathbf{x} \in \mathbb{R}^n, yRm\mathbf{y} \in \mathbb{R}^m, the triple product ytAxR\mathbf{y}^t A \mathbf{x} \in \mathbb{R} is defined as the scalar i,jyiaijxj\sum_{i,j} y_i a_{ij} x_j.
Remark 5.10
Since the result is a 1×11 \times 1 matrix and (1×1)t=1×1(1 \times 1)^t = 1 \times 1, we get the symmetry identity:
ytAx=xtAty\mathbf{y}^t A \mathbf{x} = \mathbf{x}^t A^t \mathbf{y}
Furthermore, (Aty)i=aiy(A^t \mathbf{y})_i = \mathbf{a}_i \cdot \mathbf{y} where ai\mathbf{a}_i is the ii-th column of AA.

Why This Matters

Triple products appear in variational calculus, optimization, and any setting where you measure the output of a linear map against a target.

  • Quadratic forms xtMx\mathbf{x}^t M \mathbf{x} (a triple product with y=x\mathbf{y} = \mathbf{x}) define energy, variance, and curvature in physics and statistics
  • The gradient of ytAx\mathbf{y}^t A \mathbf{x} with respect to x\mathbf{x} is AtyA^t \mathbf{y} — a formula used in every backpropagation derivation
  • In signal processing, matched filters use the triple product structure to detect signals in noise

Quiz

Question 1

For any AA, x\mathbf{x}, y\mathbf{y} of compatible sizes, ytAx=xtAty\mathbf{y}^t A \mathbf{x} = \mathbf{x}^t A^t \mathbf{y}.

Question 2

What is the ii-th entry of AtyA^t \mathbf{y}?

Common Mistakes

  • Confusing ytAx\mathbf{y}^t A \mathbf{x} with yt(Ax)\mathbf{y}^t (A \mathbf{x}) vs (ytA)x(\mathbf{y}^t A) \mathbf{x} — by associativity of matrix multiplication, these are the same scalar.
  • Forgetting the transpose flips when applying the symmetry: ytAx=xtAty\mathbf{y}^t A \mathbf{x} = \mathbf{x}^t A^t \mathbf{y}, not xtAy\mathbf{x}^t A \mathbf{y}.