The Cauchy–Schwarz Inequality

A dot product cannot beat the two lengths.

A dot product and an angle

Two vectors a and b drawn from one point meet at an angle θ, and their dot product is a · b = |a| |b| cos θ. In components it is also a₁b₁ + a₂b₂, the first components multiplied plus the second components multiplied.

Take a = (4, 0) and b = (3, 3). The components give a · b = 4 × 3 + 0 × 3 = 12. The lengths are |a| = 4 and |b| = √(3² + 3²) = √18 = 3√2, so |a| |b| = 12√2, which is about 16.97.

So 12√2 cos θ = 12, which gives cos θ = 1/√2 and θ = 45°. The dot product, 12, is smaller than the product of the lengths, 16.97, because cos 45° is less than 1.

a4b3√245°

a = (4, 0) and b = (3, 3) meet at 45°. Their dot product is 12, and the product of their lengths is 4 × 3√2 = 12√2, about 16.97.

The projection

Drop a perpendicular from the head of b onto the line of a. The piece of that line from the tail to the foot of the perpendicular is the projection of b on a, and its length is |b| cos θ. The dot product is the length of a times that projection.

For a = (4, 0) and b = (3, 3), the perpendicular from (3, 3) lands at (3, 0), so the projection is 3. Then |a| × 3 = 4 × 3 = 12, the same dot product as before.

A projection is never longer than the vector it comes from: it is one side of a right triangle whose hypotenuse is b. Here the projection is 3 and |b| is about 4.24.

3ab

The projection of b = (3, 3) on a = (4, 0), in gold, has length 3, and 4 × 3 = 12 = a · b.

The inequality

A cosine lies between −1 and 1, so |cos θ| ≤ 1. Multiply both sides by the lengths |a| |b|, which are not negative: |a| |b| |cos θ| ≤ |a| |b|. The left side is the size of the dot product, so |a · b| ≤ |a| |b|. That is the Cauchy–Schwarz inequality.

Written in components and squared, it reads (a₁b₁ + a₂b₂)² ≤ (a₁² + a₂²)(b₁² + b₂²). For a = (4, 0) and b = (3, 3) the left side is 12² = 144 and the right side is 16 × 18 = 288.

The bound is a product of the lengths, not a sum. Two vectors of lengths 5 and 5 have a dot product of at most 5 × 5 = 25, and never 10.

abθ = 60°shadow |b| cos θ 1.5

the shadow lies along a, so a · b = |a| × shadow is positive: 6

Swing b until a · b = 0

a has length 4 and b has length 3, so the bound is 4 × 3 = 12. At θ = 60° the projection is 1.5 and a · b = 6. Swing b round: the dot product reaches 12 only at 0°, and its size reaches 12 again at 180°, where it is −12.

A proof with no angle

The components give a second proof, which needs no angle at all. Multiply out the right side and take away the left side: (a₁² + a₂²)(b₁² + b₂²) − (a₁b₁ + a₂b₂)² = a₁²b₂² − 2a₁b₂a₂b₁ + a₂²b₁², because the terms a₁²b₁² and a₂²b₂² cancel.

What is left is a perfect square, (a₁b₂ − a₂b₁)². A square is never negative, so the right side is at least the left side, and the inequality holds for any four numbers a₁, a₂, b₁ and b₂.

Check it on a = (4, 0) and b = (3, 3): 288 − 144 = 144, and (4 × 3 − 0 × 3)² = 12² = 144.

When the two sides are equal

Equality needs |cos θ| = 1, so θ = 0° or θ = 180°: the two vectors lie along one line, pointing the same way or opposite ways. That is what parallel means here. The projection of b is then the whole of b.

The proof in components says the same. Equality needs (a₁b₂ − a₂b₁)² = 0, so a₁b₂ = a₂b₁, which says that one vector is a number times the other.

For a = (4, 2) and b = (2, 1), a is 2 times b. Then a · b = 8 + 2 = 10, and |a| |b| = √20 × √5 = √100 = 10. For a = (3, 4) and c = (−6, −8), c is −2 times a: a · c = −18 − 32 = −50, and |a| |c| = 5 × 10 = 50, so |a · c| = 50, equal to the bound.

The equality case is how the inequality finds a largest value. Among all vectors b of length 5, the dot product (3, 4) · b is at most 5 × 5 = 25, and it reaches 25 only when b points along (3, 4), at b = (3, 4) itself: 9 + 16 = 25.

xyab−b

a = (4, 2) and b = (2, 1) lie along one line, and a · b = 10 = |a| |b|. Against −b = (−2, −1), pointing the other way, a · (−b) = −10, and its size is again the product of the lengths.

Three components, and the triangle inequality

The inequality holds with three components, or with any number: (a₁b₁ + a₂b₂ + a₃b₃)² ≤ (a₁² + a₂² + a₃²)(b₁² + b₂² + b₃²). For (1, 2, 2) and (2, 3, 6), the dot product is 2 + 6 + 12 = 20, and the lengths are √9 = 3 and √49 = 7, so 20 ≤ 3 × 7 = 21.

It also proves the triangle inequality for vectors. Expand |a + b|² = |a|² + 2a · b + |b|². The middle term is at most 2|a| |b|, so |a + b|² ≤ |a|² + 2|a| |b| + |b|² = (|a| + |b|)², and taking square roots gives |a + b| ≤ |a| + |b|.

The usual mistakes

Dropping the size bars. A dot product can be negative, and a · c = −50 is at most 50 without saying much. The inequality bounds the size of the dot product, |a · b|, and a negative dot product reaches the bound when the vectors point opposite ways.

Taking perpendicular vectors for the equality case. Perpendicular vectors have cos θ = 0, so their dot product is 0, as far from the bound as it can be.

Adding the lengths. The bound for lengths 4 and 3 is 4 × 3 = 12, not 4 + 3 = 7.

Matching the wrong things in an application. In the advertising problem below, the weights (2, 3, 6) are matched with the square roots of the spends, so equality puts the spends in the ratio 4 : 9 : 36, not 2 : 3 : 6.

Budgets and cables

In the first application, the new customers from three advertising channels are the dot product of the weights (2, 3, 6) with the square roots of the three spends. The weights have length 7 and the square roots of the spends have length √4900 = 70, so the customers number at most 7 × 70 = 490.

In the second, the total current of 30 A is a dot product, and the heat lost sits inside the length of one of the two vectors, so the inequality gives the least heat instead of the most.

Worked example: An Advertising Budget Shared by Search, Social Media and Radio: the Most New Customers, and the Budget for a Target

Question A shop models the new customers it gains from spending x dollars on one advertising channel as a√x, where a is 2 for search ads, 3 for social media and 6 for local radio. It has $4900 to spend across the three channels. (a) Use the Cauchy–Schwarz inequality to find the most new customers the budget can bring, and the spend on each channel that brings them. (b) What is the least budget that can bring 700 new customers?

  1. 1.Let the spends on search, social media and radio be x, y and z dollars, with x + y + z = 4900. The new customers number 2√x + 3√y + 6√z, the dot product of (2, 3, 6) with (√x, √y, √z).

    weights2362√x + 3√y + 6√z= (2, 3, 6) · (√x,√y,√z)
    weights2362√x + 3√y + 6√z= (2, 3, 6) · (√x,√y,√z)
    The new customers are the dot product of the weights (2, 3, 6) with the square roots of the spends.
  2. 2.The first vector has length √22 + 32 + 62 = √49 = 7, and the second has length √x + y + z = √4900 = 70. By Cauchy–Schwarz the dot product is at most 7 × 70 = 490.

    weights236length 7roots / 10?length 702√x + 3√y + 6√z= (2, 3, 6) · (√x,√y,√z)lengths 7 and√4900= 70: at most 490
    weights236length 7roots / 10?length 702√x + 3√y + 6√z= (2, 3, 6) · (√x,√y,√z)lengths 7 and√4900= 70: at most 490
    The lengths are 7 and √4900 = 70, so by Cauchy–Schwarz the dot product is at most 490.
  3. 3.Equality needs the vectors parallel: (√x, √y, √z) = k(2, 3, 6) for a number k. Then x + y + z = 4k2 + 9k2 + 36k2 = 49k2 = 4900, so k2 = 100, k = 10, and the square roots of the spends are 20, 30 and 60.

    weights236length 7roots / 10203060length 702√x + 3√y + 6√z= (2, 3, 6) · (√x,√y,√z)lengths 7 and√4900= 70: at most 490parallel:√x,√y,√z = 20, 30, 60
    weights236length 7roots / 10203060length 702√x + 3√y + 6√z= (2, 3, 6) · (√x,√y,√z)lengths 7 and√4900= 70: at most 490parallel:√x,√y,√z = 20, 30, 60
    Equality needs the square roots of the spends in the ratio 2 : 3 : 6: they are 20, 30 and 60.
  4. 4.(a) The most is 490 new customers, from $400 on search, $900 on social media and $3600 on radio. Check: 2 × 20 + 3 × 30 + 6 × 60 = 40 + 90 + 360 = 490, and 400 + 900 + 3600 = 4900.

    Search$40040 newSocial$90090 newRadio$3600360 new2√x + 3√y + 6√z= (2, 3, 6) · (√x,√y,√z)lengths 7 and√4900= 70: at most 490parallel:√x,√y,√z = 20, 30, 6040 + 90 + 360 = 490 new customers
    Search$40040 newSocial$90090 newRadio$3600360 new2√x + 3√y + 6√z= (2, 3, 6) · (√x,√y,√z)lengths 7 and√4900= 70: at most 490parallel:√x,√y,√z = 20, 30, 6040 + 90 + 360 = 490 new customers
    (a) Spends of $400, $900 and $3600 bring the most new customers, 490.
  5. 5.For a budget of B dollars the same argument gives at most 7√B new customers, reached by a split in the same proportions. To bring 700, the budget needs 7√B ≥ 700, so √B ≥ 100.

    Search$40040 newSocial$90090 newRadio$3600360 new2√x + 3√y + 6√z= (2, 3, 6) · (√x,√y,√z)lengths 7 and√4900= 70: at most 490parallel:√x,√y,√z = 20, 30, 6040 + 90 + 360 = 490 new customersbudget B: at most 7√B
    Search$40040 newSocial$90090 newRadio$3600360 new2√x + 3√y + 6√z= (2, 3, 6) · (√x,√y,√z)lengths 7 and√4900= 70: at most 490parallel:√x,√y,√z = 20, 30, 6040 + 90 + 360 = 490 new customersbudget B: at most 7√B
    A budget of B dollars brings at most 7√B new customers.
  6. 6.(b) The least budget is $10000. With any smaller budget, even the best split brings fewer than 7 × 100 = 700 new customers.

    Search$40040 newSocial$90090 newRadio$3600360 new2√x + 3√y + 6√z= (2, 3, 6) · (√x,√y,√z)lengths 7 and√4900= 70: at most 490parallel:√x,√y,√z = 20, 30, 6040 + 90 + 360 = 490 new customersbudget B: at most 7√B7√B = 700:√B = 100, B = $10000
    Search$40040 newSocial$90090 newRadio$3600360 new2√x + 3√y + 6√z= (2, 3, 6) · (√x,√y,√z)lengths 7 and√4900= 70: at most 490parallel:√x,√y,√z = 20, 30, 6040 + 90 + 360 = 490 new customersbudget B: at most 7√B7√B = 700:√B = 100, B = $10000
    (b) For 700 new customers the budget must be at least $10000.

Answer: (a) 490 new customers, from $400 on search, $900 on social media and $3600 on radio; (b) $10000

Common mistakes

  • Splitting the budget in the ratio of the weights, 2 : 3 : 6. Equality needs the square roots of the spends in that ratio, so the spends themselves are in the ratio 4 : 9 : 36.
  • Putting the whole budget on radio, the strongest channel. That brings 6√4900 = 420 new customers, fewer than 490, because each extra dollar on one channel brings fewer customers than the dollar before it.

More named inequalities problems, worked step by step →

Worked example: Three Parallel Cables Carrying 30 A from a Solar Array: the Least Heat They Can Lose, and What Losing One Cable Costs

Question Three cables with resistances of 0.2, 0.3 and 0.6 ohms run side by side from a solar array to a battery, and between them they carry 30 A. A cable of resistance R ohms carrying I amps loses RI2 watts as heat. (a) Use the Cauchy–Schwarz inequality to find the least total heat the three cables can lose, however the current divides between them, and the current in each cable when the loss is least. (b) The 0.6 ohm cable is damaged and removed, and the other two carry the 30 A. By how much does the least heat loss rise?

  1. 1.Let the currents in the three cables be x, y and z amps, with x + y + z = 30. The total heat loss is P = 0.2x2 + 0.3y2 + 0.6z2 watts.

    0.2 ohmx0.3 ohmy0.6 ohmzx + y + z = 30P = 0.2x2+ 0.3y2+ 0.6z2
    0.2 ohmx0.3 ohmy0.6 ohmzx + y + z = 30P = 0.2x2+ 0.3y2+ 0.6z2
    The three currents add up to 30 A, and the heat loss is the sum of RI2 over the cables.
  2. 2.Take u = (√0.2x, √0.3y, √0.6z) and v = (1√0.2, 1√0.3, 1√0.6). Their dot product is x + y + z = 30. The length of u is √P, and the length of v squared is 10.2 + 10.3 + 10.6 = 5 + 103 + 53 = 10.

    0.2 ohmx0.3 ohmy0.6 ohmzx + y + z = 30P = 0.2x2+ 0.3y2+ 0.6z2u · v = 30, u · u = P, v · v = 10
    0.2 ohmx0.3 ohmy0.6 ohmzx + y + z = 30P = 0.2x2+ 0.3y2+ 0.6z2u · v = 30, u · u = P, v · v = 10
    The total current is the dot product of u, whose length is √P, and v, whose length squared is 10.
  3. 3.By Cauchy–Schwarz, 30 ≤ √P × √10. Square both sides: 900 ≤ 10P, so P ≥ 90 watts.

    0.2 ohmx0.3 ohmy0.6 ohmzx + y + z = 30P = 0.2x2+ 0.3y2+ 0.6z2u · v = 30, u · u = P, v · v = 1030 ≤√P ×√10, so P ≥ 90 W
    0.2 ohmx0.3 ohmy0.6 ohmzx + y + z = 30P = 0.2x2+ 0.3y2+ 0.6z2u · v = 30, u · u = P, v · v = 1030 ≤√P ×√10, so P ≥ 90 W
    Cauchy–Schwarz gives 30 ≤ √10P, so the loss is at least 90 W however the current divides.
  4. 4.Equality needs u parallel to v, so √RI = k√R in every cable, which is I = kR for one number k. Then 5k + 103k + 53k = 10k = 30, so k = 3.

    0.2 ohmx0.3 ohmy0.6 ohmzx + y + z = 30P = 0.2x2+ 0.3y2+ 0.6z2u · v = 30, u · u = P, v · v = 1030 ≤√P ×√10, so P ≥ 90 Wcurrent = k/R and 10k = 30, so k = 3
    0.2 ohmx0.3 ohmy0.6 ohmzx + y + z = 30P = 0.2x2+ 0.3y2+ 0.6z2u · v = 30, u · u = P, v · v = 1030 ≤√P ×√10, so P ≥ 90 Wcurrent = k/R and 10k = 30, so k = 3
    Equality needs each current to be kR, with k = 3.
  5. 5.(a) The least loss is 90 W, with 3 ÷ 0.2 = 15 A, 3 ÷ 0.3 = 10 A and 3 ÷ 0.6 = 5 A in the three cables. Each cable then has the same voltage drop, RI = 3 volts, which is how current divides between cables joined side by side. Check: 0.2 × 225 + 0.3 × 100 + 0.6 × 25 = 45 + 30 + 15 = 90.

    0.2 ohm15 A45 W0.3 ohm10 A30 W0.6 ohm5 A15 Wx + y + z = 30P = 0.2x2+ 0.3y2+ 0.6z2u · v = 30, u · u = P, v · v = 1030 ≤√P ×√10, so P ≥ 90 Wcurrent = k/R and 10k = 30, so k = 345 + 30 + 15 = 90 W
    0.2 ohm15 A45 W0.3 ohm10 A30 W0.6 ohm5 A15 Wx + y + z = 30P = 0.2x2+ 0.3y2+ 0.6z2u · v = 30, u · u = P, v · v = 1030 ≤√P ×√10, so P ≥ 90 Wcurrent = k/R and 10k = 30, so k = 345 + 30 + 15 = 90 W
    (a) Currents of 15 A, 10 A and 5 A lose the least, 90 W; each cable drops 3 volts.
  6. 6.(b) With two cables, the length of v squared is 5 + 103 = 253, so 900 ≤ 253P and P ≥ 108 W, with 18 A and 12 A. The least loss rises by 108 − 90 = 18 W. Check: 0.2 × 324 + 0.3 × 144 = 64.8 + 43.2 = 108.

    0.2 ohm15 A45 W0.3 ohm10 A30 W0.6 ohm5 A15 WWithout the 0.6 ohm cable0.2 ohm18 A64.8 W0.3 ohm12 A43.2 Wx + y + z = 30P = 0.2x2+ 0.3y2+ 0.6z2u · v = 30, u · u = P, v · v = 1030 ≤√P ×√10, so P ≥ 90 Wcurrent = k/R and 10k = 30, so k = 345 + 30 + 15 = 90 Wv · v = 25/3, so P ≥ 108 W: up 18 W
    0.2 ohm15 A45 W0.3 ohm10 A30 W0.6 ohm5 A15 WWithout the 0.6 ohm cable0.2 ohm18 A64.8 W0.3 ohm12 A43.2 Wx + y + z = 30P = 0.2x2+ 0.3y2+ 0.6z2u · v = 30, u · u = P, v · v = 1030 ≤√P ×√10, so P ≥ 90 Wcurrent = k/R and 10k = 30, so k = 345 + 30 + 15 = 90 Wv · v = 25/3, so P ≥ 108 W: up 18 W
    (b) The two cables left lose at least 108 W, with 18 A and 12 A: 18 W more.

Answer: (a) 90 W, with 15 A, 10 A and 5 A in the 0.2, 0.3 and 0.6 ohm cables; (b) it rises by 18 W, to 108 W

Common mistakes

  • Sharing the current equally, 10 A in each cable. That loses 0.2 × 100 + 0.3 × 100 + 0.6 × 100 = 110 W, more than 90 W: the cable with the least resistance should carry the most current.
  • Taking the length of v squared as 0.2 + 0.3 + 0.6 = 1.1. The entries of v are 1√R, so their squares are 1R: 5, 103 and 53.

More named inequalities problems, worked step by step →

Practice The Cauchy–Schwarz Inequality in the app