Section 1.2

The Norm and the Dot Product

Introduction

We will study geometric entities such as: angle between two vectors, distance, norm of a vector,

orthogonality and other related notions.

Magnitude (length or norm) of a Vector

Example 1.1 Let u a vector in R^2 .

>

> u:=vector([4,1]);

u := vector([4, 1])

Plot the vector.

>

> plotnorm(u);

[Maple Plot]

Length is given as sqrt(u_1^2+u_2^2) .

******************************************************************

Let v = [ v_1 , v_2 , . . ., v_n ] be a vector in the Euclidean space R^n . The norm or

magnitude of v is || v || = sqrt(v_1^2+v_2^2+_*_*_+v_n^2) .

******************************************************************

Compute the norm of the vector u.

> u := vector([-2,1,3,-1]);

u := vector([-2, 1, 3, -1])

>

> `||u||` = norm(u,2);

`||u||` = sqrt(15)

******************************************************************

Theorem 1.2 Properties of the Norm in R^n .

For all vectors v and w in R^n and for all scalars r , we have

1.) || v || > 0 for all nonzero vectors v and || v | |= 0 if and only if v = 0

2.) || r v || = |r| || v ||

3.) || v + w || <= || v || + || w || (Triangle Inequality)

******************************************************************

Unit vectors

A unit vector is any vector that has magnitude (or norm) 1.

> u := vector([1,2]);

u := vector([1, 2])

>

> plotvectorscalar(1/norm(u,2),u);

[Maple Plot]

Dot (Inner) Product

Let u and v be two vectors in R^3 .

> u:=vector([4,1,7]); v:=vector([1,3,5]);

u := vector([4, 1, 7])

v := vector([1, 3, 5])

>

>

Consider the sum of the product of the components of the two vectors

>

> u[1]*v[1] + u[2]*v[2] + u[3]*v[3];

42

This product yields a number not a vector!

> `(u,v)` = dotprod(u,v);

`(u,v)` = 42

******************************************************************

The standard inner product or dot product of any two vectors u and v in the Euclidean

space R^n is a scalar that is equal to the sum of the product of the corresponding components

of the given vectors. Thus, if u := [ a[1], a[2], a[3] ,...., a[n] ] and v : = [ b[1], b[2], b[3] ,...., b[n] ], then the

inner product of u and v denoted by innerprod( u,v ) is

> `(u,v)`=Sum(ai*bi,i=1..n);

`(u,v)` = Sum(ai*bi,i = 1 .. n)

>

******************************************************************

Example: Let v be a vector in R^2 .

>

> v:=vector([x,y]);

v := vector([x, y])

What if we take the inner product of v with itself?

>

> dotprod(v,v);

x*conjugate(x)+y*conjugate(y)

This number is always positive. The square root of this number represents the

distance from the origin to the point [x,y] in R^2 the length of the vector v .

>

> L:=sqrt(x^2+y^2);

L := sqrt(x^2+y^2)

Consider a vector in R^3 .

> v:=vector([x,y,z]);

v := vector([x, y, z])

and the inner product of v with itself is

> dotprod(v,v);

x*conjugate(x)+y*conjugate(y)+z*conjugate(z)

Again this number is always positive. The square root of this number represents the

distance from the origin to the point [x,y,z] in R^3 or the length of the vector v .

> L:=sqrt(x^2+y^2+z^2);

L := sqrt(x^2+y^2+z^2)

>

> u:=vector([4,1,7]);

u := vector([4, 1, 7])

> norm(u,2);

sqrt(66)

> sqrt(dotprod(u,u));

sqrt(66)

>

********************************************************************

(P1) the dot (inner) product of two vectors is commutative.That is,

[u, v] = [v, u] for all vector u and v

(P2) the dot (inner) product of a vector with itself is always positive unless the

vector is a zero vector. That is,

[u, u] = 0 if and only if u is the zero vector

(P3) the dot (inner) product is bilinear in the sense that the inner product of

k[1]*u+k[2]*v and w is equal to the sum of the inner products of

k[1]*u with w and k[2]*v with w .That is,

[ k[1]*u+k[2]*v , w ] = k[1]*[u, w]+k[2]*[v, w]

where we denote here dotprod(v,u) by [v, u] or <v,u> or v.u .

*********************************************************************

Angle between two vectors

>

Let us recall from trigonometry the cosine law:

> c^2=a^2+b^2-2*a*b*cos(theta);

c^2 = a^2+b^2-2*a*b*cos(theta)

where a, b, and c are the lengths of the sides AB, AC and BC of the triangle ABC respectively.

> plottriangle();

[Maple Plot]

Example: Consider the two vectors.

> u := vector([1,2]); v := vector([3,-1]);

u := vector([1, 2])

v := vector([3, -1])

Construct the sides of the triangle ABC.

> plottriangle2();

[Maple Plot]

Compute the lengths of the three vectors.

> a :=sqrt(dotprod(u,u));
b :=sqrt(dotprod(v,v));
c :=sqrt(dotprod(u-v,u-v));

a := sqrt(5)

b := sqrt(10)

c := sqrt(13)

The cosine law implies that

> cos(theta)=(a^2+b^2-c^2)/(2*a*b);

cos(theta) = 1/50*sqrt(5)*sqrt(10)

>

Compute the ratio

> dotprod(u, v)/(a*b);

1/50*sqrt(5)*sqrt(10)

>

*******************************************************************

<u,v> = dotprod( u,v ) = || v| | * || u || * cos( theta )

where theta is the angle between the two vectors u and v and || . || represents the

length of the vector.

*********************************************************************

*********************************************************************

From the geometric definition of the dot (inner) product, we make two inferences

(i) Two nonzero vectors u and v are orthogonal (or prependicular) if and only if

dotprod(u,v) = 0. i.e. the angle between the vectors is pi/2 or 90^o .

(ii) we may conclude the Cauchy-Schwartz inequality

| <u,v> | = |dotprod(u,v)| <= || u || * || v || and the equality

holds when one vector is a scalar multiple of the other.

*******************************************************************

Find the dot product and the angle between the two vectors

> v := vector([1,2,0,2]);

v := vector([1, 2, 0, 2])

> u := vector([-3,1,1,5]);

u := vector([-3, 1, 1, 5])

> dotprod(u,v);

9

> `Angle between u and v` = dotprod(u,v)/(norm(u,2)*norm(v,2));

`Angle between u and v` = 1/2

Are the following two vectors perpendicular?

> v := vector([4,1,-2,1]);

v := vector([4, 1, -2, 1])

> u := vector([3,-4,2,-4]);

u := vector([3, -4, 2, -4])

Application

Closest Point to a vector

Example: Draw the vector v from (0,0) to the point (3,1). Find a point on v that is

closest to the point (1,2 )?

Let (x,y) be any point on vector v. Since point (x,y) is on vector v, the point must satisfy x = 3*y .

Vector v and point (x,y) are then given by

> v:=vector([3,1]);P:=vector([3*y,y]);

v := vector([3, 1])

P := vector([3*y, y])

To find the point P closest to the point (1,2), construct the vector

> w:=vector([3*y-1,y-2]);

w := vector([3*y-1, y-2])

such that it is orthogonal to vector P; that is,

> dotprod(w,P)=0;

3*(3*y-1)*conjugate(y)+(y-2)*conjugate(y) = 0

The required point is

> P:=[3/2,1/2];

P := [3/2, 1/2]

>

Exercises

1-13(odd), 25, 27, 33, 36, 40.