4.3: Inner Product and Euclidean Norm
The inner product \((x,y)\) between vectors \(x\) and \(y\) is a scalar consisting of the following sum of products:
\[(x,y) = x_1y_1+x_2y_2+x_3y_3+⋯+x_ny_n \nonumber \]
This definition seems so arbitrary that we wonder what uses it could possibly have. We will show that the inner product has three main uses:
- computing length or “norm”,
- finding angles between vectors and checking for “orthogonality”, and
- computing the “component of one vector along another” (projection).
Since the inner product is so useful, we need to know what algebraic operations are permitted when we are working with inner products. The following are some properties of the inner product. Given \(x,y,z\;∈\;\mathbb{R}^n\) and \(a\;∈\;\mathbb{R}\),
- \((x,y)=(y,x)\);
- \((ax,y)=a(x,y)=(x,ay)\); and
- \((x,y+z)=(x,y)+(x,z)\).
Exercise \(\PageIndex{1}\)
Prove the three preceding properties by using the definition of inner product. Is the equation \(x(y,z)=(x,y)z\) also a true property? Prove or give a counterexample.
Euclidean Norm
Sometimes we want to measure the length of a vector, namely, the distance from the origin to the point specified by the vector's coordinates. A vector's length is called the norm of the vector. Recall from Euclidean geometry that the distance between two points is the square root of the sum of the squares of the distances in each dimension. Since we are measuring from the origin, this implies that the norm of the vector x is
\[||x||=\sqrt{x^2_1+x^2_2+...+x^2_n} \nonumber \]
Notice the use of the double vertical bars to indicate the norm. An equivalent definition of the norm, and of the norm squared, can be given in terms of the inner product:
\[||x||=\sqrt{(x,x)} \nonumber \]
or
\[||x||^2=(x,x) \nonumber \]
The Euclidean norm of the vector
\(x=\begin{bmatrix} 1\\3\\5\\−2 \end{bmatrix}\)
is \(||x||=\sqrt{1^2+3^2+5^2+(−2)^2}=\sqrt{39}\)
An important property of the norm and scalar product is that, for any \(x\;∈\;\mathbb{R}^n\) and \(a\;∈\;\mathbb{R}\),
\[||ax||=|a|||x|| \nonumber \]
So we can take a scalar multiplier outside of the norm if we take its absolute value.
Exercise \(\PageIndex{2}\)
Prove \(||ax||=|a|||x||\)
Cauchy-Schwarz Inequality
Inequalities can be useful engineering tools. They can often be used to find the best possible performance of a system, thereby telling you when to quit trying to make improvements (or proving to your boss that it can't be done any better). The most fundamental inequality in linear algebra is the Cauchy-Schwarz inequality. This inequality says that the inner product between two vectors \(x\) and \(y\) is less than or equal (in absolute value) to the norm of \(x\) times the norm of \(y\), with equality if and only if \(y=αx\):
\[|(x,y)|≤||x||\;||y|| \nonumber \]
To prove this theorem, we construct a third vector \(z=λx−y\) and measure its norm squared:
\[||λx−y||^2=(λx−y,λx−y)=λ^2||x||^2−2λ(x,y)+||y||^2≥0 \nonumber \]
So we have a polynomial in \(λ\) that is always greater than or equal to 0 (because every norm squared is greater than or equal to 0). Let's assume that \(x\) and \(y\) are given and minimize this norm squared with respect to \(λ\). To do this, we take the derivative with respect to \(λ\) and equate it to 0:
\[2λ||x||^2−2(x,y)=0\;⇒\;λ=\frac{(x,y)} {||x||^2} \nonumber \]
When this solution is substituted into the formula for the norm squared in Equation\(\PageIndex{7}\), we obtain
\[\begin{bmatrix} \frac {(x,y)} {||x||^2}\end{bmatrix}^2\;||x||^2−\frac {2(x,y)} {||x||^2} (x,y)+||y||^2≥0 \nonumber \]
which simplifies to
\[-\frac {(x,y)^2} {||x||^2} + ||y||^2 ≥ 0 ⇒ (x,y)^2 ≤ ||x||^2||y||^2 \nonumber \]
The proof of the Cauchy-Schwarz inequality is completed by taking the positive square root on both sides of the above Equation. When \(y=αx\), then
\[(x,y)^2=(x,αx)^2=[|α|(x,x)]^2=(|α|||x||^2)^2 \nonumber \]
\[=(|α|^2||x||^2)||x||^2 \nonumber \]
\[=(αx,αx)||x||^2 \nonumber \]
\[=(y,y)||x||^2 \nonumber \]
\[=||y||^2||x|^|2 \nonumber \]
which shows that equality holds in Equation \(\PageIndex{6}\) when y is a scalar multiple of x.
Exercise \(\PageIndex{3}\)
Use the Cauchy-Schwarz inequality to prove the triangle inequality, which states
\(||x+y||≤||x||+||y||\)
Explain why this is called the triangle inequality.