Skip to main content
  • Pricing
Tutorials

Cauchy–Schwarz Inequality With a Worked Example

By Oakgen TeamPublished 1 min read

Share
Cauchy–Schwarz Inequality With a Worked Example

The Cauchy–Schwarz inequality says the absolute value of an inner product is at most the product of the two vector norms. For the ordinary real dot product, this means two vectors cannot align more strongly than they would if one were a scalar multiple of the other.

Calculate the bound

Take u = (1, 2) and v = (2, 1). Their dot product is 1 × 2 + 2 × 1 = 4. Each vector has length √5, giving a product of 5. The inequality holds because 4 ≤ 5. If you instead choose v = (2, 4), it is twice u and the dot product reaches the upper bound.

The absolute value also accounts for opposite directions. Choosing v = (−2, −4) gives a negative dot product with magnitude equal to the product of lengths.

See where it comes from

For nonzero v, subtract from u the part parallel to v. The squared length of what remains cannot be negative. Expanding this expression gives the squared inequality. Taking square roots provides the usual form. Equality means the perpendicular remainder has length zero, so the two vectors are linearly dependent. If either vector is zero, both sides are zero immediately.

As a quick application, use the bound to check a cosine-similarity calculation. Dividing the dot product by the product of two nonzero lengths must produce a result between −1 and 1.

Continue with Oakgen Agent

Open in Oakgen Agent

The prompt is filled in for you. Review it before sending.

Open in Oakgen Agent

Sources

  1. MIT OpenCourseWare, Dynamic Systems and Control linear algebra review
Share