Home page for accesible maths 1 Vectors

Style control - access keys in brackets

Font (2 3) - + Letter spacing (4 5) - + Word spacing (6 7) - + Line spacing (8 9) - +

1.4 The scalar product

The next important operation on vectors is the scalar product, sometimes called the dot product of two vectors.

Definition 1.7

The scalar product of two vectors (x1⁢…⁢xn), (y1⁢…⁢yn) in Rn is the real number:

(x1⁢…⁢xn)⋅(y1⁢…⁢yn)=x1⁢y1+…+xn⁢yn

Note that 𝐮⋅𝐯 is a scalar (as the name suggests), not a vector!

Example 1.8

Compute u⋅v for the following pairs of vectors: (i) u=(1  3),v=(-1  1), (ii) u=(0  2),v=(1  0), (iii) u=(4-3   1),v=(2  5-1).

Note that we can only calculate the scalar product of two vectors of the same size! So for example, (2  1)⋅(1  0-1) makes no sense.

Theorem 1.9

The scalar product has the following properties:

(i) u⋅v=v⋅u for any u,v∈Rn,

(ii) u⋅(v+w)=u⋅v+u⋅w for any u, v, w∈Rn,

(iii) u⋅(λ⁢v)=λ⁢(u⋅v)=(λ⁢u)⋅v for any u,v∈Rn, λ∈R.

(iv) u⋅u=|u|2 for any u∈Rn.

Proof

Suppose 𝐮=(u1⁢…⁢un), 𝐯=(v1⁢…⁢vn), 𝐰=(w1⁢…⁢wn).

(i) 𝐮⋅𝐯=u1⁢v1+…+un⁢vn=v1⁢u1+…+vn⁢un=𝐯⋅𝐮.

(ii) 𝐮⋅(𝐯+𝐰)=u1⁢(v1+w1)+…+un⁢(vn+wn)=u1⁢v1+…+⁢un⁢vn+u1⁢w1+…+un⁢wn=𝐮⋅𝐯+𝐮⋅𝐰.

(iii) 𝐮⋅(λ⁢𝐯)=u1⁢(λ⁢v1)+…+un⁢(λ⁢vn)=λ⁢u1⁢v1+…+λ⁢un⁢vn=λ⁢𝐮⋅𝐯.

(iv) 𝐮⋅𝐮=u12+…+un2. By definition, |𝐮|=u12+…+un2. □

The scalar product and orthogonal vectors

The scalar product is extremely useful for calculating angles between vectors. A special case is when two vectors are at right-angles to each other. For example, consider two vectors going along the two coordinate axes in ℝ2: the unit vector along the x-axis is (1  0), while the unit vector along the y-axis is (0  1). We note that the scalar product of these two vectors is zero: (1  0)⋅(0  1)=1⋅0+0⋅1=0. Also, the x and y coordinate axes are at right angles to each other. More generally:

Example 1.10

If u is a unit vector at an angle θ to the x-axis and v is a unit vector at an angle (θ+π/2) to the x-axis (i.e. at right-angles to u) then:

𝐮=(cos⁡θ⁢sin⁡θ),𝐯=(cos⁡(θ+π2)⁢sin⁡(θ+π2))=(-sin⁡θ⁢cos⁡θ)

So in particular, u⋅v=-cos⁡θ⁢sin⁡θ+sin⁡θ⁢cos⁡θ=0.


This is an incredibly important property! It is also true in ℝn.

Theorem 1.11

Let u and v be two vectors in Rn, and let θ, where 0≤θ≤π, be the angle between u and v. Then

𝐮⋅𝐯=|𝐮|⁢|𝐯|⁢cos⁡θ

.

Proof

From the law of cosines from trigonometry it follows that

|𝐯-𝐮|2=|𝐮|2+|𝐯|2-2⁢|𝐮|⁢|𝐯|⁢cos⁡θ.

Since |𝐯-𝐮|2=(𝐯-𝐮)⋅(𝐯-𝐮) and |𝐮|2=𝐮⋅𝐮 and |𝐯|2=𝐯⋅𝐯, we can rewrite the above equation as

(𝐯-𝐮)⋅(𝐯-𝐮)=𝐮⋅𝐮+𝐯⋅𝐯-2⁢|𝐮|⁢|𝐯|⁢cos⁡θ.

Now

(𝐯-𝐮)⋅(𝐯-𝐮) = 𝐯⋅(𝐯-𝐮)-𝐮⋅(𝐯-𝐮)
= 𝐯⋅𝐯-𝐯⋅𝐮-𝐮⋅𝐯+𝐮⋅𝐮
= 𝐮⋅𝐮+𝐯⋅𝐯-2⁢𝐮⋅𝐯.

Thus,

𝐮⋅𝐮+𝐯⋅𝐯-2⁢𝐮⋅𝐯=𝐮⋅𝐮+𝐯⋅𝐯-2⁢|𝐮|⁢|𝐯|⁢cos⁡θ.

This gives the result. □

Corollary 1.12

Two non-zero vectors u,v∈Rn are orthogonal if and only if u⋅v=0.

Cauchy-Schwarz inequality

The Cauchy-Schwarz inequality - which is a consequence of Thm. 1.11 - is a fundamental result which is often useful in problems of geometric nature.

Theorem 1.13 (Cauchy-Schwarz)

Let u,v be vectors in Rn. Then |u⋅v|≤|u|⁢|v|.

Proof

If 𝐮 is not a scalar multiple of 𝐯, then |cos⁡θ|<1 and so the inequality holds. In fact, if 𝐮 and 𝐯 are both non-zero, then strict inequality holds in this case. When 𝐮 is a scalar multiple of 𝐯, then θ equals zero or π and |cos⁡θ|=1, so equality holds in this case. □

Let us look at the two extremes that can occur here, which are 𝐮⋅𝐯=|𝐮|⁢|𝐯| and 𝐮⋅𝐯=-|𝐮|⁢|𝐯|.

Max. value: 𝐮⋅𝐯=|𝐮|⁢|𝐯| when 𝐮 and 𝐯 are parallel, and pointing in the same direction,

Min. value: 𝐮⋅𝐯=-|𝐮|⁢|𝐯| when 𝐮 and 𝐯 are parallel, but pointing in opposite directions.

Example 1.14

Find the greatest and least values of 2⁢x+3⁢y-z on the sphere x2+y2+z2=1, and find the values of x,y,z for which these values occur.

Let 𝐮=(x⁢y⁢z). The condition x2+y2+z2=1 can be stated in vector form as: |𝐮|=1. The function 2⁢x+3⁢y-z is just 𝐮⋅(2  3-1). But 𝐮⋅(2  3-1)≤|𝐮|⁢|(2  3-1)|=4+9+1=14, so the greatest value of 2⁢x+3⁢y-z is 14. It occurs when 𝐮 is parallel to (2  3-1) and pointing in the same direction, so (x⁢y⁢z)=114⁢(2  3-1).

Similarly, the least value of 2⁢x+3⁢y-z is -14, and it occurs when (x⁢y⁢z)=-114⁢(2  3-1).

Example 1.15

Find the greatest and least values of 3⁢x-y+z+1 on the sphere x2+y2+z2=11.

Using scalar products to calculate angles in Rn

Note that it follows from Thm. 1.11 that the angle θ, where 0≤θ≤π, between the non-zero vectors 𝐮 and 𝐯 is given by

θ=cos-1⁡(𝐮⋅𝐯|𝐮|⁢|𝐯|).
Example 1.16

Find the angle θ between the vectors u=(3  1) and v=(1  2).

Solution: u⋅v=3+2=5, while |u|2=32+12=10, |v|2=12+22=5, hence |u|⁢|v|=5⁢2. It follows that cos⁡θ=55⁢2=12. Hence θ=π4.

More commonly you may only be asked to determine the cosine of the angle between 𝐮 and 𝐯.

Example 1.17

Find cos⁡θ, where θ is the angle between u=(1  2-1) and v=(-1  1-3).