Linear Algebra
6.47 min read

The Pythagorean Theorem

The classical Pythagorean theorem says that for a right triangle with legs a,ba, b and hypotenuse cc, we have a2+b2=c2a^2 + b^2 = c^2. The vector version says exactly the same thing: if uv\mathbf{u} \perp \mathbf{v}, then u+v2=u2+v2\|\mathbf{u} + \mathbf{v}\|^2 = \|\mathbf{u}\|^2 + \|\mathbf{v}\|^2.

The proof is a direct computation using the dot product. Expand u+v2=(u+v)(u+v)=uu+2uv+vv\|\mathbf{u} + \mathbf{v}\|^2 = (\mathbf{u} + \mathbf{v}) \cdot (\mathbf{u} + \mathbf{v}) = \mathbf{u}\cdot\mathbf{u} + 2\mathbf{u}\cdot\mathbf{v} + \mathbf{v}\cdot\mathbf{v}. The cross-term 2uv2\mathbf{u} \cdot \mathbf{v} vanishes exactly when uv\mathbf{u} \perp \mathbf{v}.

This result holds in all dimensions — not just 2D. Whenever two vectors are orthogonal, the squared length of their sum equals the sum of their squared lengths. This is the key behind many decompositions and error bounds.

Formal View

Theorem 6.8 — Pythagorean Theorem
Vectors u,vRm\mathbf{u}, \mathbf{v} \in \mathbb{R}^m are orthogonal if and only if
u+v2=u2+v2.\|\mathbf{u} + \mathbf{v}\|^2 = \|\mathbf{u}\|^2 + \|\mathbf{v}\|^2.

Proof: u+v2=(u+v)(u+v)=u2+2uv+v2\|\mathbf{u}+\mathbf{v}\|^2 = (\mathbf{u}+\mathbf{v})\cdot(\mathbf{u}+\mathbf{v}) = \|\mathbf{u}\|^2 + 2\,\mathbf{u}\cdot\mathbf{v} + \|\mathbf{v}\|^2. The 2uv2\mathbf{u}\cdot\mathbf{v} term vanishes iff uv\mathbf{u} \perp \mathbf{v}.

Why This Matters

The Pythagorean theorem is used to bound errors and measure approximation quality throughout applied mathematics.

  • Parseval's theorem in signal processing is the Pythagorean theorem for Fourier components — total power equals sum of powers at each frequency
  • In the best approximation theorem, the Pythagorean theorem proves that the projection is strictly closer than any other vector in the subspace
  • Variance decomposition in statistics (R2R^2) follows from the Pythagorean theorem applied to residuals and fitted values

Quiz

Question 1

For any two vectors u\mathbf{u} and v\mathbf{v}: u+v2=u2+v2\|\mathbf{u} + \mathbf{v}\|^2 = \|\mathbf{u}\|^2 + \|\mathbf{v}\|^2.

Question 2

If uv\mathbf{u} \perp \mathbf{v}, u=3\|\mathbf{u}\| = 3, and v=4\|\mathbf{v}\| = 4, what is u+v\|\mathbf{u} + \mathbf{v}\|?

Common Mistakes

  • Assuming u+v2=u2+v2\|\mathbf{u} + \mathbf{v}\|^2 = \|\mathbf{u}\|^2 + \|\mathbf{v}\|^2 always — this only holds when uv\mathbf{u} \perp \mathbf{v}.
  • Forgetting the cross term when expanding u+v2\|\mathbf{u} + \mathbf{v}\|^2 — always expand using the dot product, not treating it like ordinary algebra.