Lecture 1 Full
Lecture 1 Full
⃗ = x1 x2 ⋯ xn .
x (1.1)
⎛ x1 ⎞
⎜ ⎟
⃗=⎜ ⎟
x2
⎜ ⋮ ⎟
x (1.2)
⎝ xn ⎠
is called an n-dimensional column vector. For abbreviation, we often denote the column
vector (1.2) by (x1 , x2 , . . . , xn )T , where the superscript T indicates that it is transposed to a
column vector. A “column vector” is often abbreviated as “vector”.
Equality of two vectors: Two vectors a ⃗ = (a1 , a2 , . . . , an )T and ⃗b = (b1 , b2 , . . . , bn )T are
said to be equal if each component of them equals, i.e. a1 = b1 , a2 = b2 , . . . , an = bn .
Geometric representation of vectors: The most important examples of vectors are,
of course, two-dimensional vectors and three-dimensional vectors. Any two-dimensional vec-
tor a⃗ = (a1 , a2 )T corresponds to a unique directed arrow in the plane, as shown in Fig-
ure 1.1. From Pythagorean theorem we know that the length of the vector a ⃗ in Fig-
ure 1.1 is ⃗a = a1 + a2 . Similarly, any three-dimensional vector a
2 2 ⃗ = (a1 , a2 , a3 )T cor-
responds to a unique directed arrow in the three-dimensional space, as shown in Figure
Pythagorean theorem we know that the length of the vector a
1.2. From ⃗ in Figure 1.2
is ⃗
a = a1 + a2 + a3 . Unfortunately, as human beings we cannot visually imagine higher-
2 2 2
1
2
x2 axis
a2 ⃗ = (a1 , a2 )T
a
x1 axis
a1
x3 axis
x2 axis
a3
a2 ⃗ = (a1 , a2 , a3 )T
a
(a1 , a2 , 0)
a1
x1 axis
⃗ ⋅ ⃗b ∶= a1 b1 + ⋯ + an bn .
a (1.4)
Overall, the sum or difference of two vectors is a vector, the multiplication of a vector by
a scalar is again a vector, while the inner product of two vectors is a real number. With the
inner product defined in (1.4), the length of a vector can be expressed in terms of the inner
product:
√
⃗
a = a⃗⋅a
⃗. (1.5)
Example 1.1
vector addition: (1, 2, 3)T + (1, 0, −1)T = (2, 2, 2)T ,
scalar multiplication: 2(1, 2, 3)T = (2, 4, 6)T ,
inner product: (1, 2, 3)T ⋅ (1, 0, −1)T = 1 + 0 − 3 = −2.
Figure 1.3 shows a visualization of vector additions, which shows that the vector addition
obeys the parallelogram law.
⃗ − ⃗b
⃗
a
⃗ + ⃗b
a
a ⃗b
⃗ − ⃗b
a
⃗
a
⃗b
−⃗b
Figure 1.4 shows a visualization of scalar multiplication of a vector, which shows that
(1) if t > 0 then t⃗b is a vector in the same direction of ⃗b with length t⃗b;
(2) if t < 0 then t⃗b is a vector in the negative direction of ⃗b with length t⃗b.
⃗b 2⃗
3b
1⃗
3b
− 23 ⃗b
which is the unique vector in the direction of ±⃗b such that a ⃗ is orthogonal to ⃗b (see
⃗ − P⃗b a
Figure 1.5):
⃗ ⋅ ⃗b ⃗ ⃗ ⃗ ⋅ ⃗b ⃗ 2
(⃗ ⃗) ⋅ ⃗b = ⃗
a − P⃗b a a− ⃗ ⋅ ⃗b −
b ⋅ b = a b = 0.
a a
⃗b2 ⃗b2
(1.7)
⃗b
⃗b
⃗
a
θ
⃗
P⃗b a
⃗
a
θ
⃗
P⃗b a
⃗ onto ⃗b
Figure 1.5: Ilustration of the projection of a
⃗ and
The angle between two vectors: The angle between two n-dimensional vectors a
⃗b is defined as
⃗
P⃗b a
θ = ± arccos ,
⃗
a
(1.8)
a⃗⃗b⋅b2 ⃗b
⃗
⃗
P⃗b a ⃗ ⋅ ⃗b
cos θ = ± =± =
a
⃗
a ⃗a a⃗b
. (1.9)
⃗
1.3 Matrix
The dimensions of the matrix (1.10) are “m × n” (read “m by n”), and the matrix is often
abbreviated as A = (aij )m×n . In particular, the row vector
⎛ a1j ⎞
⎜ a2j ⎟
⎜ ⎟
⎜ ⎟
⎜ ⋮ ⎟
(1.12)
⎜ ⎟
⎝ amj ⎠
1 −1 −9 10
Example 1.2
2 × 4 matrix:
2 1 −2 2
⎛ 1 −1 −9 ⎞
3 × 3 square matrix: ⎜ 2 1 −2 ⎟
⎜ ⎟
⎝ 3 3 5 ⎠
⎛ 1 ⎞
3 × 1 matrix (3D column vector): ⎜ 2 ⎟
⎜ ⎟
⎝ 3 ⎠
Two matrices A = (aij )m1 ×n1 and B = (bij )m2 ×n2 are said to be equal if their dimensions
are equal and their elements are equal, i.e. m1 = m2 , n1 = n2 and aij = bij for 1 ≤ i ≤ m,
1 ≤ j ≤ n.
⎛ 1 −1 0 ⎞
Example 1.3
1 −1 0
≠⎜
⎜ 2 1 2 ⎟
⎟
⎝ 3 3 5 ⎠
2 1 2
1 −1 0 1 −1 1
≠
2 1 2 2 1 3
1 −1 0 1 −1 0
=
2 1 2 2 1 2
Matrix sum: The sum and difference of two matrices of the same dimension can be
defined as
(aij )m×n + (bij )m×n = (aij + bij )m×n (aij )m×n − (bij )m×n = (aij − bij )m×n
6
Example 1.4 1 −1 0
+ =
0 1 1 1 0 1
2 1 2 1 0 0 3 1 2
1 −1 0 1 −2 −1
− =
0 1 1
2 1 2 1 0 0 1 1 2
Scalar multiplication: The product of a real number λ and a matrix (aij )m×n can be
defined as
λ(aij )m×n = (λaij )m×n .
1 −1 0 2 −2 0
Example 1.5 For A = we have 2A = .
2 1 2 4 2 4
Matrix multiplication: The product of an m × n matrix and an n × k matrix is defined
as an m × k matrix:
If A = (aij )m×n and B = (bij )n×k , then AB = ∑nl=1 ail blj m×k .
The element at ith row and j th column of the product matrix AB is equal to the ith row of
A times (inner product) the j th column of B.
The product of matrix and vector can be defined similarly, by viewing the vector as a
matrix.
⎛ 1 −1 ⎞
1 −1 0
Example 1.6 For A = and B = ⎜ ⎟
⎜ 2 1 ⎟, we have
⎝ 0 1 ⎠
2 1 2
⎛ 4 6 ⎞
Example 1.7 For A = (1 3 0) and B = ⎜ ⎟
⎜ 7 −1 ⎟, we have AB = (25 3).
⎝ 3 −2 ⎠
⎛ 1 ⎞ ⎛ −1 ⎞
1 −1 0
Example 1.8 For A = and v⃗ = ⎜ ⎟ ⃗ = ⎜ 1 ⎟, we have
⎜ 2 ⎟, w ⎜ ⎟
⎝ 0 ⎠ ⎝ 1 ⎠
2 1 2
1 × 1 + (−1) × 2 + 0 × 0 −1
v= = ,
2×1+1×2+2×0
A⃗
4
1 × (−1) + (−1) × 1 + 0 × 1 −2
⃗= = .
2 × (−1) + 1 × 1 + 2 × 1
Aw
1
v1 , . . . , v⃗k ) = (A⃗
AB = A(⃗ vk ).
v1 , . . . , A⃗ (1.13)
7
⎛ 1 0 ⋯ 0 ⎞
⎜ 0 1 ⋯ 0 ⎟
⎜ ⎟.
⎜ ⋮ ⋮ ⋱ ⋮ ⎟
(1.14)
⎝ 0 0 0 1 ⎠
⃗=x
Ix ⃗ ⃗,
for all n-dimensional column vector x (1.15)
and
Example 1.9
⎛ 1 0 0 ⎞⎛ 1 ⎞ ⎛ 1 ⎞
⎜ 0 1 0 ⎟⎜ 2 ⎟ = ⎜ 2 ⎟, (1.17)
⎝ 0 0 1 ⎠⎝ 3 ⎠ ⎝ 3 ⎠
⎛ 1 0 0 ⎞
1 2 3 ⎜ 0 1 0 ⎟ = 1 2 3 . (1.18)
⎝ 0 0 1 ⎠
AB = BA = I,
then A is said to be invertible (or non-singular), and B is called the inverse of A, denoted by
A−1 = B. Note that if A−1 = B then B −1 = A. In other words, (A−1 )−1 = A.
Example 1.10
=
1 0 1 0 1 0
2 1 −2 1 0 1
=
1 0 1 0 1 0
−2 1 2 1 0 1
−1
Hence both and are invertible matrices, and = .
1 0 1 0 1 0 1 0
2 1 −2 1 2 1 −2 1
In other words, the rows of A are the columns of AT , and the columns of A are the rows of
AT . By this definition, we have
(AT )T = A. (1.20)
1 −1 0
Example 1.11 For A = , we have
2 1 2
⎛ 1 2 ⎞
1 −1 0
A =⎜
T ⎟
⎜ −1 1 ⎟ and (AT )T = .
⎝ 0 2 ⎠
2 1 2
⎛ 1 ⎞
The transpose of a column vector is a row vector: for v⃗ = ⎜ ⎟
⎜ −1 ⎟, we have v⃗ = (1, −1, 0).
T
⎝ 0 ⎠
⎛ 2 ⎞
The transpose of a row vector is a column vector: for w ⃗ =⎜
⃗ = (2, 1, 0) we have w T ⎟
⎜ 1 ⎟.
⎝ 0 ⎠
For abbreviation, we let Om×n denote the zero matrix of dimension m × n, i.e.
⎛ 0 0 ⋯ 0 ⎞
⎜ 0 0 ⋯ 0 ⎟
Om×n = ⎜ ⎟
⎜ ⋮ ⋮ ⋱ ⋮ ⎟
(1.21)
⎝ 0 0 0 0 ⎠
⎛ 1 0 ⋯ 0 ⎞
⎜ 0 1 ⋯ 0 ⎟
⎜ ⎟
⎜ ⋮ ⋮ ⋱ ⋮ ⎟
(1.22)
⎝ 0 0 0 1 ⎠
If m and n are fixed, we often omit the subscripts of Om×n and In by writing them simply
as O and I.
In view of definitions of matrix sum, scalar multiplication and matrix multiplication, the
following rules hold:
(1 ) A + B = B + A (commutative law of addition)
(2 ) A + (B + C) = (A + B) + C (associative law of addition)
9
det = a 1 b2 − a 2 b1 .
a 1 b1
(1.23)
a 2 b2
⎛ a 1 b1 c 1 ⎞
det ⎜ a2 b2 c2 ⎟ = a1 det 2 2 − a2 det 1 1 + a3 det 1 1 .
b c b c b c
(1.24)
⎝ a 3 b3 c 3 ⎠ b 3 c 3 b 3 c 3 b2 c 2
+⋯
⎛ a12 a13 ⋯ a1n ⎞
⎜ a32 ⋯ a3n ⎟
+ (−1)n an1 det ⎜ ⎟.
a33
⎜ ⋮ ⋮ ⋱ ⋮ ⎟
⎝ an−1,2 an−1,3 ⋯ an−1,n ⎠
Example 1.12
det = 1 × 1 − (−1) × 2 = 3,
1 2
−1 1
1 −1
det = 1 × 1 − 2 × (−1) = 3,
2 1
⎛ 1 2 0 ⎞
det ⎜ 0 1 1 ⎟ = 1 × det + 0 × det + 2 × det = 3,
1 1 2 0 2 0
⎝ 2 0 −1 ⎠ 0 −1 0 −1 1 1
10
⎛ 1 0 2 ⎞
det ⎜ 2 1 0 ⎟ = 1 × det − 2 × det = 3.
1 0 0 2
⎝ 0 1 −1 ⎠ 1 −1 1 −1
Example 1.13
⎛ 1 2 0 0 ⎞
⎜ ⎟ ⎛ 2 1 0 ⎞ ⎛ 2 0 0 ⎞
det ⎜ ⎟ = 1 × det ⎜ 0 3 0 ⎟ − 1 × det ⎜ 2 1 0 ⎟ = 24,
0 2 1 0
⎜ 0 0 3 0 ⎟ ⎝ 0 0 4 ⎠ ⎝ 0 3 0 ⎠
⎝ 1 0 0 4 ⎠
⎛ 1 0 0 1 ⎞
⎜ ⎟ ⎛ 2 0 0 ⎞ ⎛ 0 0 1 ⎞
det ⎜ ⎟ = 1 × det ⎜ 1 3 0 ⎟ − 2 × det ⎜ 1 3 0 ⎟ = 24.
2 2 0 0
⎜ 0 1 3 0 ⎟ ⎝ 0 0 4 ⎠ ⎝ 0 0 4 ⎠
⎝ 0 0 0 4 ⎠
Determinant has many applications in mathematics. In the following, we will see that the
absolute value of the determinant (1.23) represents the area of the parallelogram spanned
by the two vectors a ⃗ = (a1 , a2 )T and ⃗b = (b1 , b2 )T , while the absolute value of the de-
terminant (1.24) represents the volume of the parallelepiped spanned by the three vectors
⃗ = (a1 , a2 , a3 )T , ⃗b = (b1 , b2 , b3 )T and c⃗ = (c1 , c2 , c3 )T .
a
Area of a parallelogram. Let a ⃗ = (a1 , a2 )T and ⃗b = (b1 , b2 )T be two vectors on the
two-dimensional plane, as shown in Figure 1.6. The area of the parallelogram 0acb is called
⃗ and ⃗b, denoted by area(⃗
the area spanned by the two vectors a a, ⃗b).
c⃗ c⃗
⃗b = (b1 , b2 )T ⃗ = (a1 , a2 )T
a ⃗
a ⃗b
h h
θ θ
0⃗ 0⃗
⃗ and ⃗b
Figure 1.6: Area spanned by the two vectors a
= det .
a 1 b1
(1.27)
a 2 b2
We see that the absolute value of the determinant det aa12 bb12 represents the area of the
parallelipiped spanned by a ⃗ and ⃗b. The sign of this determinant actually represents the
orientation of the two vectors: positivity of the determinant indicates that the angle from a ⃗
to ⃗b is counterclockwise (Figure 1.6 left). Conversely, negativity of the determinant indicates
that the angle from a ⃗ to ⃗b is clockwise (Figure 1.6 right).
Volume of a parallelepiped. Let a ⃗ = (a1 , a2 , a3 ), ⃗b = (b1 , b2 , b3 ) and c⃗ = (c1 , c2 , c3 )
be three vectors in the three-dimensional space, as shown in Figure 1.7. The volume of the
⃗, ⃗b and c⃗,
parallelepiped in the Figure is called the volume spanned by the three vectors a
denoted by volume(⃗ a, ⃗b, c⃗).
d⃗
⃗ ⃗
⃗
a a
Pd⃗a
h
c⃗ c⃗
⃗b ⃗b
⃗ , ⃗b and c⃗
Figure 1.7: Volume spanned by the three vectors a
Clearly, volume(⃗a, ⃗b, c⃗) = area(⃗b, c⃗) h, where h denotes the height of the volume (the red
line is perpendicular to the plane spanned by ⃗b and c⃗), and area(⃗b, c⃗) denotes the area of the
bottom plane spanned by ⃗b and c⃗, which is given by
area(⃗b, c⃗) = ⃗b⃗
c sin θ
= ⃗b⃗
c 1 − (cos θ)2
⃗ 2
1 − (b ⋅ c⃗)
c
= ⃗b⃗
⃗b2 ⃗
c2
= ⃗b2 ⃗ c2 − (⃗b ⋅ c⃗)2
12
= (b21 + b22 + b23 )(c21 + c22 + c23 ) − (b1 c1 + b2 c2 + b3 c3 )2
= b21 c22 + b22 c21 + b23 c21 + b21 c23 + b22 c23 + b23 c22 − 2b1 c1 b2 c2 − 2b3 c1 b1 c3 − 2b2 c3 b3 c2
= (b2 c3 − b3 c2 )2 + (b3 c1 − b1 c3 )2 + (b1 c2 − b2 c1 )2
d⃗ = (b2 c3 − b3 c2 , b3 c1 − b1 c3 , b1 c2 − b2 c1 )
⃗ ⋅ d⃗ ⃗ ⃗ ⃗
a ⋅ d
⃗ =
h = Pd⃗a d =
a
⃗2 ⃗
.
d d
and
⃗
⃗ ⃗
a, ⃗b, c⃗) = area(⃗b, c⃗) h = d
a ⋅ d
= ⃗ ⃗
a ⋅ d
⃗
volume(⃗
d
= a1 (b2 c3 − b3 c2 ) + a2 (b3 c1 − b1 c3 ) + a3 (b1 c2 − b2 c1 )
1.6 Exercises
(1) Which of the following expressions are meaningful? Which are meaningless? Explain.
a ⋅ ⃗b) ⋅ c⃗
(a) (⃗
(b) (⃗a ⋅ ⃗b)⃗c
a(⃗b ⋅ c⃗)
(c) ⃗
⃗ ⋅ (⃗b + c⃗)
(d) a
⃗ ⋅ ⃗b + c⃗
(e) a
a ⋅ (⃗b + c⃗) (⋅ means the inner product between vectors)
(f) ⃗
(2) Compute a ⃗ ⋅ ⃗b, where
(a) a⃗ = (−2, 1), ⃗b = (1, 1).
⃗ = (2, 1), ⃗b = (−1, 2).
(b) a
⃗ = (2, 1, 3), ⃗b = (−1, 2, 1).
(c) a
(3) Let θ be the angle between the two vectors
⎛ 2 ⎞ ⎛ 1 ⎞
⃗=⎜ 1 ⎟
a and ⃗b = ⎜ 0 ⎟ .
⎝ −1 ⎠ ⎝ 1 ⎠
⎛ 2 ⎞ ⎛ 1 ⎞ ⎛ 0 ⎞
⃗ = ⎜ 1 ⎟,
a ⃗b = ⎜ 0 ⎟ and c⃗ = ⎜ 0 ⎟
⎝ −1 ⎠ ⎝ 1 ⎠ ⎝ 1 ⎠
⎛ a1 ⎞ ⎛ b1 ⎞ ⎛ c1 ⎞
⃗ = ⎜ a2 ⎟
a ⃗b = ⎜ b2 ⎟ , c⃗ = ⎜ c2 ⎟
⎝ a3 ⎠ ⎝ b3 ⎠ ⎝ c3 ⎠
we define a vector
⎛ det b2 b3 ⎞
⎜ c2 c3 ⎟
⎜ ⎟
⎜ ⎟
⎜ b1 b3 ⎟
d=⎜
⃗
⎜− det ⎟
⎜ c1 c3 ⎟
⎟
⎜ ⎟
⎜ b1 b2 ⎟
⎜ ⎟
⎝ det
c1 c2 ⎠
⎛ λ−1 2 −1 ⎞
det ⎜ 1 λ−2 1 ⎟=0
⎝ 0 1 λ−3 ⎠
Solution: λ1 = 0, λ2 = 2, λ3 = 4.
(11) Show that (AB)T = B T AT .
Solution: Suppose that A = (aij )m×n and B = (bij )n×k . On one hand, by the definition
of matrix multiplication, the element at the ith row and j th column of the product
matrix AB is given by
n
(AB)ij = ail blj
l=1
15
which implies
n
(AB)Tij = ajl bli
l=1
and so
n n n
(B T AT )ij = (B T )il (AT )lj = bli ajl = ajl bli = (AB)Tij .
l=1 l=1 l=1
(12) Show that if A is an invertible matrix then AT is also invertible and (AT )−1 = (A−1 )T .
Solution: The last question implies that
More exercise questions: See §4.1, §4.4 and §4.5 of the book “Mathematics for Engineers
II: Calculus and Linear Algebra”, written by Gerd Baumann.