C1 Vectors
C1 Vectors
Chapter 1: Vectors
Vectors were first introduced in geometry and physics. They are used to represent quantities
with both magnitude and direction, for example, displacement and force. The concept of
vector has been generalized and widely used in mathematics, computer science and other
areas of engineering.
The length of the arrow represents the magnitude of the quantity, and the arrowhead shows
its direction. We can also use arrow or bold letter to denote a vector, for example, ~a, or a.
−−→
The magnitude or length of these vectors could be represented by |AB|, |~a|, or |a|.
Algebraically, a vector ~v = (2, −1) in R2 = R × R (2D) means a vector that goes to the right
by 2 units and goes up by -1 unit, i.e., down by 1 unit.
The following operations can be defined for a scalar k and 2D vectors ~a = (a1 , a2 ) and
~b = (b1 , b2 ). These operations can be similarly defined for vectors of other dimensions.
1. Addition
~v + w
~ = (1, 1) + (−1, 2)
= (1 + (−1), 1 + 2)
= (0, 3)
2. Subtraction
~v − w
~ = (1, 1) − (−1, 2)
= (1 − (−1), 1 − 2)
= (2, −1)
3. Scalar multiplication
1. 0~v = ~0
2. 1~v = ~v
3. (~u + ~v ) + w
~ = ~u + (~v + w)
~ (Associative rule)
4. ~v + w
~ =w
~ + ~v (Commutative rule)
5. ~v + ~0 = ~v
7. α(~v + w)
~ = α~v + αw
~ (Distributive rule)
8. (αβ)~v = α(β~v )
A position vector is a vector with initial point at the origin. Such a vector is uniquely
Chapter 1: Vectors 1-4
described by the coordinates of its terminal point. If P (x, y) is the terminal point, then the
−−→
position vector OP = (x, y).
More generally, consider the vector with initial point A(x1 , y1 ) and terminal point B(x2 , y2 ).
To move from the initial point to the terminal point, the vector goes to the right by x2 − x1
and up by y2 − y1 . Hence,
−−→
AB = (x2 − x1 , y2 − y1 ).
Remark. It is not uncommon for people to use the notations hx, y, zi for vectors and (x, y, z)
for points. We will not follow this and write (x, y, z) for both vectors and points.
Example 2. A = (1, 0), B = (3, 3), C = (2, 4), D = (0, 1). Show that ABCD is a parallelo-
gram.
Solution.
−−→
AB = (3, 3) − (1, 0) = (2, 3)
−−→ −−→
DC = (2, 4) − (0, 1) = (2, 3) = AB
We will show that dot product can be used to compute angles and projection. These con-
cepts can be generalized to other dimensions. For example, in R3 , we have
√
In R, ||~a|| = a2 = |a| is the absolute value!
1. ||~v || ≥ 0
2. ||~v || = 0 ⇔ ~v = ~0
√
3. ||~v || = ~v · ~v
5. ||~v + w||
~ ≤ ||~v || + ||w||
~ (Triangle Inequality!)
Chapter 1: Vectors 1-6
A unit vector is a vector with length 1. It is common to denote a unit vector by the hat
notation v̂, instead of an arrow, to emphasize its unit length.
Solution.
1. p
||~v || = 12 + 22 + (−2)2 = 3
In R2 , the unit vector in the direction of the positive x-axis and positive y-axis is denoted
by î = (1, 0) and ĵ = (0, 1), respectively. They are called standard unit vectors.
Chapter 1: Vectors 1-7
Similarly, in R3 , the standard unit vectors are î = (1, 0, 0), ĵ = (0, 1, 0) and k̂ = (0, 0, 1).
Remark. Standard unit vectors form a “building unit” of other vectors. For example:
2. (α~u + β~v ) · w
~ = α~u · w
~ + β~v · w
~
3. ~0 · ~v = 0
4. ~v · ~v = ||~v ||2
5. ~v · w
~ = ||~v ||||w||
~ cos θ. where θ is the angle between ~v and w.
~
Chapter 1: Vectors 1-8
Proof. We will prove property 5. The proof is essentially the proof of cosine law.
Note
~ 2 = (||~v || sin θ)2 + (||w||
||~v − w|| ~ − ||~v || cos θ)2
= ||~v ||2 sin2 θ + ||w||
~ 2 − 2||w||
~ ||~v || cos θ + ||~v ||2 cos2 θ
2
= ||~v || + ||w|| 2
~ − 2||w||~ ||~v || cos θ (1)
Also,
~ 2 = (~v − w)
||~v − w|| ~ · (~v − w)
~
= ~v · ~v − w
~ · ~v − ~v · w
~ +w~ ·w
~
= ||~v ||2 + ||w||
~ 2 − 2~v · w~ (2)
Compare (1) and (2), we have
~v · w
~ = ||~v || ||w||
~ cos θ.
~v · w
~ >0 ⇔ 0◦ ≤ θ < 90◦ acute angle
~v · w~
cos θ = ⇒ ~v · w
~ =0 ⇔ θ = 90◦ right angle
||~v || ||w||
~
~v · w ⇔ 90◦ <θ≤ 180◦ obtuse angle
~ <0
~v ⊥ w
~ ⇔ ~v · w
~ =0
Chapter 1: Vectors 1-9
î · î = 1
î · ĵ = 0 ĵ · ĵ = 1
î · k̂ = 0 ĵ · k̂ = 0 k̂ · k̂ = 1
The results agree with the fact that î, ĵ and k̂ are pairwisely perpendicular unit vectors.
Example 5. Find the angle θ between ~v = î + ĵ + 3k̂ and w
~ = 2î − ĵ − 2k̂.
Solution.
~v · w
~ = (î + ĵ + 3k̂) · (2î − ĵ − 2k̂)
= (1)(2) + (1)(−1) + (3)(−2)
= −5
√ √ √
||~v || = ~v · ~v = 12 + 12 + 32 = 11
√ p
||w||
~ = w ~ = 22 + (−1)2 + (−2)2 = 3
~ ·w
~v · w~ −5
∴ cos θ = =√
||~v || ||w||
~ 11 · 3
−5
⇒ θ = arccos 3√ 11
≈ 120.17◦
Solution.
~ · (~v − w)
(~v + w) ~ = ~v · ~v − ~v · w ~ · ~v − w
~ +w ~ ·w
~
= kvk2 − ~v · w ~ − kwk2
~ + ~v · w
= kvk2 − kvk2
=0
Solution.
−→ −→ −−→
AC = AO + OC
−−→ −−→ −−→ −→ −−→
BC = BO + OC = −AO + OC
−→ −−→ −→ −−→ −→ −−→
AC · BC = (AO + OC) · (−AO + OC)
−→ −→ −→ −−→ −−→ −→ −−→ −−→
= −AO · AO + AO · OC − OC · AO + OC · OC
−→ −−→ −→ −−→
= −||AO||2 + ||OC||2 (||AO|| = ||OC|| are radius)
=0
−→ −−→
∴ AC ⊥ BC ⇒ ∠ACB = 90◦
• v~1 //w
~
• v~2 ⊥ w
~
Chapter 1: Vectors 1-11
1.
v~1 //w
~ ⇒ v~1 = k w
~ for some k ∈ R
2.
v~2 ⊥ w
~ ⇒ v~2 · w
~ =0
⇒ (~v − v~1 ) · w
~ =0
⇒ ~v · w~ = v~1 · w ~ ·w
~ = (k w) ~ · w)
~ = k(w ~
~v · w
~
⇒ k=
w ~ ·w~
Therefore,
2. Find v~2 .
v~2 = ~v − v~1
= ~v − projw~ ~v
1 1
= (3, 2) − ,−
2 2
5 5
= ,
2 2
Example 9. Find the point B on the line L : y = x which is closest to A = (3, 7).
Solution. Let w
~ = (1, 1), w//L.
~
−−→ −→
OB = projw~ OA
− →
OA · w ~
= w
~
w~ ·w ~
(3, 7) · (1, 1)
= (1, 1)
(1, 1) · (1, 1)
= (5, 5)
∴ B = (5, 5)
Besides dot product, there is another type of product, called cross product, for 3D vectors.
It can be defined using determinant, which is a useful tool for matrices.
Chapter 1: Vectors 1-13
a b
= ad − bc
c d
a1 a2 a3
b2 b3 b b b b
b1 b2 b3 = a1 − a2 1 3 + a3 1 2
c2 c3 c1 c3 c1 c2
c1 c2 c3
Example 10.
1 2
= (1)(4) − (2)(3) = −2
3 4
1 2 3
5 6 4 6 4 5
4 5 6 = (1) − (2) + (3)
8 9 7 9 7 8
7 8 9
= (1)[(5)(9) − (6)(8)] − (2)[(4)(9) − (6)(7)] + (3)[(4)(8) − (5)(7)]
= −3 + 12 − 9
=0
Definition 2 (Cross product, defined only in 3D). Let ~a = (a1 , a2 , a3 ) and ~b = (b1 , b2 , b3 ).
Define their cross product by
î ĵ k̂
~
~a × b = a1 a2 a3
b1 b2 b3
a2 a3 a a a a
= î − 1 3 ĵ + 1 2 k̂
b2 b3 b1 b3 b1 b2
= (a2 b3 − a3 b2 , a3 b1 − a1 b3 , a1 b2 − a2 b1 )
Example 11.
î ĵ k̂
î × ĵ = 1 0 0
0 1 0
0 0 1 0 1 0
= î − ĵ + k̂
1 0 0 0 0 1
= 0î − 0ĵ + 1k̂ = k̂
Similarly, we can compute the cross products of other standard unit vectors:
Chapter 1: Vectors 1-14
î × î = ~0 î × ĵ = k̂ î × k̂ = −ĵ
ĵ × î = −k̂ ĵ × ĵ = ~0 ĵ × k̂ = î
k̂ × î = ĵ k̂ × ĵ = −î k̂ × k̂ = ~0
The diagram below helps you to remember the cross products of standard unit vectors.
Solution.
î ĵ k̂
~a × ~b = 2 3 5
1 2 3
3 5 2 5 2 3
= î − ̂ + k̂
2 3 1 3 1 2
= −î − ĵ + k̂
1. ~a × ~a = ~0
2. ~a × ~b = −~b × ~a
||~a × ~b|| = ||~a|| ||~b|| sin θ = Area of the parallelogram spanned by ~a and ~b.
~a × ~b = ~0 ⇔ ||~a × ~b|| = 0
⇔ ||~a|| or ||~b|| or sin θ = 0
⇔ ~a = ~0 or ~b = ~0 or θ = 0 or θ = π.
Hence,
On the other hand, suppose ~a × ~b is non-zero. Then ~a and ~b are both non-zero. From
property 5 above,
Also, it can be showed that ~a, ~b, ~a × ~b satisfy the right hand rule.
Chapter 1: Vectors 1-16
Example 13. Let A = (1, 2, 1), B = (1, −1, 0), C = (2, 3, 2) be points on a plane P . Find a
vector which is perpendicular to P .
−−→ −→
Solution. The line segments AB and AC both lie on P . Hence, the cross product AB × AC
is perpendicular to P .
−−→
AB = (1, −1, 0) − (1, 2, 1) = (0, −3, −1)
−→
AC = (2, 3, 2) − (1, 2, 1) = (1, 1, 1)
î ĵ k̂
−−→ −→
AB × AC = 0 −3 −1
1 1 1
−3 −1 0 −1 0 −3
= î − ĵ + k̂
1 1 1 1 1 1
= [(−3)(1) − (−1)(1)] î − [(0)(1) − (−1)(1)] ĵ + [(0)(1) − (−3)(1)] k̂
= −2î − ĵ + 3k̂
Another product closely related to cross product is also defined for vectors in 3D.
a1 a2 a3
~
~a · (b × ~c) = b1 b2 b3
c1 c2 c3
~a · (~b × ~c) = ~b · (~c × ~a) = ~c · (~a × ~b) = −~a · (~c × ~b) = −~b · (~a × ~c) = −~c · (~b × ~a)
Chapter 1: Vectors 1-17
1. the coordinates of D;
2. the area of the parallelogram ABCD;
3. a unit vector which is perpendicular to ABCD;
4. the equation of the plane containing A, B, C;
−−→ −−→ −−→
5. the volume of the parallelepiped with adjacent sides BA, BC and BE.
Solution.
2.
−−→
BC = (1, 2, 0) − (1, 1, 1) = (0, 1, −1)
î ĵ k̂
−−→ −−→
⇒ BA × BC = 1 1 0 = −î + ĵ + k̂
0 1 −1
−−→ −−→ p √
⇒ Area of ABCD = ||BA × BC|| = (−1)2 + 12 + 12 = 3
Chapter 1: Vectors 1-18
−−→ −−→
3. Since BA × BC is perpendicular to the parallelogram ABCD, the required vector can
be taken to be −−→ −−→
BA × BC 1
−−→ −−→ = √ (−i + j + k)
||BA × BC|| 3
5.
−−→
BE = (2, 4, −5) − (1, 1, 1) = (1, 3, −6)
−−→ −−→ −−→
Triple Product = BE · (BA × BC)
= (1, 3, −6) · (−1, 1, 1)
= −4
Chapter 1: Vectors 1-19
For example,
f (x) = x2 + 2
is a real-valued function. When x = 0, f (0) = 2. The output 2 is a real number.
One can also consider functions which are vector-valued. For example,
is a vector-valued function with outputs in R2 . When t = 2, ~r(2) = (4, 3) = 4î + 3ĵ. The
output is a vector.
Remark.
where x(t) = t2 and y(t) = 2t − 1 are called the component functions of ~r(t). Here t
is called the parameter.
Example 15.
p
~r(t) = (et , t, 1 + t2 )
p
= et î + tĵ + 1 + t2 k̂
on the xy-plane, one approach is to plug in different values of t to find a few points on ~r(t).
Chapter 1: Vectors 1-20
t -2 -1 0 1 2
x(t) 4 1 0 1 4
y(t) -5 -3 -1 1 3
However, it does not give an accurate plot unless many points are used.
Another approach to plot the graph is to find a relation between x and y by eliminating t:
x = x(t) = t2
y+1
y = y(t) = 2t − 1 ⇒ t =
2
y + 1 2 1
2
⇒ x= = (y + 1) (Parabola!)
2 4
Example 17. Graph ~r(t) = (2 cos t◦ )î + (2 sin t◦ )ĵ for 0 ≤ t ≤ 180.
Solution.
x = 2 cos t◦ y = 2 sin t◦
∴ x2 + y 2 = (2 cos t◦ )2 + (2 sin t◦ )2
= 4(cos2 t◦ + sin2 t◦ )
=4
Chapter 1: Vectors 1-21
Example 18. Let ~r(t) = (cos 360t◦ )î + (sin 360t◦ )ĵ + tk̂. Plot the 3D graph of ~r(t) for
0 ≤ t ≤ 1.
• (cos 360t◦ )î+(sin 360t◦ )ĵ rotates around the origin along the unit circle on the xy−plane.
Hence ~r(t) rotates around the z-axis while going up from z = 0 to z = 1. Its graph is a
“helix”.
Chapter 1: Vectors 1-22
Solution.
~r(t) = (2î + 4ĵ − k̂) + t(î − 2ĵ)
⇒ ~r(t) is the straight line parallel to î − 2ĵ and passes through (2, 4, −1).