Vectors and the Dot Product
A complete guide to vectors in precalculus: component form, magnitude, unit vectors, vector operations, the dot product formula, angle between vectors, orthogonality, vector projection, and work in physics. Worked examples with every concept.
Quick Reference — Dot Product Formulas
1. Vector Definition and Notation
A vector is a quantity that has both magnitude (size) and direction. This distinguishes it from a scalar, which has only magnitude. In precalculus, two-dimensional vectors are written in component form as an ordered pair inside angle brackets.
Component Form
A vector v from point A to point B is written:
From A(1, 3) to B(5, 7): v = (4, 4). The first component is the horizontal change; the second is the vertical change.
Notation
Vectors are written in several equivalent ways:
Bold or an arrow overhead signals a vector. Scalars use regular type.
Magnitude (Length) of a Vector
The magnitude of v = (a, b) is found using the Pythagorean theorem on the components. The vector forms the hypotenuse of a right triangle with legs of length a and b.
Example: For v = (3, 4), the magnitude is the square root of (9 + 16) which equals the square root of 25, which equals 5.
Unit Vectors
A unit vector has magnitude exactly 1. To convert any nonzero vector v into a unit vector in the same direction, divide by its magnitude:
For v = (3, 4): u-hat = (3/5, 4/5). Check: magnitude = square root of (9/25 + 16/25) = square root of 1 = 1.
Standard Basis Vectors i and j
The two special unit vectors along the coordinate axes are called the standard basis vectors:
Example: (5, -3) = 5i - 3j. This notation is common in physics.
2. Vector Addition and Scalar Multiplication
Two fundamental operations on vectors are addition (combining two vectors into one) and scalar multiplication (stretching or shrinking a vector by a number). Both operations work component by component.
| Operation | Formula | Example |
|---|---|---|
| Addition | (a, b) + (c, d) = (a+c, b+d) | (2, 3) + (1, -5) = (3, -2) |
| Subtraction | (a, b) - (c, d) = (a-c, b-d) | (5, 2) - (3, 4) = (2, -2) |
| Scalar multiply | k(a, b) = (ka, kb) | 3(2, -1) = (6, -3) |
| Magnitude | |(a, b)| = sqrt(a squared + b squared) | |(3, 4)| = sqrt(25) = 5 |
Geometric Interpretation
Vector addition (tip-to-tail method)
Place the tail of the second vector at the tip of the first. The sum (resultant) goes from the tail of the first to the tip of the second. This is how you add force vectors and velocity vectors in physics.
Scalar multiplication
Multiplying a vector by a positive scalar k stretches it by a factor of k without changing direction. A negative scalar reverses the direction and scales the length. Multiplying by -1 gives the opposite vector.
3. The Dot Product
The dot product (also called the scalar product or inner product) takes two vectors and produces a single number (scalar), not another vector. This distinguishes it from the cross product, which gives a vector. The dot product is one of the most important operations in mathematics and physics.
Component Formula
For u = (a1, a2) and v = (b1, b2):
Use this form when you know the components. Multiply the first components together, multiply the second components together, then add.
Geometric Formula
Let theta be the angle between u and v (0 to 180 degrees):
Use this form when you know magnitudes and the angle. Setting both formulas equal lets you find the angle between two vectors.
Key Insight: Sign of the Dot Product
Dot Product Properties
The Self Dot Product and Magnitude
When you take the dot product of a vector with itself, you get the square of its magnitude. This gives a useful alternative formula:
Example: v = (3, 4). Then v · v = (3)(3) + (4)(4) = 9 + 16 = 25. So |v| = square root of 25 = 5.
4. Angle Between Two Vectors
Setting the two dot product formulas equal and solving for the angle theta gives one of the most useful formulas in the chapter. This works for any two nonzero vectors in 2D or 3D and always produces an angle between 0 and 180 degrees.
Angle Formula
The result is always in the range 0 to 180 degrees (0 to pi radians). Both vectors must be nonzero for the formula to be defined.
Step-by-Step Procedure
- 1.Compute the dot product u dot v using the component formula.
- 2.Find the magnitude of u: square root of (a1 squared + a2 squared).
- 3.Find the magnitude of v: square root of (b1 squared + b2 squared).
- 4.Divide the dot product by the product of the two magnitudes to get cos(theta).
- 5.Apply arccos to find theta. Make sure your calculator is set to the correct mode (degrees or radians).
Special Angle Cases
5. Orthogonal Vectors
Two vectors are orthogonal if the angle between them is exactly 90 degrees. Because cos(90) = 0, the dot product formula immediately gives the orthogonality test: two nonzero vectors are orthogonal if and only if their dot product equals zero.
Orthogonality Test
This is the fastest way to check perpendicularity. No angles, no square roots needed — just multiply components and add.
Finding an Orthogonal Vector
Given v = (a, b), a vector orthogonal to v is (-b, a) or (b, -a). Rotating the components and flipping a sign always produces a perpendicular vector.
Check: (3)(-5) + (5)(3) = -15 + 15 = 0. Confirmed orthogonal.
Orthogonal vs. Parallel
Orthogonal (perpendicular)
u dot v = 0. The angle is 90 degrees. The vectors form a right angle when placed tail to tail.
Parallel
One vector is a scalar multiple of the other: v = ku for some scalar k. Same direction if k is positive; opposite direction if k is negative.
6. Vector Projection
The projection of u onto v answers the question: how much of u goes in the direction of v? Think of it as the shadow u casts on the line of v when light shines perpendicular to v. The result is a vector parallel to v.
Scalar Projection
The component of u along v (a signed length):
This is a scalar. Positive means the projection points in the same direction as v; negative means opposite direction.
Vector Projection
The vector component of u in the direction of v:
This is a vector parallel to v. The denominator is |v| squared, not |v|, because we are scaling the unit vector v-hat by the scalar projection.
Decomposing u into Parallel and Perpendicular Parts
Any vector u can be split into two orthogonal components relative to v:
Here proj_v(u) is parallel to v, and u_perp is orthogonal to v. You can verify orthogonality by checking that u_perp dot v equals 0.
Why this matters: This decomposition appears in physics (resolving forces), computer graphics (lighting calculations), and machine learning (least squares regression).
Alternative Formula Using the Unit Vector
If you define v-hat as the unit vector in the direction of v, the projection formula becomes cleaner:
Both formulas are equivalent. The unit vector form emphasizes that projection is the dot product of u with the unit vector, scaled back into vector form.
7. Work as a Dot Product (Physics Application)
In physics, the work done by a constant force F on an object moving through displacement D is defined as the dot product of the force and displacement vectors. This captures the key physical insight: only the component of force parallel to the motion actually contributes to work.
Work Formula
W is measured in Joules (Newton-meters) when F is in Newtons and D is in meters. The angle theta is between the force direction and the displacement direction.
Real-World Example: Pulling a Sled
You pull a sled with a rope making a 35-degree angle above horizontal. The force in the rope is 80 Newtons. The sled moves 15 meters horizontally. How much work is done?
The vertical component of force does no work because the sled does not move vertically. The dot product formula handles this automatically.
Worked Examples
Example 1 — Compute the dot product
Find u · v where u = (5, -2) and v = (3, 4).
- 1.Write the formula: u · v = a1 b1 + a2 b2
- 2.Substitute: u · v = (5)(3) + (-2)(4)
- 3.Compute: 15 + (-8) = 15 - 8
- 4.Result: u · v = 7
Example 2 — Angle between two vectors
Find the angle between u = (2, 1) and v = (-1, 3). Give the answer in degrees.
- 1.Dot product: u · v = (2)(-1) + (1)(3) = -2 + 3 = 1
- 2.Magnitude of u: |u| = sqrt(4 + 1) = sqrt(5)
- 3.Magnitude of v: |v| = sqrt(1 + 9) = sqrt(10)
- 4.cos(theta) = 1 divided by (sqrt(5) times sqrt(10)) = 1 divided by sqrt(50) = 1 divided by (5 sqrt 2)
- 5.theta = arccos(1 / (5 sqrt 2)) which equals approximately arccos(0.1414)
- 6.theta is approximately 81.9 degrees
Example 3 — Test for orthogonality
Are the vectors a = (6, -4) and b = (2, 3) orthogonal?
- 1.Compute the dot product: a · b = (6)(2) + (-4)(3)
- 2.= 12 + (-12)
- 3.= 12 - 12
- 4.= 0
Example 4 — Vector projection
Find the vector projection of u = (3, 2) onto v = (4, 0).
- 1.Compute u · v = (3)(4) + (2)(0) = 12
- 2.Compute |v| squared = 4 squared + 0 squared = 16
- 3.Scalar factor = (u · v) divided by |v| squared = 12 divided by 16 = 3/4
- 4.proj_v(u) = (3/4) times v = (3/4)(4, 0) = (3, 0)
- 5.Perpendicular component = u minus proj_v(u) = (3, 2) minus (3, 0) = (0, 2)
Example 5 — Work done by a force
A force F = (10, 6) Newtons acts on an object that moves along displacement D = (5, 2) meters. Find the work done.
- 1.Work W = F · D
- 2.W = (10)(5) + (6)(2)
- 3.W = 50 + 12
- 4.W = 62 Joules
8. Vectors in Three Dimensions (Brief Introduction)
Everything from the 2D case extends naturally to three dimensions. A 3D vector is an ordered triple (a, b, c) representing displacement along the x, y, and z axes. The dot product formula gains a third term. All the properties and applications remain the same.
3D Formulas
Standard Basis Vectors in 3D
3D Example: Dot Product and Angle
Find the angle between u = (1, 2, 2) and v = (0, 1, -1).
For a full treatment of 3D vectors including the cross product, parametric equations of lines in space, and equations of planes, see the 3D Vectors guide.
9. Applications in Navigation and Physics
Navigation: Resultant Velocity
A boat heads due east at 12 knots. A current flows N 30 E at 4 knots. Find the resultant velocity and its direction.
- 1.Boat velocity vector: B = (12, 0) in (east, north) components
- 2.Current direction N 30 E means 30 degrees east of north: C = (4 sin 30, 4 cos 30) = (2, 3.46)
- 3.Resultant: R = B + C = (12 + 2, 0 + 3.46) = (14, 3.46)
- 4.|R| = square root of (196 + 11.97) = square root of 207.97 is approximately 14.4 knots
- 5.Direction: arctan(3.46 / 14) is approximately 13.9 degrees north of east
Physics: Force Along an Incline
A 500-Newton weight rests on a ramp inclined at 25 degrees. Find the component of gravitational force parallel to the ramp (which causes sliding) and perpendicular to the ramp (which presses into the surface).
- 1.Gravity vector: F = (0, -500) pointing straight down
- 2.Ramp direction (unit vector along ramp, pointing downhill): d = (cos(-25), sin(-25)) = (cos 25, -sin 25)
- 3.Parallel component (scalar projection): F dot d = (0)(cos 25) + (-500)(-sin 25) = 500 sin 25 is approximately 211 N
- 4.This 211 N is the force pulling the object down the slope
- 5.Perpendicular component: 500 cos 25 is approximately 453 N. This is the normal force pressing into the ramp.
Computer Graphics: Lighting (Dot Product in Action)
The dot product is fundamental to 3D graphics. The brightness of a surface at a given point is proportional to the dot product of the surface normal vector and the light direction vector:
Here n-hat is the unit normal to the surface and L-hat is the unit vector toward the light. When they point the same way (dot product near 1), the surface is brightly lit. When perpendicular (dot product 0), the surface receives no direct light. This is the Lambertian reflectance model used in every rendering engine.
Common Mistakes to Avoid
Frequently Asked Questions
What is the dot product formula for two vectors?
For vectors u = (a1, a2) and v = (b1, b2), the dot product is u dot v = a1 times b1 plus a2 times b2. You multiply corresponding components and add the results. Example: (3, 4) dot (2, -1) = 3 times 2 plus 4 times (-1) = 6 - 4 = 2. The result is always a scalar (a plain number), never another vector. In 3D, extend to three components: u dot v = a1 b1 plus a2 b2 plus a3 b3.
How do you find the angle between two vectors using the dot product?
Use the formula cos(theta) = (u dot v) divided by (magnitude of u times magnitude of v). Then take the inverse cosine to find theta. Example: u = (1, 2) and v = (3, -1). Dot product = 3 - 2 = 1. Magnitude of u = sqrt(5). Magnitude of v = sqrt(10). cos(theta) = 1 divided by sqrt(50) = 1 divided by (5 sqrt 2). theta = arccos(1 / (5 sqrt 2)) which is approximately 81.9 degrees. The angle found this way is always between 0 and 180 degrees.
When are two vectors orthogonal (perpendicular)?
Two vectors are orthogonal (perpendicular) when their dot product equals zero. This follows from the angle formula: cos(90 degrees) = 0, so u dot v = magnitude of u times magnitude of v times 0 = 0. To test orthogonality, simply compute the dot product and check if it equals zero. Example: u = (2, 3) and v = (-3, 2). Dot product = (2)(-3) + (3)(2) = -6 + 6 = 0. These vectors are orthogonal.
What is the projection of one vector onto another?
The scalar projection of u onto v (also called the component of u along v) is: comp_v(u) = (u dot v) divided by magnitude of v. The vector projection of u onto v is: proj_v(u) = ((u dot v) divided by (magnitude of v squared)) times v. The vector projection gives you the component of u that lies parallel to v. The perpendicular component is then u minus proj_v(u), which is orthogonal to v. These formulas are used extensively in physics and computer graphics.
How is the dot product used to calculate work in physics?
Work done by a constant force F acting through displacement D is W = F dot D = magnitude of F times magnitude of D times cos(theta), where theta is the angle between the force and displacement vectors. If force and displacement are in the same direction (theta = 0), all the force contributes to work. If perpendicular (theta = 90 degrees), no work is done. Example: Force F = (4, 3) Newtons, displacement D = (6, 0) meters. W = (4)(6) + (3)(0) = 24 Joules.
What are the properties of the dot product?
The dot product satisfies four key properties: (1) Commutative: u dot v = v dot u. (2) Distributive over addition: u dot (v + w) = u dot v + u dot w. (3) Scalar multiplication: (cu) dot v = c(u dot v). (4) Self dot product equals magnitude squared: v dot v = magnitude of v squared. These properties make the dot product a powerful tool for proofs and computations. Note that the dot product is NOT associative in the same way multiplication is, because (u dot v) dot w is undefined - u dot v is a scalar, not a vector.
Practice dot product problems
Work through component calculations, angle problems, projections, and applications with step-by-step solutions. Free to start — no account required.
Start Practicing Free