BetaFree coursewareRewritten from MIT OpenCourseWareCC BY-NC-SA 4.0
Open CosmologyPhysics & cosmology, from high school to a graduate year

Vectors and the dot product

A vector has a length and a direction; in coordinates, A = ⟨a₁, a₂, a₃⟩ = a₁î + a₂ĵ + a₃k̂, with length √(a₁² + a₂² + a₃²) by Pythagoras twice. Vectors add head to tail and scale. The dot product A · B = a₁b₁ + a₂b₂ + a₃b₃ is a number, and it equals |A||B| cos θ: the law of cosines in vector form. It finds angles, and A · B = 0 exactly when A and B are perpendicular, which shows that x + 2y + 3z = 0 is a plane.

You need this first

On this page · 5 sections
  1. Vectors
  2. The dot product
  3. Lengths and angles
  4. Perpendicular vectors and planes
  5. Summary

Multivariable calculus provides tools for problems with several parameters: functions of several variables (notes, p. 1). The first tool is the vector. (This page reviews vectors from 8.01 and the scalar product from 8.01's work in two and three dimensions, and takes the dot product further.)

Vectors#

A vector has a direction and a length, and is drawn as an arrow (transcript, p. 1). In a coordinate system it is written by its components along the axes, using the unit vectors i^\hat i, j^\hat j, k^\hat k of length one along the xx, yy and zz axes (pp. 1–2):

Components of a vector
A⃗=⟨a1,a2,a3⟩=a1 i^+a2 j^+a3 k^\vec A = \langle a_1, a_2, a_3\rangle = a_1\,\hat i + a_2\,\hat j + a_3\,\hat k
In words

vector capital A equals the average of a one, a two, a three equals a one i hat plus a two j hat plus a three k hat

Source: 18.02 Lecture 1 transcript, pp. 1–2

Its length ∣A⃗∣|\vec A| is a scalar, an ordinary number; its direction can be obtained by scaling it down to unit length, A⃗/∣A⃗∣\vec A/|\vec A| (p. 2). A vector has no fixed starting point: the vector PQ⃗\vec{PQ} from PP to QQ is the same vector wherever it is drawn (p. 2).

For the length of ⟨3,2,1⟩\langle 3, 2, 1\rangle, first find the length of B⃗=3i^+2j^\vec B = 3\hat i + 2\hat j in the xyxy-plane, 9+4=13\sqrt{9 + 4} = \sqrt{13}, then go up one unit at a right angle: ∣A⃗∣2=∣B⃗∣2+1=14|\vec A|^2 = |\vec B|^2 + 1 = 14 (p. 3). In general (p. 3; notes, p. 1):

Length of a vector
∣A⃗∣=a12+a22+a32|\vec A| = \sqrt{a_1^2 + a_2^2 + a_3^2}
In words

the absolute value of vector capital A equals the square root of a one squared plus a two squared plus a three squared, end of root

The same formula works with any number of components; in this course "multi" mostly means two or three, but the mathematics is the same for 10,000 variables (p. 3).

Every question about vectors has a geometric answer and a numerical one (p. 4). Addition: place B⃗\vec B with its tail at the head of A⃗\vec A; the sum is the diagonal of the parallelogram, and A⃗+B⃗=B⃗+A⃗\vec A + \vec B = \vec B + \vec A. Numerically, add the components (p. 4). Scalar multiplication: 2A⃗2\vec A goes twice as far in the same direction, −A⃗-\vec A the opposite way; so 3i^+2j^+k^3\hat i + 2\hat j + \hat k means three steps along xx, two along yy, one up (pp. 4–5). A⃗−B⃗\vec A - \vec B is A⃗\vec A plus −B⃗-\vec B (p. 5).

The dot product#

The dot product multiplies two vectors to give a number (transcript, p. 5; notes, p. 1):

Dot product
A⃗⋅B⃗=a1b1+a2b2+a3b3\vec A \cdot \vec B = a_1b_1 + a_2b_2 + a_3b_3
In words

vector capital A dot vector capital B equals a one b one plus a two b two plus a three b three

Source: 18.02 Lecture 1 transcript, pp. 5–6

It is a scalar, not a vector, which is easy to forget in the middle of a calculation (p. 6). What makes it useful is its geometric meaning, the first theorem of the course (p. 6):

Geometric meaning
A⃗⋅B⃗=∣A⃗∣ ∣B⃗∣cos⁡θ\vec A \cdot \vec B = |\vec A|\,|\vec B|\cos\theta
In words

vector capital A dot vector capital B equals the absolute value of vector capital A the absolute value of vector capital B cos theta

where θ\theta is the angle between A⃗\vec A and B⃗\vec B: it tells us about lengths and angles at once, and it is easy to compute from components (p. 6).

Why it is true (pp. 7–8; notes, p. 1). First, A⃗⋅A⃗=a12+a22+a32=∣A⃗∣2=∣A⃗∣2cos⁡0\vec A \cdot \vec A = a_1^2 + a_2^2 + a_3^2 = |\vec A|^2 = |\vec A|^2\cos 0, so the two agree for a vector with itself. Next, take a triangle with sides A⃗\vec A, B⃗\vec B and C⃗=A⃗−B⃗\vec C = \vec A - \vec B. The dot product expands like ordinary multiplication, and A⃗⋅B⃗=B⃗⋅A⃗\vec A \cdot \vec B = \vec B \cdot \vec A, so

The law of cosines in vector form
∣C⃗∣2=(A⃗−B⃗)⋅(A⃗−B⃗)=∣A⃗∣2+∣B⃗∣2−2 A⃗⋅B⃗|\vec C|^2 = (\vec A - \vec B) \cdot (\vec A - \vec B) = |\vec A|^2 + |\vec B|^2 - 2\,\vec A \cdot \vec B
In words

the absolute value of vector C squared equals the quantity vector capital A minus vector capital B, all times the quantity vector capital A minus vector capital B, equals the absolute value of vector capital A squared plus the absolute value of vector capital B squared minus 2 vector capital A dot vector capital B

Source: 18.02 Lecture 1 transcript, pp. 7–8

The law of cosines says ∣C⃗∣2=∣A⃗∣2+∣B⃗∣2−2∣A⃗∣∣B⃗∣cos⁡θ|\vec C|^2 = |\vec A|^2 + |\vec B|^2 - 2|\vec A||\vec B|\cos\theta. Comparing, A⃗⋅B⃗=∣A⃗∣∣B⃗∣cos⁡θ\vec A \cdot \vec B = |\vec A||\vec B|\cos\theta: the theorem is the law of cosines in vector form, and either proves the other (p. 8).

Lengths and angles#

So cos⁡θ=A⃗⋅B⃗∣A⃗∣∣B⃗∣\cos\theta = \frac{\vec A \cdot \vec B}{|\vec A||\vec B|} (transcript, p. 9). Take the triangle with corners P=(1,0,0)P = (1, 0, 0), Q=(0,1,0)Q = (0, 1, 0), R=(0,0,2)R = (0, 0, 2) and find the angle at PP (pp. 8–9). Then PQ⃗=⟨−1,1,0⟩\vec{PQ} = \langle -1, 1, 0\rangle and PR⃗=⟨−1,0,2⟩\vec{PR} = \langle -1, 0, 2\rangle (pp. 9–10; notes, p. 1):

An angle in space
cos⁡θ=PQ⃗⋅PR⃗∣PQ⃗∣ ∣PR⃗∣=1+0+02 5=110,θ≈71.6°\cos\theta = \frac{\vec{PQ} \cdot \vec{PR}}{|\vec{PQ}|\,|\vec{PR}|} = \frac{1 + 0 + 0}{\sqrt 2\,\sqrt 5} = \frac{1}{\sqrt{10}}, \qquad \theta \approx 71.6°
In words

cos theta equals vector P Q dot vector P capital R over the quantity the absolute value of vector P Q the absolute value of vector P capital R, equals the quantity 1 plus 0 plus 0, all over the quantity the square root of 2 the square root of 5, equals 1 over the square root of 10, theta is approximately 71.6°

Source: 18.02 Lecture 1 transcript, pp. 9–10

(The lecture and notes give about 71.5°; the angle is 71.57°.) The sign of a dot product is the sign of cos⁡θ\cos\theta, since lengths are positive: positive when the angle is less than 90° (the vectors point roughly the same way), zero at exactly 90°, negative when it is more (p. 10). The dot product measures how much two vectors go along each other (p. 10).

Perpendicular vectors and planes#

Orthogonality, a word from Greek for perpendicularity: A⃗⋅B⃗=0\vec A \cdot \vec B = 0 exactly when cos⁡θ=0\cos\theta = 0, that is, when A⃗\vec A and B⃗\vec B are perpendicular (transcript, pp. 10–12). What are the points with x+2y+3z=0x + 2y + 3z = 0 (p. 11)? With P=(x,y,z)P = (x, y, z) and A⃗=⟨1,2,3⟩\vec A = \langle 1, 2, 3\rangle, the equation says (p. 11; notes, p. 1)

A plane through the origin
x+2y+3z=0⟺OP⃗⋅A⃗=0⟺OP⃗⊥A⃗x + 2y + 3z = 0 \Longleftrightarrow \vec{OP} \cdot \vec A = 0 \Longleftrightarrow \vec{OP} \perp \vec A
In words

x plus 2 y plus 3 z equals 0 is equivalent to vector O P dot vector capital A equals 0 is equivalent to vector O P perpendicular vector capital A

so the solutions form the plane through the origin perpendicular to A⃗\vec A; for a vertical A⃗\vec A, it would be the horizontal plane (p. 11). The next lecture uses the dot product to find components of a vector along any direction (p. 12).

Worked example

A length, an angle and a plane

Let A⃗=⟨2,−1,2⟩\vec A = \langle 2, -1, 2\rangle and B⃗=⟨1,1,0⟩\vec B = \langle 1, 1, 0\rangle. (a) Find ∣A⃗∣|\vec A| and ∣B⃗∣|\vec B|. (b) Find the angle between them. (c) Describe the points with 2x−y+2z=02x - y + 2z = 0, and check that (1,2,0)(1, 2, 0) is one of them.

(a) Lengths

∣A⃗∣=4+1+4=3|\vec A| = \sqrt{4 + 1 + 4} = 3 and ∣B⃗∣=2≈1.414|\vec B| = \sqrt 2 \approx 1.414.

(b) The angle

A⃗⋅B⃗=2−1+0=1\vec A \cdot \vec B = 2 - 1 + 0 = 1, so cos⁡θ=132≈0.236\cos\theta = \frac{1}{3\sqrt 2} \approx 0.236 and θ≈76.4°\theta \approx 76.4°: a little less than a right angle, as the small positive dot product suggests.

(c) A plane

The equation says OP⃗⋅A⃗=0\vec{OP} \cdot \vec A = 0: it is the plane through the origin perpendicular to A⃗\vec A. For (1,2,0)(1, 2, 0): 2−2+0=02 - 2 + 0 = 0, so it lies in the plane, and indeed ⟨1,2,0⟩⋅⟨2,−1,2⟩=0\langle 1, 2, 0\rangle \cdot \langle 2, -1, 2\rangle = 0.

Summary#

  • A vector: A⃗=⟨a1,a2,a3⟩=a1i^+a2j^+a3k^\vec A = \langle a_1, a_2, a_3\rangle = a_1\hat i + a_2\hat j + a_3\hat k, length a12+a22+a32\sqrt{a_1^2 + a_2^2 + a_3^2}; add head to tail or componentwise.
  • Dot product: A⃗⋅B⃗=a1b1+a2b2+a3b3=∣A⃗∣∣B⃗∣cos⁡θ\vec A \cdot \vec B = a_1b_1 + a_2b_2 + a_3b_3 = |\vec A||\vec B|\cos\theta, a scalar; it is the law of cosines.
  • cos⁡θ=A⃗⋅B⃗∣A⃗∣∣B⃗∣\cos\theta = \frac{\vec A \cdot \vec B}{|\vec A||\vec B|}; its sign tells whether the angle is acute, right or obtuse.
  • A⃗⋅B⃗=0\vec A \cdot \vec B = 0 exactly when A⃗⊥B⃗\vec A \perp \vec B; x+2y+3z=0x + 2y + 3z = 0 is the plane through the origin perpendicular to ⟨1,2,3⟩\langle 1, 2, 3\rangle.

Symbols on this page

Show the 34 symbols used here
θ\theta theta.
An angle. Say it: “theta” (sounds like “thay-ta or thee-ta”).
≈\approx approximately equal.
Is approximately equal to. Say it: “is approximately”.
⟺\Longleftrightarrow if and only if.
If and only if: each statement implies the other. Say it: “is equivalent to”.
⋅\cdot dot.
Times (multiplication). Between two vectors: the dot product. Say it: “times”.
⟨\langle angle brackets.
The average (mean value) of what is inside, ⟨…⟩. Say it: “the average of”.
cos⁡\cos cosine.
Cosine of an angle. Say it: “cos”.
v⃗\vec v vector arrow.
A vector: a quantity with a size and a direction. Say it: “vector”.
HH H.
The Hubble expansion rate. Unit: km/s/Mpc. Say it: “H”.
zz z.
The z coordinate. Say it: “z”.
⊥\perp perpendicular.
Is perpendicular to. Say it: “perpendicular”.
xx x.
The x coordinate. Say it: “x”.
yy y.
The y coordinate. Say it: “y”.
vv v.
In the cosmology note, the velocity of a galaxy relative to us. Unit: km/s. Say it: “v”.
rr r.
In the cosmology note, the position vector of a galaxy. Unit: Mpc. Say it: “r”.
PP P.
A point (in the plane example, a point (x, y, z) in space). Say it: “P”.
QQ Q.
A second point; PQ with an arrow is the vector from P to Q. Say it: “Q”.
OO big O.
The origin, (0, 0, 0). Say it: “big O”.
AA A.
A vector (its length without the arrow, |A|). Say it: “capital A”.
BB B.
A second vector. Say it: “capital B”.
CC C.
The third side of the triangle, C = A − B. Say it: “C”.
RR R.
A third point of the triangle. Say it: “capital R”.
a1a_{1} a one.
The x component of the vector A. Say it: “a one”.
a2a_{2} a two.
The y component of the vector A. Say it: “a two”.
a3a_{3} a 3.
The z component of the vector A. Say it: “a three”.
i^\hat{i} i hat.
Unit vector in the x direction: length 1, pointing towards increasing x. Say it: “i hat”.
j^\hat{j} j hat.
Unit vector in the y direction: length 1, pointing towards increasing y. Say it: “j hat”.
k^\hat{k} k hat.
Unit vector in the z direction: length 1, pointing towards increasing z. Say it: “k hat”.
rAr_{A} r A.
In the cosmology note, the position vector of galaxy A. Unit: Mpc. Say it: “r sub A”.
rBr_{B} r B.
In the cosmology note, the position vector of galaxy B. Unit: Mpc. Say it: “r sub B”.
vAv_{A} v A.
In the cosmology note, the velocity of galaxy A. Unit: km/s. Say it: “v sub A”.
vBv_{B} v B.
In the cosmology note, the velocity of galaxy B. Unit: km/s. Say it: “v sub B”.
b1b_{1} b 1.
The x component of the vector B. Say it: “b one”.
b2b_{2} b 2.
The y component of the vector B. Say it: “b two”.
b3b_{3} b 3.
The z component of the vector B. Say it: “b three”.

Tap or click a symbol in a formula to see the same explanation. All symbols: symbols and notation.

Words on this page

Show the 17 words used here

New here

dot product.
A way of multiplying two vectors that gives a number: multiply matching components and add, or lengths times the cosine of the angle between them.

Also used

p..
Page, in a reference to a source; pp. means pages, as in pp. 3–5.
vector.
A quantity with both a size and a direction, such as a velocity or a force, drawn as an arrow. Explained in Vectors.
scalar product.
A way of multiplying two vectors that gives a number: their lengths multiplied together times the cosine of the angle between them. Explained in Work and kinetic energy in two and three dimensions.
dimension.
The number of independent directions in a space: one for a line, two for a plane, three for ordinary space. Explained in Position and velocity in one dimension.
coordinate system.
A rule that gives every point a set of numbers, its coordinates, fixed by a starting point, directions and units. Explained in Vectors.
unit vector.
A vector of length one, used only to point in a direction. Explained in Newton's law of gravitation.
scalar.
A quantity that has a size but no direction, such as mass, temperature or energy. Explained in Vectors.
theorem.
A statement that has been proved true, step by step, from definitions and earlier results. Explained in Limits and continuity.
perpendicular.
At right angles to a line, a surface or another direction. Explained in Inclined planes.
velocity.
How fast and in which direction something moves: a vector whose length is the speed and whose direction is the direction of motion. Explained in Velocity, acceleration and Kepler's second law.
galaxy.
A huge system of stars, gas and dust, from thousands to over a trillion stars, held together by gravity inside a dark matter halo. Explained in Towards the universe: weighing the Sun and the Galaxy with orbits.
position vector.
The arrow from the origin of a coordinate system to a point, which says where the point is. Explained in Position and velocity in one dimension.
linear.
Of a relation or equation: using only first powers of the unknowns, so doubling the cause doubles the effect and effects simply add. Explained in Solving and rearranging formulas.

Academic

transcript.
A written record of exactly what was said in a recorded lecture, word for word.
numerically.
In terms of actual numbers rather than symbols; often worked out step by step, by computer, instead of from an exact formula.
homogeneous.
The same at every place.

Tap or click a word, here or in the text, for its meaning in this lesson. All words: the glossary. How many words are marked in the text: Reading options (the “Aa” button).

Where this leads

In cosmology

32 more cosmology pages that build on this

Pages that build on this

Practise

Check your understanding

  1. The length of ⟨3,2,1⟩\langle 3, 2, 1\rangle is…
  2. ⟨1,−2,3⟩⋅⟨4,1,−1⟩=\langle 1, -2, 3\rangle \cdot \langle 4, 1, -1\rangle =
  3. If A⃗⋅B⃗<0\vec A \cdot \vec B < 0, the angle between A⃗\vec A and B⃗\vec B is…
  4. The set of points with 2x−y+2z=02x - y + 2z = 0 is…
0 of 4 answered

Flashcards

1 / 3