HelpContactFor teachers and institutes
>_StemPy Lab
Mock TestsClasses

>_StemPy Lab

Learn. Solve. Code the solutions. Test yourself.

Live examsFree mock exams, timed and rankedEveryone starts together, and your score and rank come the moment it ends.See the exams →
Live examsInternational live exams are comingTell us which exam you want first. Timed practice papers are open now.See what is coming →

Learn

  • Physics
  • Chemistry
  • Mathematics
  • Biology
  • Python Programming
  • Statistics & Data Science
  • Computer Science
  • Space Science and Astronomy
  • Earth and Environmental Science
  • Classes
  • Groups

Practice

  • Problems
  • Quizzes
  • Mock Tests
  • Prepare for an Exam
  • Question Sets
  • Exams
  • Certificates
  • Python Labs
  • AI Practice Generator
  • Student-Created Tests

Community

  • Discussions
  • Resources
  • Notes
  • Glossary
  • Blog

Account

  • Log in
© 2026 senLearn. All rights reserved.HelpFor SchoolsAboutContactPrivacy PolicyTerms of UseRefund Policy
Cauchy-Schwarz, Rearrangement and Chebyshev
  1. 1The Cauchy-Schwarz inequality
  2. 2The Engel form and Nesbitt's inequality
  3. 3Rearrangement and Chebyshev's inequality
  1. Mathematics
  2. /Cauchy-Schwarz, Rearrangement and Chebyshev
  3. /The Cauchy-Schwarz inequality

Course 29.2·Lesson 1 of 3

The Cauchy-Schwarz inequality

For real numbers, (a1b1+⋯+anbn)2≤(a12+⋯+an2)(b12+⋯+bn2)(a_1 b_1 + \dots + a_n b_n)^2 \le (a_1^2 + \dots + a_n^2)(b_1^2 + \dots + b_n^2)(a1​b1​+⋯+an​bn​)2≤(a12​+⋯+an2​)(b12​+⋯+bn2​)

Lesson 1 of 3Show all lessonsHide
Cauchy-Schwarz, Rearrangement and Chebyshev
  1. 1The Cauchy-Schwarz inequality
  2. 2The Engel form and Nesbitt's inequality
  3. 3Rearrangement and Chebyshev's inequality

Try the code and the simulations beside the lesson.

What you will be able to do

  • state the Cauchy-Schwarz inequality and its equality case;
  • prove it with a quadratic that is never negative;
  • use it to find the greatest value of a linear expression on a circle or sphere, and the least distance to a line or plane.

A shadow is never longer than the stick

Hold a stick in the sunlight. Its shadow on flat ground is never longer than the stick. In the language of vectors, the projection of u⃗\vec{u}u on v⃗\vec{v}v has length ∣u⃗∣ ∣cos⁡θ∣|\vec{u}|\,|\cos\theta|∣u∣∣cosθ∣, and that is at most ∣u⃗∣|\vec{u}|∣u∣. Multiply by ∣v⃗∣|\vec{v}|∣v∣:

∣u⃗⋅v⃗∣≤∣u⃗∣ ∣v⃗∣.\displaystyle |\vec{u} \cdot \vec{v}| \le |\vec{u}|\,|\vec{v}|.∣u⋅v∣≤∣u∣∣v∣.

Write the vectors as lists of components and square both sides. You get the Cauchy-Schwarz inequality.

The statement

For real numbers a1,…,ana_1, \dots, a_na1​,…,an​ and b1,…,bnb_1, \dots, b_nb1​,…,bn​,

(a1b1+a2b2+⋯+anbn)2 ≤ (a12+a22+⋯+an2)(b12+b22+⋯+bn2).\displaystyle (a_1 b_1 + a_2 b_2 + \dots + a_n b_n)^2 \ \le\ (a_1^2 + a_2^2 + \dots + a_n^2)(b_1^2 + b_2^2 + \dots + b_n^2).(a1​b1​+a2​b2​+⋯+an​bn​)2 ≤ (a12​+a22​+⋯+an2​)(b12​+b22​+⋯+bn2​).

Equality holds exactly when one list is a multiple of the other: bi=kaib_i = k a_ibi​=kai​ for every iii (or every ai=0a_i = 0ai​=0). The numbers may be negative. That is a big difference from AM-GM. Indian texts often call it the Cauchy-Schwarz inequality, Russian texts add the name Bunyakovsky, and some books just say Cauchy's inequality.

The proof with a quadratic

Write A=∑ai2A = \sum a_i^2A=∑ai2​, B=∑aibiB = \sum a_i b_iB=∑ai​bi​ and C=∑bi2C = \sum b_i^2C=∑bi2​. For every real ttt,

∑(ait−bi)2 ≥ 0,that isAt2−2Bt+C ≥ 0.\displaystyle \sum (a_i t - b_i)^2 \ \ge\ 0, \quad\text{that is}\quad At^2 - 2Bt + C \ \ge\ 0.∑(ai​t−bi​)2 ≥ 0,that isAt2−2Bt+C ≥ 0.

If A=0A = 0A=0, every aia_iai​ is 000 and both sides of Cauchy-Schwarz are 000. If A>0A > 0A>0, a quadratic that is never negative has at most one real root. So its discriminant is not positive: 4B2−4AC≤04B^2 - 4AC \le 04B2−4AC≤0, which is B2≤ACB^2 \le ACB2≤AC.

Equality B2=ACB^2 = ACB2=AC means the quadratic has a double root t0t_0t0​. Then every bracket ait0−bia_i t_0 - b_iai​t0​−bi​ is zero, so bi=t0aib_i = t_0 a_ibi​=t0​ai​: the lists are proportional.

For two terms there is an exact identity behind it, Lagrange's identity:

(a12+a22)(b12+b22)−(a1b1+a2b2)2=(a1b2−a2b1)2.\displaystyle (a_1^2 + a_2^2)(b_1^2 + b_2^2) - (a_1 b_1 + a_2 b_2)^2 = (a_1 b_2 - a_2 b_1)^2.(a12​+a22​)(b12​+b22​)−(a1​b1​+a2​b2​)2=(a1​b2​−a2​b1​)2.

Greatest value on a circle

Real numbers xxx and yyy satisfy x2+y2=25x^2 + y^2 = 25x2+y2=25. What is the greatest value of 3x+4y3x + 4y3x+4y?

  1. Cauchy-Schwarz with the lists (3,4)(3, 4)(3,4) and (x,y)(x, y)(x,y): (3x+4y)2≤(9+16)(x2+y2)=625(3x + 4y)^2 \le (9 + 16)(x^2 + y^2) = 625(3x+4y)2≤(9+16)(x2+y2)=625.
  2. So 3x+4y≤253x + 4y \le 253x+4y≤25.
  3. Equality needs (x,y)=k(3,4)(x, y) = k(3, 4)(x,y)=k(3,4). With x2+y2=25x^2 + y^2 = 25x2+y2=25 this gives k=1k = 1k=1, the point (3,4)(3, 4)(3,4), and 3×3+4×4=253 \times 3 + 4 \times 4 = 253×3+4×4=25.

The picture is a line 3x+4y=c3x + 4y = c3x+4y=c moving outwards until it just touches the circle.

A circle of radius 5 centred at the origin, in blue. Three parallel red lines of the form 3x + 4y = c are drawn for c = 10, 20 and 25. The first two cut the circle at two points each. The line for c = 25 touches the circle at the single point (3, 4), marked with a dot. A green arrow from the origin to (3, 4) is perpendicular to the lines.

Least value on a plane

Real numbers satisfy x+2y+2z=9x + 2y + 2z = 9x+2y+2z=9. What is the least value of x2+y2+z2x^2 + y^2 + z^2x2+y2+z2?

Cauchy-Schwarz with (1,2,2)(1, 2, 2)(1,2,2) and (x,y,z)(x, y, z)(x,y,z) gives 81=(x+2y+2z)2≤9(x2+y2+z2)81 = (x + 2y + 2z)^2 \le 9(x^2 + y^2 + z^2)81=(x+2y+2z)2≤9(x2+y2+z2). So x2+y2+z2≥9x^2 + y^2 + z^2 \ge 9x2+y2+z2≥9, with equality at (x,y,z)=(1,2,2)(x, y, z) = (1, 2, 2)(x,y,z)=(1,2,2). The point of the plane nearest to the origin is (1,2,2)(1, 2, 2)(1,2,2), at a distance of 333. You will meet the same distance formula in the chapter on three-dimensional geometry.

Practise with new numbers

Try it in Python

The program checks Cauchy-Schwarz on many random lists, prints the smallest gap AC−B2AC - B^2AC−B2 it finds, and then tries a pair of proportional lists.

Read it first. Then run it. Is the gap ever negative?

1. Change length = 3 to length = 10. Does the inequality still hold for longer lists?

2. Change v = [2 * t for t in u] to v = [-3 * t for t in u]. Is the gap still zero? Why?

Common mistakes

  • Squaring the wrong side. The left side is the square of one sum, (∑aibi)2(\sum a_i b_i)^2(∑ai​bi​)2, not ∑ai2bi2\sum a_i^2 b_i^2∑ai2​bi2​.
  • Forgetting the equality check. The bound is a greatest value only if a proportional pair satisfies the constraint.
  • Dropping the square root. From (3x+4y)2≤625(3x + 4y)^2 \le 625(3x+4y)2≤625 you get 3x+4y≤253x + 4y \le 253x+4y≤25, not 625625625.
  • Thinking the numbers must be positive. Cauchy-Schwarz holds for all real numbers. AM-GM is the one that needs positives.

Remember these

  • (∑aibi)2≤(∑ai2)(∑bi2)(\sum a_i b_i)^2 \le (\sum a_i^2)(\sum b_i^2)(∑ai​bi​)2≤(∑ai2​)(∑bi2​), for all real numbers.
  • Equality only when the lists are proportional.
  • Vector form: ∣u⃗⋅v⃗∣≤∣u⃗∣ ∣v⃗∣|\vec{u} \cdot \vec{v}| \le |\vec{u}|\,|\vec{v}|∣u⋅v∣≤∣u∣∣v∣.
  • The greatest value of px+qypx + qypx+qy on x2+y2=r2x^2 + y^2 = r^2x2+y2=r2 is rp2+q2r\sqrt{p^2 + q^2}rp2+q2​.

Check yourself

Try each one on your own first. If you are stuck, open a hint. Then check with Show the answer.

  1. Check Cauchy-Schwarz for the lists (1,2)(1, 2)(1,2) and (3,−1)(3, -1)(3,−1).
  1. Find the greatest value of x+yx + yx+y when x2+y2=8x^2 + y^2 = 8x2+y2=8.
  1. Find the least value of x2+y2x^2 + y^2x2+y2 when x+3y=10x + 3y = 10x+3y=10.
  1. Verify Lagrange's identity for (a1,a2)=(2,1)(a_1, a_2) = (2, 1)(a1​,a2​)=(2,1) and (b1,b2)=(1,3)(b_1, b_2) = (1, 3)(b1​,b2​)=(1,3).
  1. When is (a1b1+a2b2+a3b3)2=(a12+a22+a32)(b12+b22+b32)(a_1 b_1 + a_2 b_2 + a_3 b_3)^2 = (a_1^2 + a_2^2 + a_3^2)(b_1^2 + b_2^2 + b_3^2)(a1​b1​+a2​b2​+a3​b3​)2=(a12​+a22​+a32​)(b12​+b22​+b32​)?

References

  • Steele, The Cauchy-Schwarz Master Class, Chapter 1, on the inequality and its proofs.
  • OpenStax, Calculus Volume 3, Chapter 2, section 2.3 on the dot product and the angle between vectors.

Enroll free in Cauchy-Schwarz, Rearrangement and Chebyshev

Every lesson is open to read. Enrolling also lets you:

  • Mark lessons done and carry on where you stopped.
  • Take the tests of this lesson and its course.
  • Count the course towards the certificate for its chapter.
No payment. You can leave at any time.

Problems (3)

A drone flies inside a spherical safety zone…Hard · High School (11–12) · by StemPy Lab
A small robot moves on a flat sloping panel whose points satisfy x + 2y + 2z = 12, with all lengths…Hard · High School (11–12) · by StemPy Lab
For positive numbers a, b and c, a student must find the least value of T = (a + 2b + 3c)(1/a + 2/b…Advanced · High School (11–12) · by StemPy Lab
Next: lesson 2The Engel form and Nesbitt's inequality
← Cauchy-Schwarz, Rearrangement and Chebyshev
← PreviousThe Engel form and Nesbitt's inequality →

Discussion (0)

Log in to join the discussion.

Loading…

, with equality only when the two lists are proportional. In vector words, the dot product is at most the product of the lengths. The proof uses a quadratic in
ttt
that is never negative, so its discriminant cannot be positive. The inequality finds greatest and least values on circles, spheres, lines and planes.
about 25 min1 simulation1 practice question1 Python program5 questions to check yourself

This lesson is free to read. Enroll free to keep your place and take the tests.

Python Labs (1)

Testing Cauchy-SchwarzPython Lab · by StemPy Lab