A dot product and an angle
Two vectors a and b drawn from one point meet at an angle , and their dot product is . In components it is also , 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 , so , which is about 16.97.
So , which gives and . The dot product, 12, is smaller than the product of the lengths, 16.97, because cos 45° is less than 1.
a = (4, 0) and b = (3, 3) meet at 45°. Their dot product is 12, and the product of their lengths is , 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 . 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.
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 . Multiply both sides by the lengths |a| |b|, which are not negative: . The left side is the size of the dot product, so . That is the Cauchy–Schwarz inequality.
Written in components and squared, it reads . For a = (4, 0) and b = (3, 3) the left side is 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.
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 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: , because the terms and cancel.
What is left is a perfect square, . A square is never negative, so the right side is at least the left side, and the inequality holds for any four numbers , , and .
Check it on a = (4, 0) and b = (3, 3): 288 − 144 = 144, and .
When the two sides are equal
Equality needs , so or : 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 , so , 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 . 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.
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: . For (1, 2, 2) and (2, 3, 6), the dot product is 2 + 6 + 12 = 20, and the lengths are and , so .
It also proves the triangle inequality for vectors. Expand . The middle term is at most 2|a| |b|, so , and taking square roots gives .
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 , 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 , 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.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).
The new customers are the dot product of the weights (2, 3, 6) with the square roots of the spends. 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.
The lengths are 7 and √4900 = 70, so by Cauchy–Schwarz the dot product is at most 490. 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.
Equality needs the square roots of the spends in the ratio 2 : 3 : 6: they are 20, 30 and 60. 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.
(a) Spends of $400, $900 and $3600 bring the most new customers, 490. 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.
A budget of B dollars brings at most 7√B new customers. 6.(b) The least budget is $10000. With any smaller budget, even the best split brings fewer than 7 × 100 = 700 new customers.
(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.
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.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.
The three currents add up to 30 A, and the heat loss is the sum of RI2 over the cables. 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.
The total current is the dot product of u, whose length is √P, and v, whose length squared is 10. 3.By Cauchy–Schwarz, 30 ≤ √P × √10. Square both sides: 900 ≤ 10P, so P ≥ 90 watts.
Cauchy–Schwarz gives 30 ≤ √10P, so the loss is at least 90 W however the current divides. 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.
Equality needs each current to be kR, with k = 3. 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.
(a) Currents of 15 A, 10 A and 5 A lose the least, 90 W; each cable drops 3 volts. 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.
(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.