Tutorials › Linear Algebra › The Standard Dot Product On R^n

Inner Products and Norms · Tutorial 596 of 1000

The Standard Dot Product On R^n

Learn to calculate dot products and Euclidean lengths in \(\mathbb{R}^n\), verify the real inner product properties, and interpret the sign of a dot product.

Intermediate 8 min read

What You'll Learn

  • Compute the standard dot product by multiplying corresponding coordinates and adding.
  • Obtain Euclidean length from the dot product of a vector with itself.
  • Verify symmetry, linearity, and positive definiteness for the standard dot product.
  • Interpret positive, negative, and zero dot products as signed coordinate alignment.
  • Recognize why a zero dot product does not require either vector to be zero.

The Standard Dot Product

Vectors in \(\mathbb{R}^n\) have coordinates, and the standard dot product combines those coordinates into one real number. This number is useful both for calculating lengths and for comparing how two vectors point in relation to one another. Its definition is short, but its properties matter: the standard dot product is the basic example of a real inner product.

Write vectors as columns, so \(\mathbf{u}=(u_1,\dots,u_n)^{\top}\) and \(\mathbf{v}=(v_1,\dots,v_n)^{\top}\), where each coordinate is real. The dot product multiplies corresponding coordinates and adds the results. In matrix notation, it can also be calculated by multiplying the row \(\mathbf{u}^{\top}\) by the column \(\mathbf{v}\).

Definition: For \(\mathbf{u},\mathbf{v}\in\mathbb{R}^n\), their standard dot product is \(\mathbf{u}\cdot\mathbf{v}=\sum_{i=1}^{n}u_i v_i=u_1v_1+\cdots+u_nv_n=\mathbf{u}^{\top}\mathbf{v}\). The associated Euclidean length of \(\mathbf{u}\) is \(\|\mathbf{u}\|=\sqrt{\mathbf{u}\cdot\mathbf{u}}=\sqrt{u_1^2+\cdots+u_n^2}\).

The dot product is a real number, not a vector. The length is also a real number and is always nonnegative, because it is the square root of a sum of squares. For example, in \(\mathbb{R}^3\), if \(\mathbf{u}=(u_1,u_2,u_3)^{\top}\) and \(\mathbf{v}=(v_1,v_2,v_3)^{\top}\), then \(\mathbf{u}\cdot\mathbf{v}=u_1v_1+u_2v_2+u_3v_3\), while \(\|\mathbf{u}\|=\sqrt{u_1^2+u_2^2+u_3^2}\).

Computing Dot Products and Lengths

Worked Example: Dot Product and Length in \(\mathbb{R}^3\)

Let \(\mathbf{u}=(2,-1,3)^{\top}\) and \(\mathbf{v}=(1,4,-2)^{\top}\). Calculate their dot product and the length of each vector.

Multiply corresponding coordinates and add:

$$ \mathbf{u}\cdot\mathbf{v} =2(1)+(-1)(4)+3(-2) =2-4-6 =-8. $$

To calculate the lengths, take the dot product of each vector with itself:

$$ \begin{aligned} \mathbf{u}\cdot\mathbf{u}&=2^2+(-1)^2+3^2=4+1+9=14,\\ \|\mathbf{u}\|&=\sqrt{14},\\ \mathbf{v}\cdot\mathbf{v}&=1^2+4^2+(-2)^2=1+16+4=21,\\ \|\mathbf{v}\|&=\sqrt{21}. \end{aligned} $$

Check: the length calculations square each coordinate, so the negative entries contribute positively. In particular, \(\sqrt{14}\) squared is \(14=\mathbf{u}\cdot\mathbf{u}\), and \(\sqrt{21}\) squared is \(21=\mathbf{v}\cdot\mathbf{v}\). The dot product is \(-8\), since the three coordinate contributions are \(2\), \(-4\), and \(-6\).

The same calculation applies in any \(\mathbb{R}^n\): the number of coordinates determines how many products are added, but the rule does not change. It can be helpful to write out every coordinate product before combining them, especially when vectors contain negative entries.

Worked Example: A Zero Dot Product

Let \(\mathbf{a}=(1,2)^{\top}\) and \(\mathbf{b}=(2,-1)^{\top}\). Calculate the dot product and check whether either vector is zero.

The dot product is

$$ \mathbf{a}\cdot\mathbf{b} =1(2)+2(-1) =2-2 =0. $$

The vectors themselves are nonzero because \(\mathbf{a}\) has first coordinate \(1\), and \(\mathbf{b}\) has first coordinate \(2\). Their lengths confirm this:

$$ \|\mathbf{a}\|=\sqrt{1^2+2^2}=\sqrt{5}, \qquad \|\mathbf{b}\|=\sqrt{2^2+(-1)^2}=\sqrt{5}. $$

Check: \(\mathbf{a}\cdot\mathbf{b}=0\) follows from cancellation between the coordinate products \(2\) and \(-2\); it does not follow from either vector being zero. This example is called a pair of nonzero vectors with zero dot product, or dot-product-orthogonal vectors.

Why the Standard Dot Product Is an Inner Product

A real inner product on a real vector space is a rule that assigns a real number to each pair of vectors and satisfies symmetry, linearity in each argument, and positive definiteness. Here, positive definiteness means that a vector’s inner product with itself is nonnegative, and equals zero exactly for the zero vector. The next theorem verifies these properties directly for the standard dot product on \(\mathbb{R}^n\).

Theorem: For all \(\mathbf{u},\mathbf{v},\mathbf{w}\in\mathbb{R}^n\) and \(a,b\in\mathbb{R}\), the standard dot product satisfies:
  • Symmetry: \(\mathbf{u}\cdot\mathbf{v}=\mathbf{v}\cdot\mathbf{u}\).
  • Linearity in the first argument: \((a\mathbf{u}+b\mathbf{v})\cdot\mathbf{w}=a(\mathbf{u}\cdot\mathbf{w})+b(\mathbf{v}\cdot\mathbf{w})\).
  • Linearity in the second argument: \(\mathbf{u}\cdot(a\mathbf{v}+b\mathbf{w})=a(\mathbf{u}\cdot\mathbf{v})+b(\mathbf{u}\cdot\mathbf{w})\).
  • Positive definiteness: \(\mathbf{u}\cdot\mathbf{u}\geq 0\), and \(\mathbf{u}\cdot\mathbf{u}=0\) if and only if \(\mathbf{u}=\mathbf{0}\).
Therefore the standard dot product is a real inner product on \(\mathbb{R}^n\).

Proof. Write \(\mathbf{u}=(u_1,\dots,u_n)^{\top}\), \(\mathbf{v}=(v_1,\dots,v_n)^{\top}\), and \(\mathbf{w}=(w_1,\dots,w_n)^{\top}\). For symmetry, real-number multiplication is commutative, so \(\mathbf{u}\cdot\mathbf{v}=\sum_{i=1}^{n}u_iv_i=\sum_{i=1}^{n}v_iu_i=\mathbf{v}\cdot\mathbf{u}\). The \(i\)th coordinate of \(a\mathbf{u}+b\mathbf{v}\) is \(au_i+bv_i\). Therefore \((a\mathbf{u}+b\mathbf{v})\cdot\mathbf{w}=\sum_{i=1}^{n}(au_i+bv_i)w_i =a\sum_{i=1}^{n}u_iw_i+b\sum_{i=1}^{n}v_iw_i =a(\mathbf{u}\cdot\mathbf{w})+b(\mathbf{v}\cdot\mathbf{w})\). For linearity in the second argument, the \(i\)th coordinate of \(a\mathbf{v}+b\mathbf{w}\) is \(av_i+bw_i\), and hence \(\mathbf{u}\cdot(a\mathbf{v}+b\mathbf{w})=\sum_{i=1}^{n}u_i(av_i+bw_i) =a\sum_{i=1}^{n}u_iv_i+b\sum_{i=1}^{n}u_iw_i =a(\mathbf{u}\cdot\mathbf{v})+b(\mathbf{u}\cdot\mathbf{w})\). Finally, \(\mathbf{u}\cdot\mathbf{u}=\sum_{i=1}^{n}u_i^2\), a sum of nonnegative real numbers. It equals zero if \(\mathbf{u}=\mathbf{0}\). Conversely, if the sum is zero, no \(u_i^2\) can be positive, since then the whole sum would be positive. Thus every \(u_i^2=0\), so every \(u_i=0\), and \(\mathbf{u}=\mathbf{0}\). This proves all the stated properties. \(\square\)

Symmetry says the order of the two vectors does not affect the answer. Linearity says that combining vectors in either argument distributes through the dot product and allows scalars to be factored out. These properties are not extra computational rules invented for convenience: they follow from the coordinate formula and the ordinary rules of real arithmetic.

The Dot Product as Signed Coordinate Alignment

Each product \(u_iv_i\) compares the two coordinates in position \(i\). If the coordinates have the same sign, their product is positive; if they have opposite signs, it is negative; and if either is zero, the product is zero. The full dot product adds these signed contributions. A positive result means positive contributions outweigh negative ones, while a negative result means negative contributions outweigh positive ones. A zero result can occur through cancellation, as in the preceding example.

The numerical value also depends on the sizes of the vectors. For example, multiplying one vector by a positive scalar multiplies the dot product by that scalar, so the value is not a scale-free comparison of direction by itself. The scaling rule follows directly from linearity.

Proposition: For \(\mathbf{u},\mathbf{v}\in\mathbb{R}^n\) and real scalars \(a,b\), \((a\mathbf{u})\cdot(b\mathbf{v})=ab(\mathbf{u}\cdot\mathbf{v})\).

Proof. The \(i\)th coordinates of \(a\mathbf{u}\) and \(b\mathbf{v}\) are \(au_i\) and \(bv_i\). By the definition of the standard dot product, \((a\mathbf{u})\cdot(b\mathbf{v})=\sum_{i=1}^{n}(au_i)(bv_i) =ab\sum_{i=1}^{n}u_iv_i=ab(\mathbf{u}\cdot\mathbf{v})\). This computation also covers \(a=0\) or \(b=0\), since both sides are then zero. \(\square\)

Consequently, changing the sign of exactly one vector reverses the sign of the dot product, while multiplying both vectors by negative scalars preserves its sign. Dot products are particularly useful when the vector lengths are fixed or when the sign itself is the question. To interpret the value as an angle or to compare it independently of length requires additional results, which are not needed for coordinate computations.

Common Mistakes and a Coordinate Check

A frequent error is to lose a negative sign when multiplying corresponding coordinates. For the vectors in the first example, a mistaken calculation might replace \((-1)(4)\) by \(+4\), giving \(2+4-6=0\). That answer is incorrect: the second coordinate product is \(-4\), so the correct calculation is \(2-4-6=-8\). A reliable check is to write each product with parentheses before adding.

Another mistake is to confuse the dot product with the length. The dot product \(\mathbf{u}\cdot\mathbf{v}\) uses two vectors and may be negative; the length \(\|\mathbf{u}\|\) uses one vector twice and cannot be negative. For any \(\mathbf{u}\), the formulas make the distinction explicit:

$$ \mathbf{u}\cdot\mathbf{v}=\sum_{i=1}^{n}u_iv_i, \qquad \|\mathbf{u}\|=\sqrt{\sum_{i=1}^{n}u_i^2}. $$

The standard basis offers a compact check of the coordinate rule. The vector \(\mathbf{e}_i\) has a \(1\) in coordinate \(i\) and zeros elsewhere. Thus \(\mathbf{e}_i\cdot\mathbf{e}_j=1\) when \(i=j\), and \(0\) when \(i\ne j\): when the positions differ, every coordinate product is zero. More generally, writing \(\mathbf{u}=\sum_{i=1}^{n}u_i\mathbf{e}_i\) and \(\mathbf{v}=\sum_{i=1}^{n}v_i\mathbf{e}_i\) gives \(\mathbf{u}\cdot\mathbf{v}=\sum_{i=1}^{n}u_iv_i\), since only matching basis positions contribute.

Worked Example: Testing the Sign and Length

Let \(\mathbf{p}=(3,4)^{\top}\) and \(\mathbf{q}=(-1,2)^{\top}\). Find their dot product and the length of \(\mathbf{p}\), then interpret the sign.

Multiplying matching coordinates gives

$$ \mathbf{p}\cdot\mathbf{q} =3(-1)+4(2) =-3+8 =5. $$

The length of \(\mathbf{p}\) is

$$ \|\mathbf{p}\| =\sqrt{\mathbf{p}\cdot\mathbf{p}} =\sqrt{3^2+4^2} =\sqrt{9+16} =5. $$

Check: \(3(3)+4(4)=9+16=25\), and \(5^2=25\), as required by the length formula. The dot product is positive because the positive contribution \(4(2)=8\) exceeds the negative contribution \(3(-1)=-3\). The sign describes the combined coordinate contributions; it does not mean that every coordinate pair has the same sign.

Check Your Understanding

For each calculation, show the coordinate products explicitly and use the definitions to check the result.

  1. Calculate \((2,-3,1)^{\top}\cdot(4,1,-2)^{\top}\).
  2. Find the Euclidean length of \((-5,12)^{\top}\).
  3. Give two nonzero vectors in \(\mathbb{R}^2\) whose dot product is zero, and verify the calculation.
  4. State which real inner product property ensures that \(\mathbf{u}\cdot\mathbf{v}=\mathbf{v}\cdot\mathbf{u}\), and verify it from coordinates.
  5. Explain why a zero dot product does not imply that one of the vectors is zero.

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