Tutorials › Linear Algebra › Angles In Real Inner Product Spaces

Inner Products and Norms · Tutorial 619 of 1000

Angles In Real Inner Product Spaces

Learn to define and calculate angles in real inner product spaces, and understand why the normalized inner product always determines a unique angle from zero to pi.

Intermediate 10 min read

What You'll Learn

  • Define the angle between two nonzero vectors using their normalized inner product.
  • Use the real Cauchy–Schwarz inequality to show that the angle is well-defined.
  • Calculate angles in standard and weighted coordinate inner products.
  • Calculate an angle between polynomials using an integral inner product.
  • Relate angle calculations to scaling and the cosine law.

From Inner Products to Angles

In Euclidean geometry, an angle describes how two directions relate. An inner product gives a way to express that relationship even when vectors are not presented as arrows in the plane. The key quantity is the inner product divided by the lengths of both vectors: this normalized value measures their alignment without depending on their sizes. The real Cauchy–Schwarz inequality ensures that it is always a number from \(-1\) to \(1\), so it can be the cosine of a unique angle.

Throughout, \(V\) is a vector space over \(\mathbb{R}\) with a real inner product \(\langle\cdot,\cdot\rangle\). Such an inner product is symmetric and bilinear, and it satisfies \(\langle\mathbf{x},\mathbf{x}\rangle>0\) whenever \(\mathbf{x}\ne\mathbf{0}\). Its induced norm is \(\|\mathbf{x}\|=\sqrt{\langle\mathbf{x},\mathbf{x}\rangle}\). In particular, \(\|\mathbf{x}\|>0\) for every nonzero vector. We use radians, so angles lie between \(0\) and \(\pi\), inclusive.

Definition: For nonzero vectors \(\mathbf{u},\mathbf{v}\in V\), their angle \(\theta\) is defined by \(\displaystyle \theta=\arccos\!\left(\frac{\langle\mathbf{u},\mathbf{v}\rangle}{\|\mathbf{u}\|\,\|\mathbf{v}\|}\right)\), where \(\arccos\) takes values in \([0,\pi]\). The normalized inner product inside \(\arccos\) is the cosine of the angle.

The condition that both vectors be nonzero matters: if either vector is zero, the denominator vanishes, and this definition does not assign an angle. The Real Cauchy–Schwarz Inequality, established earlier, states that \(|\langle\mathbf{u},\mathbf{v}\rangle|\leq\|\mathbf{u}\|\,\|\mathbf{v}\|\) for vectors in a real inner product space. Dividing by the positive product of the norms places the normalized inner product in \([-1,1]\). Since cosine takes each value in this interval exactly once on \([0,\pi]\), the definition gives one and only one angle.

Theorem (Well-defined angle): For any nonzero \(\mathbf{u},\mathbf{v}\) in a real inner product space, the angle in the definition exists uniquely and belongs to \([0,\pi]\).

Proof. Since \(\mathbf{u}\) and \(\mathbf{v}\) are nonzero, positive definiteness gives \(\|\mathbf{u}\|\,\|\mathbf{v}\|>0\). The Real Cauchy–Schwarz Inequality applies to these vectors and gives \(|\langle\mathbf{u},\mathbf{v}\rangle|\leq\|\mathbf{u}\|\,\|\mathbf{v}\|\). Dividing by the positive denominator shows that \(-1\leq\langle\mathbf{u},\mathbf{v}\rangle/(\|\mathbf{u}\|\,\|\mathbf{v}\|)\leq1\). Thus the inverse cosine is defined and produces an angle in \([0,\pi]\). The cosine function is one-to-one on this interval, so no other angle in the interval can have the same cosine. \(\square\)

Calculating Angles in Coordinate Spaces

In \(\mathbb{R}^n\) with the standard inner product, \(\langle\mathbf{u},\mathbf{v}\rangle=\mathbf{u}^{\top}\mathbf{v}\). The calculation has three parts: find the inner product, find both norms, and divide by their product. Keep the normalization in the formula; the inner product by itself is generally not the cosine.

Worked Example: An Angle of \(\pi/3\) in \(\mathbb{R}^2\)

Let \(\mathbf{u}=(1,0)^{\top}\) and \(\mathbf{v}=(1,\sqrt{3})^{\top}\), using the standard inner product. Find the angle between them.

First calculate the inner product and norms:

$$ \langle\mathbf{u},\mathbf{v}\rangle =1\cdot1+0\cdot\sqrt{3}=1, \qquad \|\mathbf{u}\|=\sqrt{1^2+0^2}=1, \qquad \|\mathbf{v}\|=\sqrt{1^2+(\sqrt{3})^2}=2. $$

The normalized inner product is \(1/(1\cdot2)=1/2\), so the angle is \(\arccos(1/2)=\pi/3\).

Check: \(\cos(\pi/3)=1/2\), which equals \(\langle\mathbf{u},\mathbf{v}\rangle/(\|\mathbf{u}\|\,\|\mathbf{v}\|)\). Both vectors are nonzero, as required.

The same definition works with other real inner products. The inner product determines the norms too, so changing the inner product can change the angle even when the coordinates stay fixed. For instance, on \(\mathbb{R}^2\) the formula \(\langle\mathbf{x},\mathbf{y}\rangle=2x_1y_1+x_2y_2\) is a real inner product: it is symmetric and bilinear, and \(\langle\mathbf{x},\mathbf{x}\rangle=2x_1^2+x_2^2>0\) whenever \(\mathbf{x}\ne\mathbf{0}\).

Worked Example: An Angle with a Weighted Inner Product

Use the inner product \(\langle\mathbf{x},\mathbf{y}\rangle=2x_1y_1+x_2y_2\) and the vectors \(\mathbf{u}=(1,0)^{\top}\), \(\mathbf{v}=(1,1)^{\top}\). Find their angle.

The inner product and squared norms are \(\langle\mathbf{u},\mathbf{v}\rangle=2(1)(1)+(0)(1)=2\), \(\|\mathbf{u}\|^2=2(1)^2+(0)^2=2\), and \(\|\mathbf{v}\|^2=2(1)^2+(1)^2=3\). Therefore, \(\|\mathbf{u}\|=\sqrt{2}\) and \(\|\mathbf{v}\|=\sqrt{3}\). The normalized inner product is

$$ \frac{\langle\mathbf{u},\mathbf{v}\rangle} {\|\mathbf{u}\|\,\|\mathbf{v}\|} =\frac{2}{\sqrt{2}\sqrt{3}} =\frac{2}{\sqrt{6}} =\sqrt{\frac{2}{3}}. $$

Thus the angle is \(\arccos\!\bigl(\sqrt{2/3}\bigr)\).

Check: The cosine of this angle is \(\sqrt{2/3}\), and the direct inner-product calculation gives the same value. In particular, using the standard dot product on these coordinates would give a different normalized value; the inner product specified in the question must be used for both the numerator and the norms.

How Angles Behave Under Scaling

The normalized inner product also explains how rescaling vectors affects their angle. Multiplying a vector by a positive scalar changes its length but not its direction. Multiplying by a negative scalar reverses its direction, which replaces an angle by its supplement.

Theorem (Scaling and symmetry): Let \(\mathbf{u},\mathbf{v}\) be nonzero vectors in a real inner product space, and let \(\theta\) be their angle. Interchanging \(\mathbf{u}\) and \(\mathbf{v}\) leaves the angle unchanged. For nonzero real scalars \(a,b\), the angle between \(a\mathbf{u}\) and \(b\mathbf{v}\) is \(\theta\) if \(ab>0\), and \(\pi-\theta\) if \(ab<0\).

Proof. Symmetry of the real inner product gives \(\langle\mathbf{v},\mathbf{u}\rangle=\langle\mathbf{u},\mathbf{v}\rangle\), and the product \(\|\mathbf{u}\|\,\|\mathbf{v}\|\) is unchanged when its factors are interchanged. The normalized inner product, and therefore its inverse cosine, is unchanged. For scaling, bilinearity gives \(\langle a\mathbf{u},b\mathbf{v}\rangle=ab\langle\mathbf{u},\mathbf{v}\rangle\), while the induced norm satisfies \(\|a\mathbf{u}\|=|a|\|\mathbf{u}\|\) and \(\|b\mathbf{v}\|=|b|\|\mathbf{v}\|\). The normalized inner product of the scaled vectors is consequently \[ \frac{ab}{|a||b|}\, \frac{\langle\mathbf{u},\mathbf{v}\rangle}{\|\mathbf{u}\|\,\|\mathbf{v}\|}. \] The factor \(ab/(|a||b|)\) is \(1\) when \(ab>0\) and \(-1\) when \(ab<0\). In the first case the angle is \(\theta\). In the second case the cosine is \(-\cos\theta\), which equals \(\cos(\pi-\theta)\). Since both angles are in \([0,\pi]\), uniqueness from the well-defined angle theorem gives \(\pi-\theta\). \(\square\)

An angle can also be read from the lengths in the triangle formed by \(\mathbf{0}\), \(\mathbf{u}\), and \(\mathbf{v}\). The vector from \(\mathbf{u}\) to \(\mathbf{v}\) is \(\mathbf{v}-\mathbf{u}\). Expanding its squared norm gives the inner-product version of the cosine law.

Theorem (Cosine law from an inner product): For nonzero \(\mathbf{u},\mathbf{v}\) in a real inner product space, with angle \(\theta\) between them, \(\|\mathbf{u}-\mathbf{v}\|^2=\|\mathbf{u}\|^2+\|\mathbf{v}\|^2-2\|\mathbf{u}\|\,\|\mathbf{v}\|\cos\theta\).

Proof. Bilinearity and symmetry give \(\|\mathbf{u}-\mathbf{v}\|^2=\langle\mathbf{u}-\mathbf{v},\mathbf{u}-\mathbf{v}\rangle=\|\mathbf{u}\|^2+\|\mathbf{v}\|^2-2\langle\mathbf{u},\mathbf{v}\rangle\). By the definition of \(\theta\), \(\langle\mathbf{u},\mathbf{v}\rangle=\|\mathbf{u}\|\,\|\mathbf{v}\|\cos\theta\). Substitution gives the stated formula. \(\square\)

Worked Example: An Angle Between Polynomials

Consider the real polynomials \(p(x)=1\) and \(q(x)=1+x\) with inner product \(\langle f,g\rangle=\int_{-1}^{1}f(x)g(x)\,dx\). Find their angle.

The inner product is

$$ \langle p,q\rangle =\int_{-1}^{1}(1+x)\,dx =\left[x+\frac{x^2}{2}\right]_{-1}^{1} =2. $$

For the norms, first compute each squared norm: \(\|p\|^2=\int_{-1}^{1}1\,dx=2\), and \(\|q\|^2=\int_{-1}^{1}(1+x)^2\,dx\). Expanding and integrating gives

$$ \|q\|^2 =\int_{-1}^{1}(1+2x+x^2)\,dx =\left[x+x^2+\frac{x^3}{3}\right]_{-1}^{1} =\frac{8}{3}. $$

Hence \(\|p\|=\sqrt{2}\), \(\|q\|=\sqrt{8/3}\), and their product is \(\sqrt{16/3}=4/\sqrt{3}\). The normalized inner product is \(2/(4/\sqrt{3})=\sqrt{3}/2\), so the angle is \(\arccos(\sqrt{3}/2)=\pi/6\).

Check: \(\cos(\pi/6)=\sqrt{3}/2\), matching the normalized inner product. Neither polynomial is zero, so both norms in the denominator are positive.

Common Mistakes and a Reliable Check

Mistake: treating the inner product itself as the cosine. For example, in standard \(\mathbb{R}^2\), take \(\mathbf{u}=(1,1)^{\top}\) and \(\mathbf{v}=(1,0)^{\top}\). A wrong calculation sets \(\cos\theta=\langle\mathbf{u},\mathbf{v}\rangle=1\), and concludes \(\theta=0\). But the vectors are not in the same direction. The correction is to divide by both norms: \(\|\mathbf{u}\|=\sqrt{2}\), \(\|\mathbf{v}\|=1\), and \(\langle\mathbf{u},\mathbf{v}\rangle=1\). Thus \(\cos\theta=1/\sqrt{2}\) and \(\theta=\pi/4\). Substitution checks the answer because \(\cos(\pi/4)=1/\sqrt{2}\).

A second error is applying the formula when one vector is zero. If \(\mathbf{u}=\mathbf{0}\), then \(\|\mathbf{u}\|\,\|\mathbf{v}\|=0\), so the normalized inner product is undefined. The angle definition therefore does not apply; do not assign an angle by dividing by zero or by treating the zero vector as a direction.

For any valid calculation, check that both vectors are nonzero, that the correct inner product is used in the numerator and in each norm, and that the normalized result lies in \([-1,1]\). Then confirm that taking the cosine of the proposed angle recovers that result. This last check catches many arithmetic and inverse-cosine errors.

Check Your Understanding

Use the definition of angle and show the inner product and both norms in each calculation.

  1. In standard \(\mathbb{R}^2\), find the angle between \((1,0)^{\top}\) and \((1,1)^{\top}\).
  2. For the weighted inner product \(\langle\mathbf{x},\mathbf{y}\rangle=3x_1y_1+x_2y_2\), find the normalized inner product of \((1,0)^{\top}\) and \((1,1)^{\top}\).
  3. Explain why the angle definition does not apply to a pair that includes the zero vector.
  4. If the angle between \(\mathbf{u}\) and \(\mathbf{v}\) is \(\theta\), what is the angle between \(-\mathbf{u}\) and \(\mathbf{v}\)?
  5. Starting from bilinearity and symmetry, derive the inner-product cosine law for \(\|\mathbf{u}-\mathbf{v}\|^2\).

Test yourself: Linear Algebra final exam practice

Ready to check what you know? Work a full-length practice final, then open the complete worked solutions.

Want all 1,114 practice problems?

This tutorial covers one topic. Calc Pass covers the full Calculus AB & BC curriculum (the core of Calculus I and II): full review, every practice question, and step-by-step solutions to each one.

QR code to download the Calc Pass app

Get the Calc Pass App

Scan to download and practice on the go, with instant scoring.

Calc Pass Volume 1: 1,114 Practice Questions book cover

Vol. 1: 1,114 Questions

The complete practice question bank, organized by AB & BC topic.

View on Amazon
Calc Pass Volume 2: Solutions Manual book cover

Vol. 2: Solutions Manual

Fully worked solutions to every question in Volume 1.

View on Amazon