MAT1052 · Week 6 · Taylor Series, Vectors, Dot Product

Vectors and the dot product

You learn to work with vectors in space, to find length and unit vectors, and to use the dot product for angles, orthogonality, projection and work. All the geometry of the multivariable part is written in this language.

vectorcomponent formmagnitudeunit vectordot productangle between vectorsorthogonalvector projectionscalar componentdirection cosineswork

In the second half of week 6 the subject of the course changes completely: we move from series to the geometry of three-dimensional space. Every topic from here on (lines and planes, surfaces, gradient, directional derivative, tangent plane, Lagrange multipliers) is written in the language of vectors. So being able to do the operations on this page quickly and without mistakes will make the next eight weeks easier. The exam has direct “find the angle / projection / work” questions, but their real importance is that they are used constantly as intermediate steps in later topics.

Golden rules:

  1. Vector = direction + length. Its components are written ⟨v1,v2,v3⟩\langle v_1,v_2,v_3\rangle. PQ→\overrightarrow{PQ} = end minus start.
  2. The result of the dot product is a number, not a vector.
  3. If u⋅v=0\mathbf u\cdot\mathbf v = 0, the vectors are perpendicular. This is the one-line test for all perpendicularity questions.
  4. In the projection formula the denominator has ∣v∣2\lvert\mathbf v\rvert^2 (vector projection), and in the scalar component it has ∣v∣\lvert\mathbf v\rvert. Do not mix them up.

Vectors: definition and basic operations

In space we denote a point by (x,y,z)(x,y,z) and a vector by ⟨v1,v2,v3⟩\langle v_1,v_2,v_3\rangle. The starting point of a vector does not matter; all arrows with the same direction and length are the same vector. The vector from P(x1,y1,z1)P(x_1,y_1,z_1) to Q(x2,y2,z2)Q(x_2,y_2,z_2) is

PQ→=⟨x2−x1,  y2−y1,  z2−z1⟩.\overrightarrow{PQ} = \langle x_2-x_1,\;y_2-y_1,\;z_2-z_1\rangle.

It is also written with the standard unit vectors as v=v1i+v2j+v3k\mathbf v = v_1\mathbf i+v_2\mathbf j+v_3\mathbf k; i=⟨1,0,0⟩\mathbf i = \langle1,0,0\rangle, j=⟨0,1,0⟩\mathbf j = \langle0,1,0\rangle, k=⟨0,0,1⟩\mathbf k = \langle0,0,1\rangle.

OperationFormulaExample (u=⟨2,−1,3⟩\mathbf u = \langle2,-1,3\rangle, v=⟨1,4,−2⟩\mathbf v = \langle1,4,-2\rangle)
Additioncomponent by componentu+v=⟨3,3,1⟩\mathbf u+\mathbf v = \langle3,3,1\rangle
Scalar multiplicationmultiply each component2u=⟨4,−2,6⟩2\mathbf u = \langle4,-2,6\rangle
Length (magnitude)v12+v22+v32\sqrt{v_1^2+v_2^2+v_3^2}∣u∣=14\lvert\mathbf u\rvert = \sqrt{14}
Unit vectorv/∣v∣\mathbf v/\lvert\mathbf v\rvert114⟨2,−1,3⟩\frac{1}{\sqrt{14}}\langle2,-1,3\rangle

The length of a unit vector is 11; it carries only direction. If “a vector of length 55 in the direction of v\mathbf v” is asked, you write 5v∣v∣5\dfrac{\mathbf v}{\lvert\mathbf v\rvert}.

Intuition. Addition is “placing end to end”: first go u\mathbf u, then from there go v\mathbf v; the place you reach is u+v\mathbf u+\mathbf v. The parallelogram rule says the same thing.

The dot product

Definition.

u⋅v=u1v1+u2v2+u3v3.\mathbf u\cdot\mathbf v = u_1v_1+u_2v_2+u_3v_3.

Geometric meaning. If θ\theta is the angle between the two vectors (0≤θ≤π0\le\theta\le\pi), then

u⋅v=∣u∣ ∣v∣cos⁡θ⟹cos⁡θ=u⋅v∣u∣ ∣v∣.\mathbf u\cdot\mathbf v = \lvert\mathbf u\rvert\,\lvert\mathbf v\rvert\cos\theta\qquad\Longrightarrow\qquad\cos\theta = \frac{\mathbf u\cdot\mathbf v}{\lvert\mathbf u\rvert\,\lvert\mathbf v\rvert}.

Properties. u⋅v=v⋅u\mathbf u\cdot\mathbf v = \mathbf v\cdot\mathbf u; u⋅(v+w)=u⋅v+u⋅w\mathbf u\cdot(\mathbf v+\mathbf w) = \mathbf u\cdot\mathbf v+\mathbf u\cdot\mathbf w; v⋅v=∣v∣2\mathbf v\cdot\mathbf v = \lvert\mathbf v\rvert^2; 0⋅v=0\mathbf 0\cdot\mathbf v = 0.

Intuition. The dot product answers the question “how much do two vectors face the same direction”. If they point the same way, cos⁡θ=1\cos\theta = 1 and the product is largest. If they are perpendicular, it is 00. If they point opposite ways, it is negative.

Sign of u⋅v\mathbf u\cdot\mathbf vAngle
>0>0acute angle (θ<90∘\theta<90^\circ)
=0=0perpendicular (θ=90∘\theta = 90^\circ), orthogonal
<0<0obtuse angle (θ>90∘\theta>90^\circ)

Example 1. The angle between u=⟨2,−1,3⟩\mathbf u = \langle2,-1,3\rangle and v=⟨1,4,−2⟩\mathbf v = \langle1,4,-2\rangle.

u·v   = 2·1 + (-1)·4 + 3·(-2) = 2 - 4 - 6 = -8
|u|   = √(4+1+9)  = √14
|v|   = √(1+16+4) = √21
cos θ = -8/√294 ≈ -0.4666
θ     ≈ 117.81°     (negative product → obtuse angle, consistent)

Example 2 (perpendicularity). ⟨1,2,3⟩\langle1,2,3\rangle and ⟨3,0,−1⟩\langle3,0,-1\rangle: 3+0−3=03+0-3 = 0, they are perpendicular.

PITFALL · the range of the angle. arccos⁡\arccos always gives values in [0,π][0,\pi]. The angle between vectors cannot be negative or greater than 180∘180^\circ. Use the calculator in the right mode (degrees/radians) and see which one the question wants.

Projection

The projection of u\mathbf u onto v\mathbf v is the shadow formed when you drop a perpendicular from the tip of u\mathbf u onto the line of v\mathbf v.

projvu=(u⋅v∣v∣2)v(vector)\text{proj}_{\mathbf v}\mathbf u = \left(\frac{\mathbf u\cdot\mathbf v}{\lvert\mathbf v\rvert^2}\right)\mathbf v\qquad\text{(vector)}

compvu=u⋅v∣v∣=∣u∣cos⁡θ(scalar, signed length)\text{comp}_{\mathbf v}\mathbf u = \frac{\mathbf u\cdot\mathbf v}{\lvert\mathbf v\rvert} = \lvert\mathbf u\rvert\cos\theta\qquad\text{(scalar, signed length)}

The projection is parallel to v\mathbf v. And u−projvu\mathbf u-\text{proj}_{\mathbf v}\mathbf u is perpendicular to v\mathbf v. This way you can split any vector into two parts, “parallel + perpendicular”. In physics, splitting a force into its components parallel and perpendicular to an inclined plane is exactly this.

Example 3. With the vectors of Example 1: projvu=−821⟨1,4,−2⟩\text{proj}_{\mathbf v}\mathbf u = \dfrac{-8}{21}\langle1,4,-2\rangle. The coefficient is negative, so the projection points opposite to v\mathbf v. This is consistent with the angle being obtuse.

TIP · onto which one? In projvu\text{proj}_{\mathbf v}\mathbf u the denominator has the length of the vector onto which you project (v\mathbf v) and the result is in its direction. If you swap u\mathbf u and v\mathbf v you get a completely different vector.

Direction angles and direction cosines

The angles α,β,γ\alpha,\beta,\gamma that v\mathbf v makes with the xx, yy, zz axes:

cos⁡α=v1∣v∣,cos⁡β=v2∣v∣,cos⁡γ=v3∣v∣,cos⁡2α+cos⁡2β+cos⁡2γ=1.\cos\alpha = \frac{v_1}{\lvert\mathbf v\rvert},\quad\cos\beta = \frac{v_2}{\lvert\mathbf v\rvert},\quad\cos\gamma = \frac{v_3}{\lvert\mathbf v\rvert},\qquad\cos^2\alpha+\cos^2\beta+\cos^2\gamma = 1.

The direction cosines are really the components of the unit vector. That is why the sum of their squares is 11.

Work

If a constant force F\mathbf F moves an object by D\mathbf D, the work done is

W=F⋅D=∣F∣ ∣D∣cos⁡θ.W = \mathbf F\cdot\mathbf D = \lvert\mathbf F\rvert\,\lvert\mathbf D\rvert\cos\theta.

Only the component of the force in the direction of motion does work. If the force is perpendicular to the direction of motion, the work is zero.

Example 4. ∣F∣=5\lvert\mathbf F\rvert = 5 N, F=⟨3,0,4⟩\mathbf F = \langle3,0,4\rangle and the object is displaced by ⟨6,0,8⟩\langle6,0,8\rangle m: W=18+32=50W = 18+32 = 50 J. The force and the displacement are in the same direction (D=2F\mathbf D = 2\mathbf F), cos⁡θ=1\cos\theta = 1, W=5⋅10=50W = 5\cdot10 = 50. The same result by two routes.

Example 5 (with an angle given). A force of 4040 N pulls a box 1010 m horizontally with a rope that makes a 60∘60^\circ angle with the horizontal: W=40⋅10⋅cos⁡60∘=200W = 40\cdot10\cdot\cos60^\circ = 200 J.

Common mistakes

WrongCorrect
PQ→=P−Q\overrightarrow{PQ} = P-QEnd minus start: Q−PQ-P
Writing the result of the dot product as a vectorThe result is a scalar
∣u+v∣=∣u∣+∣v∣\lvert\mathbf u+\mathbf v\rvert = \lvert\mathbf u\rvert+\lvert\mathbf v\rvert∣u+v∣2=∣u∣2+2u⋅v+∣v∣2\lvert\mathbf u+\mathbf v\rvert^2 = \lvert\mathbf u\rvert^2+2\mathbf u\cdot\mathbf v+\lvert\mathbf v\rvert^2
Writing ∣v∣\lvert\mathbf v\rvert in the denominator of the projectionIn the vector projection it is ∣v∣2\lvert\mathbf v\rvert^2
Mixing up projvu\text{proj}_{\mathbf v}\mathbf u and projuv\text{proj}_{\mathbf u}\mathbf vThe result is in the direction of the vector you project onto
Finding the angle in a triangle with the wrong vectorsBoth vectors must start at that vertex
Writing the unit vector as v/∣v∣2\mathbf v/\lvert\mathbf v\rvert^2v/∣v∣\mathbf v/\lvert\mathbf v\rvert
The angle coming out greater than 180∘180^\circarccos⁡∈[0∘,180∘]\arccos\in[0^\circ,180^\circ]

Test yourself

Exam-style questions. Solve them on paper first, then reveal the answer.

Question 1easy

Find the magnitude of v=⟨3,−4,12⟩\mathbf{v} = \langle 3,-4,12\rangle.

Show answer
1313

∣v∣=32+(−4)2+122=9+16+144=169=13\lvert\mathbf v\rvert = \sqrt{3^2+(-4)^2+12^2} = \sqrt{9+16+144} = \sqrt{169} = 13.

Question 2easy

Find the unit vector in the direction of v=⟨2,−1,2⟩\mathbf{v} = \langle 2,-1,2\rangle.

Show answer
⟨2/3, −1/3, 2/3⟩\langle 2/3,\,-1/3,\,2/3\rangle

∣v∣=4+1+4=3\lvert\mathbf v\rvert = \sqrt{4+1+4} = 3. The unit vector is v∣v∣=⟨23,−13,23⟩\dfrac{\mathbf v}{\lvert\mathbf v\rvert} = \left\langle\dfrac23,-\dfrac13,\dfrac23\right\rangle.

Question 3easy

Compute u⋅v\mathbf u\cdot\mathbf v for u=⟨1,2,−3⟩\mathbf u = \langle1,2,-3\rangle and v=⟨4,0,2⟩\mathbf v = \langle4,0,2\rangle.

Show answer
−2-2

Multiply the corresponding components and add: 1⋅4+2⋅0+(−3)⋅2=4+0−6=−21\cdot4+2\cdot0+(-3)\cdot2 = 4+0-6 = -2.
Since it is negative, the angle between them is greater than 90∘90^\circ.

Question 4easy

Find the angle between u=⟨1,1,0⟩\mathbf u = \langle1,1,0\rangle and v=⟨1,0,1⟩\mathbf v = \langle1,0,1\rangle.

Show answer
60∘60^\circ (π/3\pi/3)

u⋅v=1\mathbf u\cdot\mathbf v = 1, ∣u∣=∣v∣=2\lvert\mathbf u\rvert = \lvert\mathbf v\rvert = \sqrt2.cos⁡θ=122=12\cos\theta = \dfrac{1}{\sqrt2\sqrt2} = \dfrac12, θ=π3=60∘\theta = \dfrac\pi3 = 60^\circ.

Question 5medium

Find cc so that ⟨c,2,−1⟩\langle c, 2, -1\rangle and ⟨3,c,4⟩\langle 3, c, 4\rangle are orthogonal.

Show answer
c=4/5c = 4/5

Orthogonal   ⟺  \iff dot product 00: 3c+2c−4=03c+2c-4 = 0, 5c=45c = 4, c=45c = \dfrac45.

Question 6medium

Find the vector projection of u=⟨3,1,2⟩\mathbf u = \langle3,1,2\rangle onto v=⟨1,1,0⟩\mathbf v = \langle1,1,0\rangle.

Show answer
⟨2,2,0⟩\langle 2,2,0\rangle

projvu=u⋅v∣v∣2v\text{proj}_{\mathbf v}\mathbf u = \dfrac{\mathbf u\cdot\mathbf v}{\lvert\mathbf v\rvert^2}\mathbf v.u⋅v=3+1+0=4\mathbf u\cdot\mathbf v = 3+1+0 = 4, ∣v∣2=2\lvert\mathbf v\rvert^2 = 2. The result is 2⟨1,1,0⟩=⟨2,2,0⟩2\langle1,1,0\rangle = \langle2,2,0\rangle.

Question 7medium

Find the scalar component of u=⟨2,3,6⟩\mathbf u = \langle2,3,6\rangle in the direction of v=⟨1,2,2⟩\mathbf v = \langle1,2,2\rangle.

Show answer
20/320/3

The scalar component is compvu=u⋅v∣v∣\text{comp}_{\mathbf v}\mathbf u = \dfrac{\mathbf u\cdot\mathbf v}{\lvert\mathbf v\rvert}.u⋅v=2+6+12=20\mathbf u\cdot\mathbf v = 2+6+12 = 20, ∣v∣=3\lvert\mathbf v\rvert = 3. The result is 203\dfrac{20}{3}.

Question 8easy

A constant force F=⟨5,2,0⟩\mathbf F = \langle5,2,0\rangle N moves an object from P(1,0,0)P(1,0,0) to Q(4,3,0)Q(4,3,0) (meters). Find the work done.

Show answer
2121 J

The displacement is D=PQ→=⟨3,3,0⟩\mathbf D = \overrightarrow{PQ} = \langle3,3,0\rangle.
The work is W=F⋅D=15+6+0=21W = \mathbf F\cdot\mathbf D = 15+6+0 = 21 J.

Question 9medium

For the triangle with vertices A(0,0,0)A(0,0,0), B(3,0,0)B(3,0,0), C(1,2,2)C(1,2,2), find the angle at AA.

Show answer
arccos⁡(1/3)≈70.53∘\arccos(1/3)\approx 70.53^\circ

The angle is between the two side vectors that start at AA: AB→=⟨3,0,0⟩\overrightarrow{AB} = \langle3,0,0\rangle, AC→=⟨1,2,2⟩\overrightarrow{AC} = \langle1,2,2\rangle.
The dot product is 33, the lengths are 33 and 33. cos⁡θ=39=13\cos\theta = \dfrac{3}{9} = \dfrac13, θ≈70.53∘\theta\approx70.53^\circ.

Question 10medium

If ∣u∣=3\lvert\mathbf u\rvert = 3, ∣v∣=4\lvert\mathbf v\rvert = 4 and u⋅v=2\mathbf u\cdot\mathbf v = 2, find ∣u+v∣\lvert\mathbf u+\mathbf v\rvert.

Show answer
29\sqrt{29}

∣u+v∣2=(u+v)⋅(u+v)=∣u∣2+2 u⋅v+∣v∣2=9+4+16=29\lvert\mathbf u+\mathbf v\rvert^2 = (\mathbf u+\mathbf v)\cdot(\mathbf u+\mathbf v) = \lvert\mathbf u\rvert^2+2\,\mathbf u\cdot\mathbf v+\lvert\mathbf v\rvert^2 = 9+4+16 = 29.
Square root: 29\sqrt{29}. (Writing 3+4=73+4 = 7 is wrong; lengths do not add.)

Question 11medium

Find the direction angles α,β,γ\alpha,\beta,\gamma of v=⟨1,2,2⟩\mathbf v = \langle1,2,2\rangle.

Show answer
α≈70.53∘\alpha\approx70.53^\circ, β=γ≈48.19∘\beta=\gamma\approx48.19^\circ

∣v∣=3\lvert\mathbf v\rvert = 3. Direction cosines: cos⁡α=13\cos\alpha = \frac13, cos⁡β=23\cos\beta = \frac23, cos⁡γ=23\cos\gamma = \frac23.α=arccos⁡13≈70.53∘\alpha = \arccos\frac13\approx70.53^\circ, β=γ=arccos⁡23≈48.19∘\beta = \gamma = \arccos\frac23\approx48.19^\circ.
Check: cos⁡2α+cos⁡2β+cos⁡2γ=19+49+49=1\cos^2\alpha+\cos^2\beta+\cos^2\gamma = \frac19+\frac49+\frac49 = 1.

Question 12hard

Write u=⟨4,1,−2⟩\mathbf u = \langle4,1,-2\rangle as the sum of a vector parallel to v=⟨2,0,1⟩\mathbf v = \langle2,0,1\rangle and a vector orthogonal to v\mathbf v.

Show answer
⟨125,0,65⟩+⟨85,1,−165⟩\langle\frac{12}{5},0,\frac65\rangle + \langle\frac85,1,-\frac{16}{5}\rangle

The parallel part is the projection: u⋅v=8+0−2=6\mathbf u\cdot\mathbf v = 8+0-2 = 6, ∣v∣2=5\lvert\mathbf v\rvert^2 = 5, projvu=65⟨2,0,1⟩=⟨125,0,65⟩\text{proj}_{\mathbf v}\mathbf u = \frac65\langle2,0,1\rangle = \langle\frac{12}{5},0,\frac65\rangle.
The orthogonal part: u−proj=⟨4−125,1,−2−65⟩=⟨85,1,−165⟩\mathbf u-\text{proj} = \langle4-\frac{12}5,1,-2-\frac65\rangle = \langle\frac85,1,-\frac{16}5\rangle.
Check: ⟨85,1,−165⟩⋅⟨2,0,1⟩=165−165=0\langle\frac85,1,-\frac{16}5\rangle\cdot\langle2,0,1\rangle = \frac{16}5-\frac{16}5 = 0.

Verification: All vector operations (dot product, length, angle, projection, orthogonal component) were computed numerically in node; the dot product of the orthogonal component came out as 0 (verify/MAT1052/06.mjs, section 06b).

Review card

v = <v1,v2,v3>, PQ = Q - P (end - start) |v| = √(v1²+v2²+v3²) unit: v/|v| |cv| = |c||v| u·v = u1v1+u2v2+u3v3 = |u||v|cos θ (the result is a NUMBER) cos θ = u·v / (|u||v|) θ ∈ [0, π] u·v = 0 ⇔ perpendicular. u·v > 0 acute angle, u·v < 0 obtuse angle v·v = |v|² |u+v|² = |u|² + 2u·v + |v|² proj_v u = (u·v / |v|²) v (vector, in the direction of v) comp_v u = u·v / |v| (scalar, signed) perpendicular part = u - proj_v u (check: its dot product with v is 0) Direction cosines: cos α = v1/|v| ... the sum of squares is 1 Work: W = F·D = |F||D|cos θ (N·m = J)