Cauchy–Schwarz Inequality

How large can the inner product of two vectors become? It can never exceed the product of the two norms.

The inner product measures how much one vector overlaps the other's direction. The overlap is largest when the two vectors point the same way. Tilt them apart and the overlap falls below the product of the norms. The proof starts from one fact: a length is never negative. Reading that fact as a discriminant drops the inequality out. Equality holds only when the two vectors are parallel.

For example, shine a light on a ✏️ pencil and its shadow is never longer than the pencil. Only when the pencil lines up with the light does the shadow match its full length.

∣⟨x,y⟩∣≤∥x∥ ∥y∥|\langle x,y\rangle| \le \|x\|\,\|y\|
∥x+y∥≤∥x∥+∥y∥\|x+y\| \le \|x\|+\|y\|

Examples & Exercises

Prove the Cauchy–Schwarz inequality ∣⟨x,y⟩∣≤∥x∥ ∥y∥|\langle x,y\rangle| \le \|x\|\,\|y\| in Rn\mathbb{R}^n by the discriminant argument.

0≤∥x−ty∥2=∥y∥2t2−2⟨x,y⟩t+∥x∥2(t∈R)0 \le \|x-ty\|^2 = \|y\|^2 t^2 - 2\langle x,y\rangle t + \|x\|^2 \qquad (t \in \mathbb{R})
Δ=4⟨x,y⟩2−4∥x∥2∥y∥2≤0\Delta = 4\langle x,y\rangle^2 - 4\|x\|^2\|y\|^2 \le 0
θ=0\theta = 0: y=(1,0)∥xy = (1,0) \parallel x, so ∣⟨x,y⟩∣=3=∥x∥ ∥y∥|\langle x,y\rangle| = 3 = \|x\|\,\|y\| — the equality case (discriminant 00) is visible.
Show proof
  1. If y=0y = 0, both sides are 00 and the claim is trivial. Assume y≠0y \ne 0.

  2. For every real tt, 0≤∥x−ty∥20 \le \|x - ty\|^2. Expanding the inner product, ∥x−ty∥2=⟨x−ty,x−ty⟩=∥y∥2t2−2⟨x,y⟩t+∥x∥2\|x - ty\|^2 = \langle x - ty, x - ty\rangle = \|y\|^2 t^2 - 2\langle x,y\rangle t + \|x\|^2, so the quadratic ∥y∥2t2−2⟨x,y⟩t+∥x∥2\|y\|^2 t^2 - 2\langle x,y\rangle t + \|x\|^2 in tt is always nonnegative.

  3. A quadratic that is always nonnegative has nonpositive discriminant: Δ=4⟨x,y⟩2−4∥y∥2∥x∥2≤0\Delta = 4\langle x,y\rangle^2 - 4\|y\|^2\|x\|^2 \le 0. Rearranging gives ⟨x,y⟩2≤∥x∥2∥y∥2\langle x,y\rangle^2 \le \|x\|^2\|y\|^2, i.e. ∣⟨x,y⟩∣≤∥x∥ ∥y∥|\langle x,y\rangle| \le \|x\|\,\|y\|.

  4. The discriminant argument works verbatim in real inner product spaces (above, Rn\mathbb{R}^n).

    In the complex case it controls only Re ⟨x,y⟩\mathrm{Re}\,\langle x,y\rangle, not ⟨x,y⟩\langle x,y\rangle itself, so a phase rotation is needed: choose α\alpha with ∣α∣=1|\alpha| = 1 and ⟨αx,y⟩=∣⟨x,y⟩∣\langle \alpha x, y\rangle = |\langle x,y\rangle| (a nonnegative real; trivial if ∣⟨x,y⟩∣=0|\langle x,y\rangle| = 0) and apply the real argument to αx\alpha x, giving ∣⟨x,y⟩∣=Re ⟨αx,y⟩≤∥αx∥ ∥y∥=∥x∥ ∥y∥|\langle x,y\rangle| = \mathrm{Re}\,\langle \alpha x, y\rangle \le \|\alpha x\|\,\|y\| = \|x\|\,\|y\|.

    In ℓ2\ell^2, apply the finite Cauchy–Schwarz to the absolute-value sequences (∣xn∣)(|x_n|), (∣yn∣)(|y_n|): ∑n≤N∣xnyn∣≤(∑n≤N∣xn∣2)1/2(∑n≤N∣yn∣2)1/2≤∥x∥ ∥y∥\sum_{n\le N} |x_n y_n| \le \left(\sum_{n\le N} |x_n|^2\right)^{1/2}\left(\sum_{n\le N} |y_n|^2\right)^{1/2} \le \|x\|\,\|y\|.

    The partial sums of nonnegative terms are bounded, so ∑n∣xnyn∣\sum_n |x_n y_n| converges — i.e. ∑xnyn\sum x_n y_n converges absolutely, and the inner product ⟨x,y⟩=∑n=1∞xnyn\langle x,y\rangle = \sum_{n=1}^{\infty} x_n y_n is well defined.

Prove that equality ∣⟨x,y⟩∣=∥x∥ ∥y∥|\langle x,y\rangle| = \|x\|\,\|y\| in Cauchy–Schwarz holds if and only if xx and yy are linearly dependent.

∣⟨x,y⟩∣=∥x∥ ∥y∥  ⟺  x, y are linearly dependent|\langle x,y\rangle| = \|x\|\,\|y\| \iff x,\ y \text{ are linearly dependent}
θ=π/2\theta = \pi/2: x⊥yx \perp y, so ⟨x,y⟩=0<3=∥x∥ ∥y∥\langle x,y\rangle = 0 < 3 = \|x\|\,\|y\| — xx and yy are linearly independent and equality fails.
Show proof
  1. If y=0y = 0, both sides are 00 so equality holds, and {x,0}\{x, 0\} is linearly dependent, making both directions trivial. Assume henceforth y≠0y \ne 0.

  2. (⇐\Leftarrow) If xx and yy are linearly dependent, x=cyx = cy for some scalar cc. Then ∣⟨x,y⟩∣=∣⟨cy,y⟩∣=∣c∣ ∥y∥2=∥cy∥ ∥y∥=∥x∥ ∥y∥|\langle x,y\rangle| = |\langle cy,y\rangle| = |c|\,\|y\|^2 = \|cy\|\,\|y\| = \|x\|\,\|y\|.

  3. (⇒\Rightarrow) If equality holds, the discriminant of the quadratic ∥y∥2t2−2⟨x,y⟩t+∥x∥2\|y\|^2 t^2 - 2\langle x,y\rangle t + \|x\|^2 from the discriminant argument is 00, so it has a real root t0t_0. At that root 0=∥y∥2t02−2⟨x,y⟩t0+∥x∥2=∥x−t0y∥20 = \|y\|^2 t_0^2 - 2\langle x,y\rangle t_0 + \|x\|^2 = \|x - t_0 y\|^2, hence x=t0yx = t_0 y — i.e. xx and yy are linearly dependent.

Deduce the triangle inequality ∥x+y∥≤∥x∥+∥y∥\|x+y\| \le \|x\| + \|y\| as a corollary of Cauchy–Schwarz.

∥x+y∥2=∥x∥2+2⟨x,y⟩+∥y∥2≤∥x∥2+2∥x∥ ∥y∥+∥y∥2=(∥x∥+∥y∥)2\|x+y\|^2 = \|x\|^2 + 2\langle x,y\rangle + \|y\|^2 \le \|x\|^2 + 2\|x\|\,\|y\| + \|y\|^2 = (\|x\| + \|y\|)^2
θ=π/4\theta = \pi/4: ∥x+y∥≈3.7739<4=∥x∥+∥y∥\|x+y\| \approx 3.7739 < 4 = \|x\| + \|y\| — the triangle inequality in action.
Show proof
  1. Expanding the squared norm via the inner product gives ∥x+y∥2=⟨x+y,x+y⟩=∥x∥2+2⟨x,y⟩+∥y∥2\|x+y\|^2 = \langle x+y, x+y\rangle = \|x\|^2 + 2\langle x,y\rangle + \|y\|^2.

  2. Since ⟨x,y⟩≤∣⟨x,y⟩∣\langle x,y\rangle \le |\langle x,y\rangle| and ∣⟨x,y⟩∣≤∥x∥ ∥y∥|\langle x,y\rangle| \le \|x\|\,\|y\| by Cauchy–Schwarz, we get ∥x+y∥2≤∥x∥2+2∥x∥ ∥y∥+∥y∥2=(∥x∥+∥y∥)2\|x+y\|^2 \le \|x\|^2 + 2\|x\|\,\|y\| + \|y\|^2 = (\|x\| + \|y\|)^2.

  3. Taking square roots of both sides yields ∥x+y∥≤∥x∥+∥y∥\|x+y\| \le \|x\| + \|y\|.

3. Sequences