# Cauchy–Schwarz inequality

In mathematics, the Cauchy–Schwarz inequality, also known as the Cauchy–Bunyakovsky–Schwarz inequality, is a useful inequality encountered in many different settings, such as linear algebra, analysis, probability theory, vector algebra and other areas. It is considered to be one of the most important inequalities in all of mathematics.[1]

The inequality for sums was published by Augustin-Louis Cauchy (1821), while the corresponding inequality for integrals was first proved by Viktor Bunyakovsky (1859). The modern proof of the integral inequality was given by Hermann Amandus Schwarz (1888).[1]

## Statement of the inequality

The Cauchy–Schwarz inequality states that for all vectors ${\displaystyle u}$  and ${\displaystyle v}$  of an inner product space it is true that

${\displaystyle |\langle \mathbf {u} ,\mathbf {v} \rangle |^{2}\leq \langle \mathbf {u} ,\mathbf {u} \rangle \cdot \langle \mathbf {v} ,\mathbf {v} \rangle ,}$

where ${\displaystyle \langle \cdot ,\cdot \rangle }$  is the inner product. Examples of inner products include the real and complex dot product, see the examples in inner product. Equivalently, by taking the square root of both sides, and referring to the norms of the vectors, the inequality is written as[2][3]

${\displaystyle |\langle \mathbf {u} ,\mathbf {v} \rangle |\leq \|\mathbf {u} \|\|\mathbf {v} \|.}$

Moreover, the two sides are equal if and only if ${\displaystyle \mathbf {u} }$  and ${\displaystyle \mathbf {v} }$  are linearly dependent (meaning they are parallel: one of the vector's magnitudes is zero, or one is a scalar multiple of the other).[4][5]

If ${\displaystyle u_{1},\ldots ,u_{n}\in \mathbb {C} }$  and ${\displaystyle v_{1},\ldots ,v_{n}\in \mathbb {C} }$ , and the inner product is the standard complex inner product, then the inequality may be restated more explicitly as follows (where the bar notation is used for complex conjugation):

${\displaystyle |u_{1}{\bar {v}}_{1}+\cdots +u_{n}{\bar {v}}_{n}|^{2}\leq (|u_{1}|^{2}+\cdots +|u_{n}|^{2})(|v_{1}|^{2}+\cdots +|v_{n}|^{2})}$

or

${\displaystyle \left|\sum _{i=1}^{n}u_{i}{\bar {v}}_{i}\right|^{2}\leq \sum _{j=1}^{n}|u_{j}|^{2}\sum _{k=1}^{n}|v_{k}|^{2}.}$

## Proofs

### First proof

Let ${\displaystyle u}$  and ${\displaystyle v}$  be arbitrary vectors in a vector space over ${\displaystyle \mathbb {F} }$  with an inner product, where ${\displaystyle \mathbb {F} }$  is the field of real or complex numbers. We prove the inequality

${\displaystyle {\big |}\langle u,v\rangle {\big |}\leq \|u\|\|v\|}$

and that equality holds if and only if either ${\displaystyle u}$  or ${\displaystyle v}$  is a multiple of the other (which includes the special case that either is the zero vector).

If ${\displaystyle v=0}$ , it is clear that we have equality, and in this case ${\displaystyle u}$  and ${\displaystyle v}$  are also linearly dependent, regardless of ${\displaystyle u}$ , so the theorem is true. Similarly if ${\displaystyle u=0}$ . We henceforth assume that ${\displaystyle v}$  is nonzero.

Let

${\displaystyle z=u-u_{v}=u-{\frac {\langle u,v\rangle }{\langle v,v\rangle }}v.}$

Then, by linearity of the inner product in its first argument, one has

${\displaystyle \langle z,v\rangle =\left\langle u-{\frac {\langle u,v\rangle }{\langle v,v\rangle }}v,v\right\rangle =\langle u,v\rangle -{\frac {\langle u,v\rangle }{\langle v,v\rangle }}\langle v,v\rangle =0.}$

Therefore, ${\displaystyle z}$  is a vector orthogonal to the vector ${\displaystyle v}$  (Indeed, ${\displaystyle z}$  is the projection of ${\displaystyle u}$  onto the plane orthogonal to ${\displaystyle v}$  .) We can thus apply the Pythagorean theorem to

${\displaystyle u={\frac {\langle u,v\rangle }{\langle v,v\rangle }}v+z}$

which gives

${\displaystyle \|u\|^{2}=\left|{\frac {\langle u,v\rangle }{\langle v,v\rangle }}\right|^{2}\|v\|^{2}+\|z\|^{2}={\frac {|\langle u,v\rangle |^{2}}{\|v\|^{2}}}+\|z\|^{2}\geq {\frac {|\langle u,v\rangle |^{2}}{\|v\|^{2}}}}$

and, after multiplication by ${\displaystyle \|v\|^{2}}$  and taking square root, we get the Cauchy–Schwarz inequality. Moreover, if the relation ${\displaystyle \geq }$  in the above expression is actually an equality, then ${\displaystyle \|z\|^{2}=0}$  and hence ${\displaystyle z=0}$ ; the definition of ${\displaystyle z}$  then establishes a relation of linear dependence between ${\displaystyle u}$  and ${\displaystyle v}$ . On the other hand, if ${\displaystyle u}$  and ${\displaystyle v}$  are linearly dependent, then there exists ${\displaystyle c\in \mathbb {F} }$  such that ${\displaystyle u=c\cdot v}$  (since ${\displaystyle v\neq 0}$ ). Then

${\displaystyle |\langle u,v\rangle |=|\langle c\cdot v,v\rangle |=\left|c\|v\|^{2}\right|=|c|\|v\|^{2}=\|c\cdot v\|\|v\|=\|u\|\|v\|.}$

This establishes the theorem.

### Second proof

Let ${\displaystyle u}$  and ${\displaystyle v}$  be arbitrary vectors in an inner product space over ${\displaystyle \mathbb {C} }$ .

In the special case ${\displaystyle v=0}$  the theorem is trivially true. Now assume that ${\displaystyle v\neq 0}$ . Let ${\displaystyle \lambda \in \mathbb {C} }$  be given by ${\displaystyle \lambda =\langle u,v\rangle /\|v\|^{2}}$ , then

{\displaystyle {\begin{aligned}0&\leq \|u-\lambda \cdot v\|^{2}\\&=\langle u,u\rangle -\langle \lambda \cdot v,u\rangle -\langle u,\lambda \cdot v\rangle +\langle \lambda \cdot v,\lambda \cdot v\rangle \\&=\langle u,u\rangle -\lambda \langle v,u\rangle -{\overline {\lambda }}\langle u,v\rangle +\lambda {\overline {\lambda }}\langle v,v\rangle \\&=\|u\|^{2}-\lambda {\overline {\langle u,v\rangle }}-{\overline {\lambda }}\langle u,v\rangle +\lambda {\overline {\lambda }}\|v\|^{2}\\&=\|u\|^{2}-{\frac {|\langle u,v\rangle |^{2}}{\|v\|^{2}}}-{\frac {|\langle u,v\rangle |^{2}}{\|v\|^{2}}}+{\frac {|\langle u,v\rangle |^{2}}{\|v\|^{2}}}\\&=\|u\|^{2}-{\frac {|\langle u,v\rangle |^{2}}{\|v\|^{2}}}.\end{aligned}}}

Therefore, ${\displaystyle 0\leq \|u\|^{2}-{\frac {|\langle u,v\rangle |^{2}}{\|v\|^{2}}}}$ , or ${\displaystyle |\langle u,v\rangle |\leq \|u\|\|v\|}$ .

If the inequality holds as an equality, then ${\displaystyle \|u-\lambda \cdot v\|=0}$ , and so ${\displaystyle u-\lambda \cdot v=0}$ , thus ${\displaystyle u}$  and ${\displaystyle v}$  are linearly dependent. On the other hand, if ${\displaystyle u}$  and ${\displaystyle v}$  are linearly dependent, then ${\displaystyle |\langle u,v\rangle |=\|u\|\|v\|}$ , as shown in the first proof.

### More proofs

There are many different proofs[6] of the Cauchy–Schwarz inequality other than the above two examples.[1][3] When consulting other sources, there are often two sources of confusion. First, some authors define ⟨⋅,⋅⟩ to be linear in the second argument rather than the first. Second, some proofs are only valid when the field is ${\displaystyle \mathbb {R} }$  and not ${\displaystyle \mathbb {C} }$ .[7]

## Special cases

### Titu's Lemma

Titu's lemma (named after Titu Andreescu, also known as T2 Lemma, Engel's form, or Sedrakyan's inequality) states that for positive reals, we have

${\displaystyle {\frac {\left(\sum _{i=1}^{n}u_{i}\right)^{2}}{\sum _{i=1}^{n}v_{i}}}\leq \sum _{i=1}^{n}{\frac {u_{i}^{2}}{v_{i}}}.}$

It is a direct consequence of the Cauchy-Schwarz inequality, obtained upon substituting ${\displaystyle u_{i}'={\frac {u_{i}}{\sqrt {v_{i}}}}}$  and ${\displaystyle v_{i}'={\sqrt {v_{i}}}.}$  This form is especially helpful when the inequality involves fractions where the numerator is a perfect square.

### R2 (ordinary two-dimensional space)

In the usual 2-dimensional space with the dot product, let ${\displaystyle v=(v_{1},v_{2})}$  and ${\displaystyle u=(u_{1},u_{2})}$ . The Cauchy–Schwarz inequality is that

${\displaystyle \langle u,v\rangle ^{2}=(\|u\|\|v\|\cos \theta )^{2}\leq \|u\|^{2}\|v\|^{2},}$

where ${\displaystyle \theta }$  is the angle between ${\displaystyle u}$  and ${\displaystyle v.}$

The form above is perhaps the easiest in which to understand the inequality, since the square of the cosine can be at most 1, which occurs when the vectors are in the same or opposite directions. It can also be restated in terms of the vector coordinates ${\displaystyle v_{1},v_{2},u_{1}}$  and ${\displaystyle u_{2}}$  as

${\displaystyle (u_{1}v_{1}+u_{2}v_{2})^{2}\leq (u_{1}^{2}+u_{2}^{2})(v_{1}^{2}+v_{2}^{2}),}$

where equality holds if and only if the vector ${\displaystyle (u_{1},u_{2})}$  is in the same or opposite direction as the vector ${\displaystyle (v_{1},v_{2}),}$  or if one of them is the zero vector.

### Rn (n-dimensional Euclidean space)

In Euclidean space ${\displaystyle \mathbb {R} ^{n}}$  with the standard inner product, the Cauchy–Schwarz inequality is

${\displaystyle \left(\sum _{i=1}^{n}u_{i}v_{i}\right)^{2}\leq \left(\sum _{i=1}^{n}u_{i}^{2}\right)\left(\sum _{i=1}^{n}v_{i}^{2}\right)}$

The Cauchy–Schwarz inequality can be proved using only ideas from elementary algebra in this case. Consider the following quadratic polynomial in ${\displaystyle x}$

${\displaystyle 0\leq (u_{1}x+v_{1})^{2}+\cdots +(u_{n}x+v_{n})^{2}=\left(\sum u_{i}^{2}\right)x^{2}+2\left(\sum u_{i}v_{i}\right)x+\sum v_{i}^{2}.}$

Since it is nonnegative, it has at most one real root for ${\displaystyle x}$ , hence its discriminant is less than or equal to zero. That is,

${\displaystyle \left(\sum (u_{i}v_{i})\right)^{2}-\sum {u_{i}^{2}}\sum {v_{i}^{2}}\leq 0,}$

which yields the Cauchy–Schwarz inequality.

### L2

For the inner product space of square-integrable complex-valued functions, one has

${\displaystyle \left|\int _{\mathbb {R} ^{n}}f(x){\overline {g(x)}}\,dx\right|^{2}\leq \int _{\mathbb {R} ^{n}}|f(x)|^{2}\,dx\int _{\mathbb {R} ^{n}}|g(x)|^{2}\,dx.}$

A generalization of this is the Hölder inequality.

## Applications

### Analysis

The triangle inequality for the standard norm is often shown as a consequence of the Cauchy–Schwarz inequality, as follows: given vectors x and y:

{\displaystyle {\begin{aligned}\|x+y\|^{2}&=\langle x+y,x+y\rangle \\&=\|x\|^{2}+\langle x,y\rangle +\langle y,x\rangle +\|y\|^{2}\\&=\|x\|^{2}+2\operatorname {Re} \langle x,y\rangle +\|y\|^{2}\\&\leq \|x\|^{2}+2|\langle x,y\rangle |+\|y\|^{2}\\&\leq \|x\|^{2}+2\|x\|\|y\|+\|y\|^{2}\\&=(\|x\|+\|y\|)^{2}\end{aligned}}}

Taking square roots gives the triangle inequality.

The Cauchy–Schwarz inequality is used to prove that the inner product is a continuous function with respect to the topology induced by the inner product itself.[8][9]

### Geometry

The Cauchy–Schwarz inequality allows one to extend the notion of "angle between two vectors" to any real inner-product space by defining:[10][11]

${\displaystyle \cos \theta _{xy}={\frac {\langle x,y\rangle }{\|x\|\|y\|}}.}$

The Cauchy–Schwarz inequality proves that this definition is sensible, by showing that the right-hand side lies in the interval [−1, 1] and justifies the notion that (real) Hilbert spaces are simply generalizations of the Euclidean space. It can also be used to define an angle in complex inner-product spaces, by taking the absolute value or the real part of the right-hand side,[12][13] as is done when extracting a metric from quantum fidelity.

### Probability theory

Let X, Y be random variables, then the covariance inequality[14][15] is given by

${\displaystyle \operatorname {Var} (Y)\geq {\frac {\operatorname {Cov} (Y,X)\operatorname {Cov} (Y,X)}{\operatorname {Var} (X)}}.}$

After defining an inner product on the set of random variables using the expectation of their product,

${\displaystyle \langle X,Y\rangle :=\operatorname {E} (XY),}$

the Cauchy–Schwarz inequality becomes

${\displaystyle |\operatorname {E} (XY)|^{2}\leq \operatorname {E} (X^{2})\operatorname {E} (Y^{2}).}$

To prove the covariance inequality using the Cauchy–Schwarz inequality, let ${\displaystyle \mu =\operatorname {E} (X)}$  and ${\displaystyle \nu =\operatorname {E} (Y)}$ , then

{\displaystyle {\begin{aligned}|\operatorname {Cov} (X,Y)|^{2}&=|\operatorname {E} ((X-\mu )(Y-\nu ))|^{2}\\&=|\langle X-\mu ,Y-\nu \rangle |^{2}\\&\leq \langle X-\mu ,X-\mu \rangle \langle Y-\nu ,Y-\nu \rangle \\&=\operatorname {E} ((X-\mu )^{2})\operatorname {E} ((Y-\nu )^{2})\\&=\operatorname {Var} (X)\operatorname {Var} (Y),\end{aligned}}}

where ${\displaystyle \operatorname {Var} }$  denotes variance, and ${\displaystyle \operatorname {Cov} }$  denotes covariance.

## Generalizations

Various generalizations of the Cauchy–Schwarz inequality exist in the context of operator theory, e.g. for operator-convex functions and operator algebras, where the domain and/or range are replaced by a C*-algebra or W*-algebra.

An inner product can be used to define a positive linear functional. For example, given a Hilbert space ${\displaystyle L^{2}(m),m}$  being a finite measure, the standard inner product gives rise to a positive functional ${\displaystyle \varphi }$  by ${\displaystyle \varphi (g)=\langle g,1\rangle }$ . Conversely, every positive linear functional ${\displaystyle \varphi }$  on ${\displaystyle L^{2}(m)}$  can be used to define an inner product ${\displaystyle \langle f,g\rangle _{\varphi }:=\varphi (g^{*}f)}$ , where ${\displaystyle g^{*}}$  is the pointwise complex conjugate of ${\displaystyle g}$ . In this language, the Cauchy–Schwarz inequality becomes[16]

${\displaystyle |\varphi (g^{*}f)|^{2}\leq \varphi (f^{*}f)\varphi (g^{*}g),}$

which extends verbatim to positive functionals on C*-algebras:

Theorem (Cauchy–Schwarz inequality for positive functionals on C*-algebras):[17][18] If ${\displaystyle \varphi }$  is a positive linear functional on a C*-algebra ${\displaystyle A,}$  then for all ${\displaystyle a,b\in A}$ , ${\displaystyle |\varphi (b^{*}a)|^{2}\leq \varphi (b^{*}b)\varphi (a^{*}a)}$ .

The next two theorems are further examples in operator algebra.

Theorem (Kadison–Schwarz inequality,[19][20] named after Richard Kadison): If ${\displaystyle \varphi }$  is a unital positive map, then for every normal element ${\displaystyle a}$  in its domain, we have ${\displaystyle \varphi (a^{*}a)\geq \varphi (a^{*})\varphi (a)}$  and ${\displaystyle \varphi (a^{*}a)\geq \varphi (a)\varphi (a^{*})}$ .

This extends the fact ${\displaystyle \varphi (a^{*}a)\cdot 1\geq \varphi (a)^{*}\varphi (a)=|\varphi (a)|^{2}}$ , when ${\displaystyle \varphi }$  is a linear functional. The case when ${\displaystyle a}$  is self-adjoint, i.e. ${\displaystyle a=a^{*},}$  is sometimes known as Kadison's inequality.

Theorem (Modified Schwarz inequality for 2-positive maps):[21] For a 2-positive map ${\displaystyle \varphi }$  between C*-algebras, for all ${\displaystyle a,b}$  in its domain,

${\displaystyle \varphi (a)^{*}\varphi (a)\leq \Vert \varphi (1)\Vert \varphi (a^{*}a),{\text{ and }}}$
${\displaystyle \Vert \varphi (a^{*}b)\Vert ^{2}\leq \Vert \varphi (a^{*}a)\Vert \cdot \Vert \varphi (b^{*}b)\Vert .}$

Another generalization is a refinement obtained by interpolating between both sides the Cauchy-Schwarz inequality:

Theorem (Callebaut's Inequality)[22] For reals ${\displaystyle 0\leqslant s\leqslant t\leqslant 1}$ ,

${\displaystyle {\Bigl (}\sum _{i=1}^{n}a_{i}b_{i}{\Bigr )}^{2}\leqslant \sum _{i=1}^{n}a_{i}^{1+s}b_{i}^{1-s}\sum _{i=1}^{n}a_{i}^{1-s}b_{i}^{1+s}\leqslant \sum _{i=1}^{n}a_{i}^{1+t}b_{i}^{1-t}\sum _{i=1}^{n}a_{i}^{1-t}b_{i}^{1+t}\leqslant \sum _{i=1}^{n}a_{i}^{2}\sum _{i=1}^{n}b_{i}^{2}.}$

It can be easily proven by Hölder's inequality.[23] There are also non commutative versions for operators and tensor products of matrices.[24]

## Notes

1. ^ a b c Steele, J. Michael (2004). "The Cauchy–Schwarz Master Class: an Introduction to the Art of Mathematical Inequalities". The Mathematical Association of America. p. 1. ISBN 978-0521546775. ...there is no doubt that this is one of the most widely used and most important inequalities in all of mathematics.
2. ^ Strang, Gilbert (19 July 2005). "3.2". Linear Algebra and its Applications (4th ed.). Stamford, CT: Cengage Learning. pp. 154–155. ISBN 978-0030105678.
3. ^ a b Hunter, John K.; Nachtergaele, Bruno (2001). Applied Analysis. World Scientific. ISBN 981-02-4191-7.
4. ^ Bachmann, George; Narici, Lawrence; Beckenstein, Edward (2012-12-06). Fourier and Wavelet Analysis. Springer Science & Business Media. p. 14. ISBN 9781461205050.
5. ^ Hassani, Sadri (1999). Mathematical Physics: A Modern Introduction to Its Foundations. Springer. p. 29. ISBN 0-387-98579-4. Equality holds iff <c|c>=0 or |c>=0. From the definition of |c>, we conclude that |a> and |b> must be proportional.
6. ^ Wu, Hui-Hua; Wu, Shanhe (April 2009). "Various proofs of the Cauchy-Schwarz inequality" (PDF). Octogon Mathematical Magazine. 17 (1): 221–229. ISBN 978-973-88255-5-0. ISSN 1222-5657. Retrieved 18 May 2016.
7. ^ Aliprantis, Charalambos D.; Border, Kim C. (2007-05-02). Infinite Dimensional Analysis: A Hitchhiker's Guide. Springer Science & Business Media. ISBN 9783540326960.
8. ^ Bachman, George; Narici, Lawrence (2012-09-26). Functional Analysis. Courier Corporation. p. 141. ISBN 9780486136554.
9. ^ Swartz, Charles (1994-02-21). Measure, Integration and Function Spaces. World Scientific. p. 236. ISBN 9789814502511.
10. ^ Ricardo, Henry (2009-10-21). A Modern Introduction to Linear Algebra. CRC Press. p. 18. ISBN 9781439894613.
11. ^ Banerjee, Sudipto; Roy, Anindya (2014-06-06). Linear Algebra and Matrix Analysis for Statistics. CRC Press. p. 181. ISBN 9781482248241.
12. ^ Valenza, Robert J. (2012-12-06). Linear Algebra: An Introduction to Abstract Mathematics. Springer Science & Business Media. p. 146. ISBN 9781461209010.
13. ^ Constantin, Adrian (2016-05-21). Fourier Analysis with Applications. Cambridge University Press. p. 74. ISBN 9781107044104.
14. ^ Mukhopadhyay, Nitis (2000-03-22). Probability and Statistical Inference. CRC Press. p. 150. ISBN 9780824703790.
15. ^ Keener, Robert W. (2010-09-08). Theoretical Statistics: Topics for a Core Course. Springer Science & Business Media. p. 71. ISBN 9780387938394.
16. ^ Faria, Edson de; Melo, Welington de (2010-08-12). Mathematical Aspects of Quantum Field Theory. Cambridge University Press. p. 273. ISBN 9781139489805.
17. ^ Lin, Huaxin (2001-01-01). An Introduction to the Classification of Amenable C*-algebras. World Scientific. p. 27. ISBN 9789812799883.
18. ^ Arveson, W. (2012-12-06). An Invitation to C*-Algebras. Springer Science & Business Media. p. 28. ISBN 9781461263715.
19. ^ Størmer, Erling (2012-12-13). Positive Linear Maps of Operator Algebras. Springer Monographs in Mathematics. Springer Science & Business Media. ISBN 9783642343698.
20. ^ Kadison, Richard V. (1952-01-01). "A Generalized Schwarz Inequality and Algebraic Invariants for Operator Algebras". Annals of Mathematics. 56 (3): 494–503. doi:10.2307/1969657. JSTOR 1969657.
21. ^ Paulsen, Vern (2002). Completely Bounded Maps and Operator Algebras. Cambridge Studies in Advanced Mathematics. 78. Cambridge University Press. p. 40. ISBN 9780521816694.
22. ^ Callebaut, D.K. (1965). "Generalization of the Cauchy–Schwarz inequality". J. Math. Anal. Appl. 12: 491–494. doi:10.1016/0022-247X(65)90016-8.
23. ^ Callebaut's inequality. Entry in the AoPS Wiki.
24. ^ Moslehian, M.S.; Matharu, J.S.; Aujla, J.S. (2011). Non-commutative Callebaut inequality (PDF). ArXiv.