AcademyVectors

Academy

Dot Product

Level 1 - Math II (Physics) topic page in Vectors.

Principle

The dot product, also called the scalar product, combines two vectors and outputs a scalar. Geometrically, it measures how much two vectors point in the same direction.

For non-zero vectors \(\mathbf a\) and \(\mathbf b\), if the angle between them is \(\theta\), then

Geometric dot product
\[\mathbf a\cdot\mathbf b=|\mathbf a||\mathbf b|\cos\theta\]

Componentwise, when \(\mathbf a\) and \(\mathbf b\) are written in the same Cartesian coordinate system, multiply matching components and add the products.

Notation

\(\mathbf a\cdot\mathbf b\)
the dot product of vectors \mathbf a and \mathbf b
\(\mathbf c\)
an additional vector in the same vector space as \mathbf a and \mathbf b
\(\lambda,\mu\)
scalars
\(|\mathbf a|\)
the magnitude of \mathbf a
\(|\mathbf b|\)
the magnitude of \mathbf b
\(\theta\)
the angle from \mathbf a to \mathbf b, measured between their directions when both vectors are non-zero
\(\mathbf a\perp\mathbf b\)
\mathbf a and \mathbf b are orthogonal, meaning perpendicular
\(a_i\)
component i of \mathbf a in a chosen Cartesian basis
\(b_i\)
component i of \mathbf b in the same Cartesian basis
\(\mathbf i,\mathbf j,\mathbf k\)
Cartesian unit basis vectors in the x, y, and z directions
\(\operatorname{proj}_{\mathbf b}\mathbf a\)
the vector projection of \mathbf a onto the direction of non-zero vector \mathbf b

A projection is the part of one vector in the direction of another. The scalar projection of \(\mathbf a\) onto non-zero \(\mathbf b\) is \( |\mathbf a|\cos\theta \), and the dot product equals this scalar projection multiplied by \( |\mathbf b| \).

Orthogonal vectors meet at a right angle. For non-zero vectors, this means \(\theta=\frac{\pi}{2}\).

Method

Step 1: Choose the available form

If magnitudes and the angle are known, use the geometric formula:

Magnitude-angle formula
\[\mathbf a\cdot\mathbf b=|\mathbf a||\mathbf b|\cos\theta\]

If Cartesian components are known in the same basis, use the component formula:

Three-dimensional component formula
\[\mathbf a\cdot\mathbf b=a_1b_1+a_2b_2+a_3b_3\]

Step 2: Compute from magnitudes and angle

Let \( |\mathbf a|=A \), \( |\mathbf b|=B \), and \(\theta=\phi\), then evaluate \(\cos\phi\):

Start with the geometric formula
\[\mathbf a\cdot\mathbf b=|\mathbf a||\mathbf b|\cos\theta\]
Use placeholders for the known values
\[|\mathbf a|=A,quad |\mathbf b|=B,quad \theta=\phi\]
Substitute the placeholders
\[\mathbf a\cdot\mathbf b=AB\cos\phi\]
Evaluate the cosine value
\[\mathbf a\cdot\mathbf b=AB(\cos\phi)\]

Step 3: Compute from Cartesian components

Write both vectors in the same Cartesian basis:

First vector
\[\mathbf a=a_1\mathbf i+a_2\mathbf j+a_3\mathbf k\]
Second vector
\[\mathbf b=b_1\mathbf i+b_2\mathbf j+b_3\mathbf k\]
Multiply matching components and add
\[\mathbf a\cdot\mathbf b=a_1b_1+a_2b_2+a_3b_3\]

The result is one scalar, not a vector.

Rules

Commutativity
\[\mathbf a\cdot\mathbf b=\mathbf b\cdot\mathbf a\]
Self dot product
\[\mathbf a\cdot\mathbf a=|\mathbf a|^2\]
Linearity in the first input
\[(\lambda\mathbf a+\mu\mathbf c)\cdot\mathbf b=\lambda(\mathbf a\cdot\mathbf b)+\mu(\mathbf c\cdot\mathbf b)\]
Linearity in the second input
\[\mathbf a\cdot(\lambda\mathbf b+\mu\mathbf c)=\lambda(\mathbf a\cdot\mathbf b)+\mu(\mathbf a\cdot\mathbf c)\]
Orthogonality criterion
\[\mathbf a,\mathbf b\ne\mathbf 0:\quad \mathbf a\perp\mathbf b\Longleftrightarrow\mathbf a\cdot\mathbf b=0\]

The orthogonality criterion requires both vectors to be non-zero. The zero vector has zero dot product with every vector but has no unique direction.

For non-zero \(\mathbf b\), the vector projection of \(\mathbf a\) onto \(\mathbf b\) is

Vector projection
\[\operatorname{proj}_{\mathbf b}\mathbf a=\frac{\mathbf a\cdot\mathbf b}{|\mathbf b|^2}\mathbf b\]

Component formula from basis products

Use bilinearity, which means the dot product distributes over vector addition and scalar multiplication in each input. In the Cartesian basis,

Unit basis dot products
\[\mathbf i\cdot\mathbf i=\mathbf j\cdot\mathbf j=\mathbf k\cdot\mathbf k=1\]

and the mixed basis dot products are zero:

Mixed basis dot products
\[\mathbf i\cdot\mathbf j=\mathbf i\cdot\mathbf k=\mathbf j\cdot\mathbf i=\mathbf j\cdot\mathbf k=\mathbf k\cdot\mathbf i=\mathbf k\cdot\mathbf j=0\]

If \(\mathbf a=a_1\mathbf i+a_2\mathbf j+a_3\mathbf k\) and \(\mathbf b=b_1\mathbf i+b_2\mathbf j+b_3\mathbf k\), then

Start from Cartesian expansions
\[\mathbf a\cdot\mathbf b=(a_1\mathbf i+a_2\mathbf j+a_3\mathbf k)\cdot(b_1\mathbf i+b_2\mathbf j+b_3\mathbf k)\]
Distribute over the second input
\[\mathbf a\cdot\mathbf b=(a_1\mathbf i+a_2\mathbf j+a_3\mathbf k)\cdot b_1\mathbf i+(a_1\mathbf i+a_2\mathbf j+a_3\mathbf k)\cdot b_2\mathbf j+(a_1\mathbf i+a_2\mathbf j+a_3\mathbf k)\cdot b_3\mathbf k\]
Move scalars out
\[\mathbf a\cdot\mathbf b=b_1(a_1\mathbf i+a_2\mathbf j+a_3\mathbf k)\cdot\mathbf i+b_2(a_1\mathbf i+a_2\mathbf j+a_3\mathbf k)\cdot\mathbf j+b_3(a_1\mathbf i+a_2\mathbf j+a_3\mathbf k)\cdot\mathbf k\]
Distribute over the first input
\[\mathbf a\cdot\mathbf b=b_1(a_1\mathbf i\cdot\mathbf i+a_2\mathbf j\cdot\mathbf i+a_3\mathbf k\cdot\mathbf i)+b_2(a_1\mathbf i\cdot\mathbf j+a_2\mathbf j\cdot\mathbf j+a_3\mathbf k\cdot\mathbf j)+b_3(a_1\mathbf i\cdot\mathbf k+a_2\mathbf j\cdot\mathbf k+a_3\mathbf k\cdot\mathbf k)\]
Use basis dot products
\[\mathbf a\cdot\mathbf b=b_1(a_1\cdot1+a_2\cdot0+a_3\cdot0)+b_2(a_1\cdot0+a_2\cdot1+a_3\cdot0)+b_3(a_1\cdot0+a_2\cdot0+a_3\cdot1)\]
Simplify each bracket
\[\mathbf a\cdot\mathbf b=b_1a_1+b_2a_2+b_3a_3\]
Reorder scalar products
\[\mathbf a\cdot\mathbf b=a_1b_1+a_2b_2+a_3b_3\]

Cosine rule from the dot product

Let \(\theta\) be the angle between non-zero \(\mathbf a\) and \(\mathbf b\). Start with the squared magnitude of \(\mathbf a-\mathbf b\), expand it using the dot product, then substitute the geometric definition of \(\mathbf a\cdot\mathbf b\):

Start with squared magnitude
\[|\mathbf a-\mathbf b|^2=(\mathbf a-\mathbf b)\cdot(\mathbf a-\mathbf b)\]
Distribute over the second input
\[(\mathbf a-\mathbf b)\cdot(\mathbf a-\mathbf b)=(\mathbf a-\mathbf b)\cdot\mathbf a-(\mathbf a-\mathbf b)\cdot\mathbf b\]
Distribute over the first input in both terms
\[(\mathbf a-\mathbf b)\cdot\mathbf a-(\mathbf a-\mathbf b)\cdot\mathbf b=\mathbf a\cdot\mathbf a-\mathbf b\cdot\mathbf a-\mathbf a\cdot\mathbf b+\mathbf b\cdot\mathbf b\]
Use commutativity
\[\mathbf a\cdot\mathbf a-\mathbf b\cdot\mathbf a-\mathbf a\cdot\mathbf b+\mathbf b\cdot\mathbf b=\mathbf a\cdot\mathbf a-\mathbf a\cdot\mathbf b-\mathbf a\cdot\mathbf b+\mathbf b\cdot\mathbf b\]
Combine like terms
\[|\mathbf a-\mathbf b|^2=\mathbf a\cdot\mathbf a-2\mathbf a\cdot\mathbf b+\mathbf b\cdot\mathbf b\]
Substitute self dot products
\[|\mathbf a-\mathbf b|^2=|\mathbf a|^2-2\mathbf a\cdot\mathbf b+|\mathbf b|^2\]
Substitute the geometric dot product
\[|\mathbf a-\mathbf b|^2=|\mathbf a|^2-2|\mathbf a||\mathbf b|\cos\theta+|\mathbf b|^2\]
Reorder scalar terms
\[|\mathbf a-\mathbf b|^2=|\mathbf a|^2+|\mathbf b|^2-2|\mathbf a||\mathbf b|\cos\theta\]

Examples

Question
Compute
\[\mathbf a\cdot\mathbf b\]
when
\[|\mathbf a|=1\]
\[|\mathbf b|=\sqrt2\]
and
\[\theta=\pi/4\]
Answer
Use
\[\mathbf a\cdot\mathbf b=|\mathbf a||\mathbf b|\cos\theta\]
Substitute the values:
\[\mathbf a\cdot\mathbf b=1\cdot\sqrt2\cdot\cos(\pi/4)\]
Since
\[\cos(\pi/4)=\sqrt2/2\]
\[\mathbf a\cdot\mathbf b=\sqrt2\cdot\sqrt2/2=2/2=1\]

Checks

  • The dot product outputs a scalar, not a vector.
  • When using calculus conventions, the angle \(\theta\) must be measured in radians.
  • A zero dot product means perpendicular only when both vectors are non-zero.