The Dot Product
Multiply vectors to measure alignment and compute angles
In the previous lessons, you learned to add vectors (combining displacements) and scale them (stretching or shrinking). But there is a question we have not yet addressed: can you multiply two vectors together? And if so, what would that even mean?
With regular numbers, multiplication is straightforward. Three times four gives you twelve. But vectors are not single numbers; they are arrows with both magnitude and direction. If you try to “multiply” two arrows together, what should the result be? Another arrow? A number? Something else entirely?
It turns out there are multiple ways to define multiplication for vectors, and each one captures something different. In this lesson, we will explore the dot product, which takes two vectors and produces a single number (a scalar). This number tells you something profound: how much the two vectors “agree” with each other, how aligned they are. When two vectors point in the same direction, their dot product is large and positive. When they point in opposite directions, the dot product is large and negative. When they are perpendicular, the dot product is exactly zero.
This simple operation unlocks a surprising range of applications. You can use it to find angles between vectors, determine whether two lines are perpendicular, calculate the work done by a force, measure the similarity between data points, and project one vector onto another. The dot product is one of the most useful tools in linear algebra.
Core Concepts
What Does It Mean to “Multiply” Vectors?
Before we define the dot product, let us think about what we might want from a vector multiplication operation.
One natural idea is to multiply corresponding components, just like we add corresponding components in vector addition. If $\vec{u} = \begin{pmatrix} u_1 \ u_2 \end{pmatrix}$ and $\vec{v} = \begin{pmatrix} v_1 \ v_2 \end{pmatrix}$, we could define:
$$\begin{pmatrix} u_1 \ u_2 \end{pmatrix} \cdot \begin{pmatrix} v_1 \ v_2 \end{pmatrix} = \begin{pmatrix} u_1 \cdot v_1 \ u_2 \cdot v_2 \end{pmatrix}$$
This is called component-wise multiplication, and while it exists (it is sometimes called the Hadamard product), it is not particularly useful for most applications. The result is another vector, and it does not capture the geometric relationship between the two vectors.
The dot product takes a different approach. Instead of producing a vector, it produces a scalar (a single number). This scalar encodes how much the two vectors point in the same direction.
The Dot Product Formula
The dot product of two vectors $\vec{u}$ and $\vec{v}$ is defined as the sum of the products of corresponding components.
For 2D vectors:
$$\vec{u} \cdot \vec{v} = \begin{pmatrix} u_1 \ u_2 \end{pmatrix} \cdot \begin{pmatrix} v_1 \ v_2 \end{pmatrix} = u_1v_1 + u_2v_2$$
For 3D vectors:
$$\vec{u} \cdot \vec{v} = \begin{pmatrix} u_1 \ u_2 \ u_3 \end{pmatrix} \cdot \begin{pmatrix} v_1 \ v_2 \ v_3 \end{pmatrix} = u_1v_1 + u_2v_2 + u_3v_3$$
And in general, for $n$-dimensional vectors:
$$\vec{u} \cdot \vec{v} = u_1v_1 + u_2v_2 + \cdots + u_nv_n = \sum_{i=1}^{n} u_iv_i$$
The notation uses a dot between the vectors, which is why this operation is called the “dot product.” Some textbooks call it the inner product or scalar product (because the result is a scalar).
Notice the key difference from vector addition: you multiply corresponding components, then add up all those products to get a single number. The result is not a vector; it is a scalar.
A Simple Computation
Let us compute a dot product to see how easy the formula is.
$$\begin{pmatrix} 1 \ 2 \end{pmatrix} \cdot \begin{pmatrix} 3 \ 4 \end{pmatrix} = (1)(3) + (2)(4) = 3 + 8 = 11$$
The answer is 11, a single number. Not a vector, just a number.
Here is another example:
$$\begin{pmatrix} 2 \ -1 \ 3 \end{pmatrix} \cdot \begin{pmatrix} 4 \ 0 \ -2 \end{pmatrix} = (2)(4) + (-1)(0) + (3)(-2) = 8 + 0 - 6 = 2$$
The calculation is straightforward: multiply corresponding components, then add.
The Geometric Interpretation
The formula $u_1v_1 + u_2v_2$ is useful for computation, but it does not immediately reveal what the dot product means geometrically. Here is the remarkable fact that connects algebra to geometry:
$$\vec{u} \cdot \vec{v} = |\vec{u}| |\vec{v}| \cos\theta$$
where $\theta$ is the angle between the two vectors (measured when you place them tail-to-tail).
This formula tells you that the dot product depends on three things:
- The magnitude of $\vec{u}$
- The magnitude of $\vec{v}$
- The angle $\theta$ between them
The $\cos\theta$ factor is the key. Let us think about what it means:
- When $\theta = 0°$ (vectors point in the same direction), $\cos 0° = 1$, so $\vec{u} \cdot \vec{v} = |\vec{u}| |\vec{v}|$. The dot product is as large as possible.
- When $\theta = 90°$ (vectors are perpendicular), $\cos 90° = 0$, so $\vec{u} \cdot \vec{v} = 0$. Perpendicular vectors have zero dot product.
- When $\theta = 180°$ (vectors point in opposite directions), $\cos 180° = -1$, so $\vec{u} \cdot \vec{v} = -|\vec{u}| |\vec{v}|$. The dot product is as negative as possible.
The dot product measures alignment. Two vectors that point in similar directions have a positive dot product. Two vectors that point in opposite directions have a negative dot product. Two vectors that are perpendicular have a dot product of zero.
Finding Angles Between Vectors
By rearranging the geometric formula, we can solve for the angle between two vectors:
$$\cos\theta = \frac{\vec{u} \cdot \vec{v}}{|\vec{u}| |\vec{v}|}$$
Therefore:
$$\theta = \arccos\left(\frac{\vec{u} \cdot \vec{v}}{|\vec{u}| |\vec{v}|}\right)$$
This is incredibly useful. Given any two non-zero vectors, you can find the angle between them by:
- Computing their dot product
- Computing both magnitudes
- Dividing the dot product by the product of magnitudes
- Taking the inverse cosine (arccos)
The result is the angle in the range $[0°, 180°]$ (or $[0, \pi]$ radians).
Orthogonal Vectors
Two vectors are orthogonal (another word for perpendicular) if the angle between them is $90°$. Since $\cos 90° = 0$, this happens exactly when:
$$\vec{u} \cdot \vec{v} = 0$$
This gives us a simple test for perpendicularity: two vectors are orthogonal if and only if their dot product is zero.
The term “orthogonal” comes from Greek and literally means “right-angled.” In linear algebra, orthogonal is used more often than perpendicular, especially in higher dimensions where the geometric intuition of perpendicular lines in a plane becomes harder to visualize.
Some important orthogonal pairs:
- $\begin{pmatrix} 1 \ 0 \end{pmatrix}$ and $\begin{pmatrix} 0 \ 1 \end{pmatrix}$ (the standard basis vectors in 2D)
- $\begin{pmatrix} 1 \ 1 \end{pmatrix}$ and $\begin{pmatrix} 1 \ -1 \end{pmatrix}$ (check: $1 \cdot 1 + 1 \cdot (-1) = 0$)
- Any vector and the zero vector (since $\vec{v} \cdot \vec{0} = 0$ for all $\vec{v}$)
Projection of One Vector onto Another
Suppose you have two vectors $\vec{u}$ and $\vec{v}$, and you want to know how much of $\vec{u}$ goes in the direction of $\vec{v}$. This is called the projection of $\vec{u}$ onto $\vec{v}$.
Imagine shining a light straight down onto a line in the direction of $\vec{v}$. The shadow of $\vec{u}$ on that line is the projection.
The scalar projection (also called the component of $\vec{u}$ in the direction of $\vec{v}$) is:
$$\text{comp}_{\vec{v}}\vec{u} = \frac{\vec{u} \cdot \vec{v}}{|\vec{v}|}$$
This tells you the signed length of the shadow. It is positive if $\vec{u}$ has a component in the same direction as $\vec{v}$, and negative if it points somewhat opposite to $\vec{v}$.
The vector projection gives you the actual projection as a vector:
$$\text{proj}_{\vec{v}}\vec{u} = \frac{\vec{u} \cdot \vec{v}}{|\vec{v}|^2}\vec{v} = \frac{\vec{u} \cdot \vec{v}}{\vec{v} \cdot \vec{v}}\vec{v}$$
Notice that we divide by $|\vec{v}|^2$ (which equals $\vec{v} \cdot \vec{v}$), then multiply by $\vec{v}$. The result is a vector that:
- Points in the direction of $\vec{v}$ (or opposite to $\vec{v}$ if the dot product is negative)
- Has length equal to the scalar projection
Projections are essential in many applications: decomposing forces, finding the closest point on a line, and building orthonormal bases.
The Dot Product and Magnitude
There is a beautiful relationship between the dot product and magnitude. The dot product of a vector with itself gives the square of its magnitude:
$$\vec{v} \cdot \vec{v} = |\vec{v}|^2$$
You can verify this with the formula. If $\vec{v} = \begin{pmatrix} v_1 \ v_2 \end{pmatrix}$:
$$\vec{v} \cdot \vec{v} = v_1 \cdot v_1 + v_2 \cdot v_2 = v_1^2 + v_2^2$$
And by the Pythagorean theorem, this is exactly $|\vec{v}|^2$.
This relationship is useful for computing magnitudes: $|\vec{v}| = \sqrt{\vec{v} \cdot \vec{v}}$.
Notation and Terminology
| Term | Meaning | Example |
|---|---|---|
| $\vec{u} \cdot \vec{v}$ | Dot product (scalar result) | $\begin{pmatrix} 1 \ 2 \end{pmatrix} \cdot \begin{pmatrix} 3 \ 4 \end{pmatrix} = 11$ |
| Orthogonal | Perpendicular ($\vec{u} \cdot \vec{v} = 0$) | $\begin{pmatrix} 1 \ 0 \end{pmatrix} \perp \begin{pmatrix} 0 \ 1 \end{pmatrix}$ |
| $\perp$ | “Is perpendicular to” | $\vec{u} \perp \vec{v}$ means $\vec{u} \cdot \vec{v} = 0$ |
| Projection | Component of $\vec{u}$ in direction of $\vec{v}$ | $\text{proj}_{\vec{v}}\vec{u}$ |
| Scalar product | Another name for dot product | Used interchangeably |
| Inner product | Another name for dot product | Common in more advanced contexts |
| $|\vec{v}|^2 = \vec{v} \cdot \vec{v}$ | Magnitude squared via dot product | $\left|\begin{pmatrix} 3 \ 4 \end{pmatrix}\right|^2 = 9 + 16 = 25$ |
| $\theta$ | Angle between two vectors | Found using $\cos\theta = \frac{\vec{u} \cdot \vec{v}}{|\vec{u}||\vec{v}|}$ |
Examples
Compute $\begin{pmatrix} 2 \ 3 \end{pmatrix} \cdot \begin{pmatrix} 4 \ -1 \end{pmatrix}$.
Solution:
Use the dot product formula: multiply corresponding components and add.
Step 1: Multiply the first components. $$2 \cdot 4 = 8$$
Step 2: Multiply the second components. $$3 \cdot (-1) = -3$$
Step 3: Add the products. $$8 + (-3) = 5$$
Answer: $\begin{pmatrix} 2 \ 3 \end{pmatrix} \cdot \begin{pmatrix} 4 \ -1 \end{pmatrix} = 5$
Interpretation: The positive result tells us that these vectors point in somewhat similar directions (the angle between them is less than 90 degrees).
Are $\begin{pmatrix} 3 \ -2 \end{pmatrix}$ and $\begin{pmatrix} 2 \ 3 \end{pmatrix}$ orthogonal?
Solution:
Two vectors are orthogonal if and only if their dot product equals zero. Let us compute the dot product.
Step 1: Compute the dot product. $$\begin{pmatrix} 3 \ -2 \end{pmatrix} \cdot \begin{pmatrix} 2 \ 3 \end{pmatrix} = (3)(2) + (-2)(3) = 6 - 6 = 0$$
Step 2: Check the result.
Since the dot product equals zero, the vectors are orthogonal.
Answer: Yes, $\begin{pmatrix} 3 \ -2 \end{pmatrix}$ and $\begin{pmatrix} 2 \ 3 \end{pmatrix}$ are orthogonal (perpendicular).
Geometric insight: If you draw these vectors on a coordinate plane, they meet at a right angle. The vector $\begin{pmatrix} 3 \ -2 \end{pmatrix}$ points to the lower right, while $\begin{pmatrix} 2 \ 3 \end{pmatrix}$ points to the upper right. They are exactly perpendicular.
Find the angle between $\begin{pmatrix} 1 \ 0 \end{pmatrix}$ and $\begin{pmatrix} 1 \ 1 \end{pmatrix}$.
Solution:
We use the formula $\cos\theta = \frac{\vec{u} \cdot \vec{v}}{|\vec{u}| |\vec{v}|}$.
Step 1: Compute the dot product. $$\begin{pmatrix} 1 \ 0 \end{pmatrix} \cdot \begin{pmatrix} 1 \ 1 \end{pmatrix} = (1)(1) + (0)(1) = 1 + 0 = 1$$
Step 2: Compute the magnitude of each vector.
For $\begin{pmatrix} 1 \ 0 \end{pmatrix}$: $$\left|\begin{pmatrix} 1 \ 0 \end{pmatrix}\right| = \sqrt{1^2 + 0^2} = \sqrt{1} = 1$$
For $\begin{pmatrix} 1 \ 1 \end{pmatrix}$: $$\left|\begin{pmatrix} 1 \ 1 \end{pmatrix}\right| = \sqrt{1^2 + 1^2} = \sqrt{2}$$
Step 3: Apply the formula. $$\cos\theta = \frac{1}{1 \cdot \sqrt{2}} = \frac{1}{\sqrt{2}} = \frac{\sqrt{2}}{2}$$
Step 4: Find the angle. $$\theta = \arccos\left(\frac{\sqrt{2}}{2}\right) = 45°$$
Answer: The angle between the vectors is $45°$ (or $\frac{\pi}{4}$ radians).
Interpretation: The vector $\begin{pmatrix} 1 \ 0 \end{pmatrix}$ points directly along the positive $x$-axis. The vector $\begin{pmatrix} 1 \ 1 \end{pmatrix}$ points diagonally, exactly halfway between the positive $x$-axis and positive $y$-axis. The angle between them is indeed 45 degrees.
Project $\begin{pmatrix} 3 \ 4 \end{pmatrix}$ onto $\begin{pmatrix} 1 \ 0 \end{pmatrix}$.
Solution:
We use the projection formula: $\text{proj}_{\vec{v}}\vec{u} = \frac{\vec{u} \cdot \vec{v}}{\vec{v} \cdot \vec{v}}\vec{v}$
Here $\vec{u} = \begin{pmatrix} 3 \ 4 \end{pmatrix}$ and $\vec{v} = \begin{pmatrix} 1 \ 0 \end{pmatrix}$.
Step 1: Compute $\vec{u} \cdot \vec{v}$. $$\begin{pmatrix} 3 \ 4 \end{pmatrix} \cdot \begin{pmatrix} 1 \ 0 \end{pmatrix} = (3)(1) + (4)(0) = 3$$
Step 2: Compute $\vec{v} \cdot \vec{v}$. $$\begin{pmatrix} 1 \ 0 \end{pmatrix} \cdot \begin{pmatrix} 1 \ 0 \end{pmatrix} = (1)(1) + (0)(0) = 1$$
Step 3: Apply the projection formula. $$\text{proj}_{\vec{v}}\vec{u} = \frac{3}{1}\begin{pmatrix} 1 \ 0 \end{pmatrix} = 3\begin{pmatrix} 1 \ 0 \end{pmatrix} = \begin{pmatrix} 3 \ 0 \end{pmatrix}$$
Answer: The projection of $\begin{pmatrix} 3 \ 4 \end{pmatrix}$ onto $\begin{pmatrix} 1 \ 0 \end{pmatrix}$ is $\begin{pmatrix} 3 \ 0 \end{pmatrix}$.
Interpretation: The vector $\begin{pmatrix} 1 \ 0 \end{pmatrix}$ points along the $x$-axis. Projecting $\begin{pmatrix} 3 \ 4 \end{pmatrix}$ onto the $x$-axis means dropping the $y$-component and keeping only the $x$-component. The “shadow” of the vector on the $x$-axis has length 3. This makes geometric sense: the $x$-component of $\begin{pmatrix} 3 \ 4 \end{pmatrix}$ is exactly 3.
Find all vectors orthogonal to $\begin{pmatrix} 2 \ -3 \end{pmatrix}$.
Solution:
A vector $\begin{pmatrix} x \ y \end{pmatrix}$ is orthogonal to $\begin{pmatrix} 2 \ -3 \end{pmatrix}$ if and only if their dot product is zero.
Step 1: Set up the orthogonality condition. $$\begin{pmatrix} 2 \ -3 \end{pmatrix} \cdot \begin{pmatrix} x \ y \end{pmatrix} = 0$$
Step 2: Expand using the dot product formula. $$2x + (-3)y = 0$$ $$2x - 3y = 0$$
Step 3: Solve for the relationship between $x$ and $y$. $$2x = 3y$$ $$x = \frac{3}{2}y$$
Step 4: Express the general solution.
Any vector of the form $\begin{pmatrix} \frac{3}{2}y \ y \end{pmatrix}$ will be orthogonal to $\begin{pmatrix} 2 \ -3 \end{pmatrix}$.
We can factor out $y$: $$\begin{pmatrix} \frac{3}{2}y \ y \end{pmatrix} = y\begin{pmatrix} \frac{3}{2} \ 1 \end{pmatrix} = y\begin{pmatrix} 3/2 \ 1 \end{pmatrix}$$
Or, to avoid fractions, we can write this as: $$t\begin{pmatrix} 3 \ 2 \end{pmatrix}$$
where $t$ is any real number.
Answer: All vectors orthogonal to $\begin{pmatrix} 2 \ -3 \end{pmatrix}$ are scalar multiples of $\begin{pmatrix} 3 \ 2 \end{pmatrix}$. In set notation:
$$\left{ t\begin{pmatrix} 3 \ 2 \end{pmatrix} : t \in \mathbb{R} \right}$$
Verification: Let us check that $\begin{pmatrix} 3 \ 2 \end{pmatrix}$ is indeed orthogonal to $\begin{pmatrix} 2 \ -3 \end{pmatrix}$: $$\begin{pmatrix} 2 \ -3 \end{pmatrix} \cdot \begin{pmatrix} 3 \ 2 \end{pmatrix} = (2)(3) + (-3)(2) = 6 - 6 = 0 \quad \checkmark$$
Geometric insight: In 2D, the set of all vectors orthogonal to a given non-zero vector forms a line through the origin. This line is perpendicular to the given vector. Every vector on this line can be obtained by scaling a single “basis” vector for that line.
Key Properties and Rules
Algebraic Properties of the Dot Product
The dot product satisfies several important properties that make it behave nicely in algebraic manipulations:
1. Commutativity: $\vec{u} \cdot \vec{v} = \vec{v} \cdot \vec{u}$
The order does not matter. This follows from the commutativity of ordinary multiplication: $u_1v_1 + u_2v_2 = v_1u_1 + v_2u_2$.
2. Distributivity over addition: $\vec{u} \cdot (\vec{v} + \vec{w}) = \vec{u} \cdot \vec{v} + \vec{u} \cdot \vec{w}$
The dot product distributes just like regular multiplication distributes over addition.
3. Scalar multiplication: $(c\vec{u}) \cdot \vec{v} = c(\vec{u} \cdot \vec{v}) = \vec{u} \cdot (c\vec{v})$
You can pull scalar factors outside the dot product.
4. Dot product with the zero vector: $\vec{v} \cdot \vec{0} = 0$
The dot product of any vector with the zero vector is zero.
5. Dot product with itself: $\vec{v} \cdot \vec{v} = |\vec{v}|^2 \geq 0$
The dot product of a vector with itself is always non-negative, and equals zero only when $\vec{v} = \vec{0}$.
Geometric Properties
Sign of the dot product and angle:
| Dot Product | Angle $\theta$ | Interpretation |
|---|---|---|
| $\vec{u} \cdot \vec{v} > 0$ | $0° < \theta < 90°$ | Vectors point in similar directions |
| $\vec{u} \cdot \vec{v} = 0$ | $\theta = 90°$ | Vectors are orthogonal |
| $\vec{u} \cdot \vec{v} < 0$ | $90° < \theta < 180°$ | Vectors point in opposite directions |
Maximum and minimum values:
For fixed magnitudes $|\vec{u}|$ and $|\vec{v}|$:
- Maximum value: $|\vec{u}||\vec{v}|$ (when $\theta = 0°$, vectors parallel, same direction)
- Minimum value: $-|\vec{u}||\vec{v}|$ (when $\theta = 180°$, vectors parallel, opposite directions)
The Cauchy-Schwarz Inequality
A fundamental inequality in linear algebra states that:
$$|\vec{u} \cdot \vec{v}| \leq |\vec{u}| |\vec{v}|$$
The absolute value of the dot product cannot exceed the product of the magnitudes. Equality holds if and only if one vector is a scalar multiple of the other (they are parallel).
This inequality follows immediately from the geometric formula: since $|\cos\theta| \leq 1$, we have $|\vec{u} \cdot \vec{v}| = ||\vec{u}||\vec{v}|\cos\theta| \leq |\vec{u}||\vec{v}|$.
Real-World Applications
Work in Physics
In physics, work is defined as force times distance, but only the component of force in the direction of motion counts. If you push a box at an angle, only the part of your push that is in the direction the box moves contributes to the work done.
The formula for work is:
$$W = \vec{F} \cdot \vec{d}$$
where $\vec{F}$ is the force vector and $\vec{d}$ is the displacement vector.
If you push with 10 newtons of force at a 60-degree angle to the ground, and the box moves 5 meters along the ground:
- $|\vec{F}| = 10$ N
- $|\vec{d}| = 5$ m
- $\theta = 60°$
$$W = |\vec{F}||\vec{d}|\cos\theta = 10 \cdot 5 \cdot \cos 60° = 50 \cdot 0.5 = 25 \text{ joules}$$
Only half of your effort actually moves the box horizontally; the rest is wasted pushing it into the ground.
Cosine Similarity in Machine Learning
In machine learning and data science, the cosine similarity between two vectors measures how similar they are in direction, regardless of magnitude:
$$\text{cosine similarity} = \frac{\vec{u} \cdot \vec{v}}{|\vec{u}||\vec{v}|} = \cos\theta$$
This is widely used in:
- Document comparison: Represent documents as vectors of word frequencies, then compute cosine similarity to find similar documents
- Recommendation systems: Find users with similar preferences by comparing their rating vectors
- Image recognition: Compare feature vectors to identify similar images
Cosine similarity ranges from -1 (opposite directions) to 1 (same direction), with 0 indicating orthogonality (no similarity).
Determining Perpendicular Paths
In navigation, engineering, and architecture, you often need to know if two paths or lines are perpendicular. Direction vectors make this easy.
If a road runs in the direction $\begin{pmatrix} 3 \ 4 \end{pmatrix}$ and you want to build a path perpendicular to it, you need a direction vector $\vec{v}$ such that:
$$\begin{pmatrix} 3 \ 4 \end{pmatrix} \cdot \vec{v} = 0$$
One solution is $\vec{v} = \begin{pmatrix} 4 \ -3 \end{pmatrix}$ (check: $3 \cdot 4 + 4 \cdot (-3) = 12 - 12 = 0$).
Light Reflection in Computer Graphics
In computer graphics, the amount of light reflected off a surface depends on the angle between the incoming light and the surface normal (the vector perpendicular to the surface).
If $\vec{L}$ is the direction to the light source (a unit vector) and $\vec{N}$ is the surface normal (also a unit vector), the intensity of light hitting the surface is proportional to:
$$I = \vec{L} \cdot \vec{N} = \cos\theta$$
When the light hits straight on ($\theta = 0°$), the surface appears brightest. When the light is at a glancing angle ($\theta$ near $90°$), the surface appears dim. This calculation happens millions of times per frame in video games and rendered animations.
Self-Test Problems
Problem 1: Compute $\begin{pmatrix} 5 \ -2 \end{pmatrix} \cdot \begin{pmatrix} 3 \ 7 \end{pmatrix}$.
Show Answer
Multiply corresponding components and add:
$$\begin{pmatrix} 5 \ -2 \end{pmatrix} \cdot \begin{pmatrix} 3 \ 7 \end{pmatrix} = (5)(3) + (-2)(7) = 15 - 14 = 1$$
The dot product is 1.
Problem 2: Compute $\begin{pmatrix} 1 \ 2 \ 3 \end{pmatrix} \cdot \begin{pmatrix} 4 \ -1 \ 2 \end{pmatrix}$.
Show Answer
For 3D vectors, multiply corresponding components and add all three products:
$$\begin{pmatrix} 1 \ 2 \ 3 \end{pmatrix} \cdot \begin{pmatrix} 4 \ -1 \ 2 \end{pmatrix} = (1)(4) + (2)(-1) + (3)(2) = 4 - 2 + 6 = 8$$
The dot product is 8.
Problem 3: Are $\begin{pmatrix} 4 \ 6 \end{pmatrix}$ and $\begin{pmatrix} 3 \ -2 \end{pmatrix}$ orthogonal?
Show Answer
Compute the dot product:
$$\begin{pmatrix} 4 \ 6 \end{pmatrix} \cdot \begin{pmatrix} 3 \ -2 \end{pmatrix} = (4)(3) + (6)(-2) = 12 - 12 = 0$$
Since the dot product is zero, yes, the vectors are orthogonal (perpendicular).
Problem 4: Find the angle between $\begin{pmatrix} 1 \ 1 \end{pmatrix}$ and $\begin{pmatrix} -1 \ 1 \end{pmatrix}$.
Show Answer
Step 1: Compute the dot product. $$\begin{pmatrix} 1 \ 1 \end{pmatrix} \cdot \begin{pmatrix} -1 \ 1 \end{pmatrix} = (1)(-1) + (1)(1) = -1 + 1 = 0$$
Step 2: Since the dot product is zero, the vectors are orthogonal.
Answer: The angle is $90°$ (or $\frac{\pi}{2}$ radians).
Problem 5: Project $\begin{pmatrix} 4 \ 3 \end{pmatrix}$ onto $\begin{pmatrix} 1 \ 1 \end{pmatrix}$.
Show Answer
Step 1: Compute $\vec{u} \cdot \vec{v}$. $$\begin{pmatrix} 4 \ 3 \end{pmatrix} \cdot \begin{pmatrix} 1 \ 1 \end{pmatrix} = 4 + 3 = 7$$
Step 2: Compute $\vec{v} \cdot \vec{v}$. $$\begin{pmatrix} 1 \ 1 \end{pmatrix} \cdot \begin{pmatrix} 1 \ 1 \end{pmatrix} = 1 + 1 = 2$$
Step 3: Apply the projection formula. $$\text{proj}_{\vec{v}}\vec{u} = \frac{7}{2}\begin{pmatrix} 1 \ 1 \end{pmatrix} = \begin{pmatrix} 7/2 \ 7/2 \end{pmatrix} = \begin{pmatrix} 3.5 \ 3.5 \end{pmatrix}$$
Problem 6: Find a vector orthogonal to $\begin{pmatrix} 5 \ 12 \end{pmatrix}$.
Show Answer
We need $\begin{pmatrix} x \ y \end{pmatrix}$ such that $5x + 12y = 0$.
One simple solution: let $y = 5$, then $x = -12$.
Answer: $\begin{pmatrix} -12 \ 5 \end{pmatrix}$ is orthogonal to $\begin{pmatrix} 5 \ 12 \end{pmatrix}$.
Verification: $(5)(-12) + (12)(5) = -60 + 60 = 0$ (check)
Any scalar multiple of $\begin{pmatrix} -12 \ 5 \end{pmatrix}$ is also orthogonal to $\begin{pmatrix} 5 \ 12 \end{pmatrix}$.
Problem 7: If $\vec{u} \cdot \vec{v} = -8$, $|\vec{u}| = 2$, and $|\vec{v}| = 5$, find the angle between $\vec{u}$ and $\vec{v}$.
Show Answer
Use the formula $\cos\theta = \frac{\vec{u} \cdot \vec{v}}{|\vec{u}||\vec{v}|}$:
$$\cos\theta = \frac{-8}{2 \cdot 5} = \frac{-8}{10} = -0.8$$
$$\theta = \arccos(-0.8) \approx 143.1°$$
The negative dot product tells us the angle is greater than 90 degrees.
Problem 8: Use the dot product to find $\left|\begin{pmatrix} 2 \ -3 \ 6 \end{pmatrix}\right|$.
Show Answer
Recall that $|\vec{v}|^2 = \vec{v} \cdot \vec{v}$.
$$\vec{v} \cdot \vec{v} = \begin{pmatrix} 2 \ -3 \ 6 \end{pmatrix} \cdot \begin{pmatrix} 2 \ -3 \ 6 \end{pmatrix} = 4 + 9 + 36 = 49$$
Therefore:
$$|\vec{v}| = \sqrt{49} = 7$$
Summary
-
The dot product of two vectors $\vec{u}$ and $\vec{v}$ is defined as $\vec{u} \cdot \vec{v} = u_1v_1 + u_2v_2 + \cdots + u_nv_n$. Multiply corresponding components and add.
-
The result is a scalar (a number), not a vector.
-
Geometric interpretation: $\vec{u} \cdot \vec{v} = |\vec{u}||\vec{v}|\cos\theta$, where $\theta$ is the angle between the vectors.
-
To find the angle between vectors: $\theta = \arccos\left(\frac{\vec{u} \cdot \vec{v}}{|\vec{u}||\vec{v}|}\right)$
-
Two vectors are orthogonal (perpendicular) if and only if $\vec{u} \cdot \vec{v} = 0$.
-
The projection of $\vec{u}$ onto $\vec{v}$ is $\text{proj}_{\vec{v}}\vec{u} = \frac{\vec{u} \cdot \vec{v}}{\vec{v} \cdot \vec{v}}\vec{v}$.
-
The dot product of a vector with itself gives the magnitude squared: $\vec{v} \cdot \vec{v} = |\vec{v}|^2$.
-
Key properties: commutative ($\vec{u} \cdot \vec{v} = \vec{v} \cdot \vec{u}$), distributive ($\vec{u} \cdot (\vec{v} + \vec{w}) = \vec{u} \cdot \vec{v} + \vec{u} \cdot \vec{w}$), and scalars factor out ($(c\vec{u}) \cdot \vec{v} = c(\vec{u} \cdot \vec{v})$).
-
Sign interpretation: Positive dot product means similar directions; negative means opposite directions; zero means perpendicular.
-
Real-world uses include calculating work in physics, cosine similarity in machine learning, detecting perpendicular paths, and lighting calculations in computer graphics.