Application of Inner Product Space

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 11

5.

5 Applications of Inner Product Spaces 271

5.5 Applications of Inner Product Spaces


Find the cross product of two vectors in R 3.
Find the linear or quadratic least squares approximation of
a function.
Find the nth-order Fourier approximation of a function.

THE CROSS PRODUCT OF TWO VECTORS IN R 3


Here you will look at a vector product that yields a vector in R3 orthogonal to two
vectors. This vector product is called the cross product, and it is most conveniently
defined and calculated with vectors written in standard unit vector form
v 5 sv1, v2, v3d 5 v1i 1 v2 j 1 v3k.
REMARK
The cross product is defined Definition of the Cross Product of Two Vectors
only for vectors in R 3. The
cross product of two vectors in Let u 5 u1i 1 u2 j 1 u3k and v 5 v1i 1 v2 j 1 v3k be vectors in R3. The cross
Rn, n Þ 3, is not defined here. product of u and v is the vector
u 3 v 5 su2v3 2 u3v2di 2 su1v3 2 u3v1dj 1 su1v2 2 u2v1dk.

A convenient way to remember the formula for the cross product u 3 v is to use

| |
the following determinant form.
i j k
u 3 v 5 u1 u2 u3 Components of u
v1 v2 v3 Components of v

Technically this is not a determinant because it represents a vector and not a real
number. Nevertheless, it is useful because it can help you remember the cross product
formula. Using cofactor expansion in the first row produces

u3v5
| | | | | |
u2
v2
u3
v3
i2 1
u
v1
u3
v3
j1 1
u
v1
u2
v2
k

5 su 2v3 2 u 3v2di 2 su 1v3 2 u 3v1dj 1 su 1v2 2 u 2v1dk


which yields the formula in the definition. Be sure to note that the j-component is
preceded by a minus sign.

LINEAR In physics, the cross product can be used to measure


ALGEBRA torque—the moment M of a force F about a point A, as
APPLIED shown in the figure below. When the point of application of
the force is B, the moment of F about A is given by
\

M 5 AB 3 F
\

where AB represents the


vector whose initial point is M
A and whose terminal point
is B. The magnitude of the
A
moment M measures the
\
AB
tendency of AB to rotate
B
counterclockwise about
an axis directed along the F
vector M.
mark cinotti/Shutterstock.Com
272 Chapter 5 Inner Product Spaces

TECHNOLOGY
Finding the Cross Product of Two Vectors
Many graphing utilities and
software programs can find a
cross product. For instance, if
Let u 5 i 2 2j 1 k and v 5 3i 1 j 2 2k. Find each cross product.
you use a graphing utility to a. u 3 v b. v 3 u c. v 3 v
verify the result of Example 1(b),

|| | | |
then you may see something SOLUTION
similar to the following. i j k
a. u 3 v 5 1 22 1
3 1 22

5
22
1
1
22
i2
1
3
1
22
j1
1
3 | | | 22
1
k

| |
5 3i 1 5j 1 7k
i j k
b. v 3 u 5 3 1 22
1 22 1

5
22|
1 22
1
i2
3
1
5 23i 2 5j 2 7k
| | | | | 22
1
j1
3
1
1
22
k

|| | ||
Note that this result is the negative of that in part (a).
Simulation
Explore this concept further with i j k
an electronic simulation, and for c. v 3 v 5 3 1 22
syntax regarding specific programs
3 1 22

| | |
involving Example 1, please visit
www.cengagebrain.com. Similar 1 22 3 22 3 1
exercises and projects are also 5 i2 j1 k
1 22 3 22 3 1
available on the website.
5 0i 1 0j 1 0k 5 0

The results obtained in Example 1 suggest some interesting algebraic properties of


the cross product. For instance,
u 3 v 5 2 sv 3 ud and v 3 v 5 0.
These properties, along with several others, are stated in Theorem 5.17.

THEOREM 5.17 Algebraic Properties of the Cross Product


If u, v, and w are vectors in R3 and c is a scalar, then the following properties
are true.
1. u 3 v 5 2 sv 3 ud
2. u 3 sv 1 wd 5 su 3 vd 1 su 3 wd
3. csu 3 vd 5 cu 3 v 5 u 3 cv
4. u 3 0 5 0 3 u 5 0
5. u 3 u 5 0
6. u ? sv 3 wd 5 su 3 vd ? w

PROOF
The proof of the first property is given here. The proofs of the other properties are left
to you. (See Exercises 53–57.) Let u and v be
u 5 u1i 1 u2 j 1 u3k
and
v 5 v1i 1 v2 j 1 v3k.
5.5 Applications of Inner Product Spaces 273

| |
Then u 3 v is
i j k
u 3 v 5 u1 u2 u3
v1 v2 v3
5 su 2v3 2 u 3v2di 2 su 1v3 2 u 3v1dj 1 su 1v2 2 u 2v1dk

| |
and v 3 u is
i j k
v 3 u 5 v1 v2 v3
u1 u2 u3
5 sv2u 3 2 v3u 2di 2 sv1u 3 2 v3u 1dj 1 sv1u 2 2 v2u 1dk
5 2 su 2v3 2 u 3v2di 1 su 1v3 2 u 3v1dj 2 su 1v2 2 u 2v1dk
5 2 sv 3 ud.

Property 1 of Theorem 5.17 tells you that the vectors u 3 v and v 3 u have equal
lengths but opposite directions. The geometric implication of this will be discussed
after establishing some geometric properties of the cross product of two vectors.

THEOREM 5.18 Geometric Properties of the Cross Product


If u and v are nonzero vectors in R3, then the following properties are true.
1. u 3 v is orthogonal to both u and v.
2. The angle u between u and v is given by i u 3 v i 5 iu i ivi sin u.
3. u and v are parallel if and only if u 3 v 5 0.
4. The parallelogram having u and v as adjacent sides has an area of iu 3 v i.

PROOF
The proof of Property 4 follows. The proofs of the other properties are left to you. (See
v Exercises 58–60.) Let u and v represent adjacent sides of a parallelogram, as shown in
v sin θ Figure 5.28. By Property 2, the area of the parallelogram is
θ Base Height
u
Area 5 i ui iv i sin u 5 i u 3 v i.
Figure 5.28

Property 1 states that the vector u 3 v is orthogonal to both u and v. This implies that
u 3 v sand v 3 ud is orthogonal to the plane determined by u and v. One way to
remember the orientation of the vectors u, v, and u 3 v is to compare them with the unit
vectors i, j, and k, as shown in Figure 5.29. The three vectors u, v, and u 3 v form a
right-handed system, whereas the three vectors u, v, and v 3 u form a left-handed system.

uxv
k=ixj

v
i j
u This is the plane
determined by
xy-plane u and v.
Right-Handed
Systems
Figure 5.29
274 Chapter 5 Inner Product Spaces

Finding a Vector Orthogonal


to Two Given Vectors
Find a unit vector orthogonal to both
u 5 i 2 4j 1 k
and
v 5 2i 1 3j.
SOLUTION
z

| |
From Property 1 of Theorem 5.18, you know that the cross product
12
(− 3, 2, 11)
i j k
10 u3v5 1 24 1
uxv 2 3 0
8
5 23i 1 2j 1 11k
6
is orthogonal to both u and v, as shown in Figure 5.30. Then, by dividing by the length
(1, − 4, 1) of u 3 v,
u
i u 3 vi 5 !s23d2 1 22 1 112
v 5 !134

x 4 4 y you obtain the unit vector


(2, 3, 0)
u3v 3 2 11
Figure 5.30 52 i1 j1 k
iu 3 vi !134 !134 !134

which is orthogonal to both u and v, because

12 !134
3
,
!134 !134 2
2
,
11
? s1, 24, 1d 5 0
and

12 !134
3
,
!134 !134 2
2
,
11
? s2, 3, 0d 5 0.

Finding the Area of a Parallelogram


v = − 2j + 6k
z
Find the area of the parallelogram that has
8
u 5 23i 1 4j 1 k
7
6 and
5 v 5 22j 1 6k
4
as adjacent sides, as shown in Figure 5.31.
3
SOLUTION
From Property 4 of Theorem 5.18, you know that the area of this parallelogram is
iu 3 vi. Because

| |
1 1
x 2 u = − 3i + 4j + k i j k
3
4
5 u 3 v 5 23 4 1 5 26i 1 18j 1 6k
6
7 y 0 22 6
The area of the parallelogram is
u x v = 1036. the area of the parallelogram is
Figure 5.31 i u 3 vi 5 !262 1 182 1 62 5 !1036 < 32.19 square units.
5.5 Applications of Inner Product Spaces 275

LEAST SQUARES APPROXIMATIONS (CALCULUS)


Many problems in the physical sciences and engineering involve an approximation of
a function f by another function g. If f is in C fa, bg sthe inner product space of all
continuous functions on fa, bgd, then g is usually chosen from a subspace W of C fa, bg.
For instance, to approximate the function
f sxd 5 e x, 0 # x # 1
you could choose one of the following forms of g.
1. gsxd 5 a0 1 a1x, 0 # x # 1 Linear

2. gsxd 5 a0 1 a1x 1 a2x2, 0 # x # 1 Quadratic


3. gsxd 5 a0 1 a1 cos x 1 a2 sin x, 0 # x # 1 Trigonometric
Before discussing ways of finding the function g, you must define how one
function can “best” approximate another function. One natural way would require the
area bounded by the graphs of f and g on the interval fa, bg,

E|
b
Area 5
a
|
f sxd 2 gsxd dx

to be a minimum with respect to other functions in the subspace W, as shown in


Figure 5.32.
y

b x
a
f

Figure 5.32

Because integrands involving absolute value are often difficult to evaluate, however, it
is more common to square the integrand to obtain

E
b
f f sxd 2 gsxdg2 dx.
a

With this criterion, the function g is called the least squares approximation of f with
respect to the inner product space W.

Definition of Least Squares Approximation


Let f be continuous on fa, bg, and let W be a subspace of C fa, bg. A function g
in W is called a least squares approximation of f with respect to W when the
value of

E
b
I5 f f sxd 2 gsxdg2 dx
a

is a minimum with respect to all other functions in W.

Note that if the subspace W in this definition is the entire space C fa, bg, then
gsxd 5 f sxd, which implies that I 5 0.
276 Chapter 5 Inner Product Spaces

Finding a Least Squares Approximation

Find the least squares approximation gsxd 5 a0 1 a1x of


f sxd 5 e x, 0 # x # 1.
SOLUTION
For this approximation you need to find the constants a0 and a1 that minimize the value of

E
1
I5 f f sxd 2 gsxdg 2 dx
0

E
1
5 se x 2 a0 2 a1 xd2 dx.
0

Evaluating this integral, you have

E
1
I5 se x 2 a0 2 a1xd2 dx
0

E
1
5 se2x 2 2a0e x 2 2a1xe x 1 a20 1 2a0a1x 1 a21x2d dx
0

3 4
1 2x x3 1
5 e 2 2a0e x 2 2a1e xsx 2 1d 1 a20x 1 a0 a1x2 1 a21
2 3 0
1 2 1
5 se 2 1d 2 2a0se 2 1d 2 2a1 1 a20 1 a 0 a1 1 a21.
2 3
Now, considering I to be a function of the variables a0 and a1, use calculus to determine
the values of a0 and a1 that minimize I. Specifically, by setting the partial derivatives
­I
5 2a0 2 2e 1 2 1 a1
­a0
­I 2
y f (x) = e x 5 a0 1 a1 2 2
­a1 3
4 equal to zero, you obtain the following two linear equations in a0 and a1.
3 2a0 1 a1 5 2se 2 1d
3a0 1 2a1 5 6
2
The solution of this system is
a0 5 4e 2 10 < 0.873 and a1 5 18 2 6e < 1.690.
x
1 (Verify this.) So, the best linear approximation of f(xd 5 ex on the interval f0, 1g is
g(x) = 0.873 + 1.690x gsxd 5 4e 2 10 1 s18 2 6edx < 0.873 1 1.690x.
Figure 5.33 Figure 5.33 shows the graphs of f and g on f0, 1g.

Of course, whether the approximation obtained in Example 4 is the best


approximation depends on the definition of the best approximation. For instance, if the
definition of the best approximation had been the Taylor polynomial of degree 1
centered at 0.5, then the approximating function g would have been
gsxd 5 f s0.5d 1 f 9s0.5dsx 2 0.5d
5 e0.5 1 e0.5sx 2 0.5d
< 0.824 1 1.649x.
Moreover, the function g obtained in Example 4 is only the best linear approximation
of f (according to the least squares criterion). In Example 5 you will find the best
quadratic approximation.
5.5 Applications of Inner Product Spaces 277

Finding a Least Squares Approximation

Find the least squares approximation gsxd 5 a0 1 a1x 1 a2x2 of f sxd 5 e x, 0 # x # 1.


SOLUTION
For this approximation you need to find the values of a0, a1, and a2 that minimize the
value of

E
1

I5 f f sxd 2 gsxdg2 dx

E
0
1

5 se x 2 a0 2 a1 x 2 a2 x 2d2 dx
0
1
5 se2 2 1d 1 2a0s1 2 ed 1 2a2s2 2 ed
2
2 1 1 1
1 a 20 1 a0a1 1 a0a2 1 a1a2 1 a21 1 a22 2 2a1.
3 2 3 5
g(x) ≈ 1.013 + 0.851x + 0.839x 2
Setting the partial derivatives of I swith respect to a0, a1, and a2 d equal to zero produces
y
the following system of linear equations.
4 6a0 1 3a1 1 2a2 5 6se 2 1d
6a0 1 4a1 1 3a2 5 12
3
20a0 1 15a1 1 12a2 5 60se 2 2d
2
The solution of this system is
a0 5 2105 1 39e < 1.013
x a1 5 588 2 216e < 0.851
1
a2 5 2570 1 210e < 0.839.
f(x) = e x
(Verify this.) So, the approximating function g is gsxd < 1.013 1 0.851x 1 0.839x2.
Figure 5.34 Figure 5.34 shows the graphs of f and g.

The integral I (given in the definition of the least squares approximation) can be
expressed in vector form. To do this, use the inner product defined in Example 5 in
Section 5.2:

E
b
k f , gl 5 f sxdgsxd dx.
a

With this inner product you have

E
b
I5 f f sxd 2 gsx)g 2 dx 5 k f 2 g, f 2 gl 5 i f 2 gi 2.
a

This means that the least squares approximating function g is the function that
minimizes i f 2 gi2 or, equivalently, minimizes i f 2 gi. In other words, the least
squares approximation of a function f is the function g (in the subspace W) closest to f
in terms of the inner product k f, gl. The next theorem gives you a way of determining
the function g.

THEOREM 5.19 Least Squares Approximation


Let f be continuous on fa, bg, and let W be a finite-dimensional subspace of C fa, bg.
The least squares approximating function of f with respect to W is given by
g 5 k f, w1 lw1 1 k f, w2 lw2 1 . . . 1 k f, wn lwn
where B 5 Hw1, w2, . . . , wnJ is an orthonormal basis for W.
278 Chapter 5 Inner Product Spaces

PROOF
To show that g is the least squares approximating function of f, prove that the inequality
i f 2 gi # i f 2 w i is true for any vector w in W. By writing f 2 g as
f 2 g 5 f 2 k f, w1 lw1 2 k f, w2 lw2 2 . . . 2 k f, wn lwn
you can see that f 2 g is orthogonal to each wi , which in turn implies that it is orthogonal
to each vector in W. In particular, f 2 g is orthogonal to g 2 w. This allows you to apply
the Pythagorean Theorem to the vector sum f 2 w 5 s f 2 gd 1 sg 2 wd to conclude that
i f 2 wi2 5 i f 2 g i2 1 i g 2 w i2. So, it follows that i f 2 g i2 # i f 2 wi 2, which then
implies that i f 2 gi # i f 2 wi.

Now observe how Theorem 5.19 can be used to produce the least squares
approximation obtained in Example 4. First apply the Gram-Schmidt orthonormalization
process to the standard basis H1, xJ to obtain the orthonormal basis B 5 H 1, !3s2x 2 1dJ.
(Verify this.) Then, by Theorem 5.19, the least squares approximation of e x in the subspace
of all linear functions is
gsxd 5 ke x, 1ls1d 1 k e x,!3s2x 2 1dl!3s2x 2 1d

E E
1 1
5 e x dx 1 !3s2x 2 1d !3 e xs2x 2 1d dx
0 0

E E
1 1
5 e x dx 1 3s2x 2 1d e xs2x 2 1d dx
0 0
5 4e 2 10 1 s18 2 6edx
which agrees with the result obtained in Example 4.

Finding a Least Squares Approximation

Find the least squares approximation of f sxd 5 sin x, 0 # x # p, with respect to the
subspace W of polynomial functions of degree 2 or less.
SOLUTION
To use Theorem 5.19, apply the Gram-Schmidt orthonormalization process to the
standard basis for W, H1, x, x2J, to obtain the orthonormal basis

5 1p, p 6
!3 !5
B 5 Hw1, w2, w3J 5 s2x 2 pd, s6x 2 2 6px 1 p 2d .
! !p p 2!p
(Verify this.) The least squares approximating function g is
gsxd 5 k f , w1 lw1 1 k f, w2 lw2 1 k f, w3 lw3
and you have

E
p
y 1 2
k f, w1 l 5 sin x dx 5
!p !p

E
0
p
1 !3
k f , w2 l 5 sin xs2x 2 pd dx 5 0
p!p

E
0
p
!5 2!5
x k f, w3 l 5 sin xs6x2 2 6px 1 p 2d dx 5 sp 2 2 12d.
π π p 2!p 0 p 2!p
2
f So, g is
−1 2 10sp 2 2 12d
g gsxd 5 1 s6x 2 2 6px 1 p 2d < 20.4177x 2 1 1.3122x 2 0.0505.
p p5
Figure 5.35 Figure 5.35 shows the graphs of f and g.
5.5 Applications of Inner Product Spaces 279

FOURIER APPROXIMATIONS (CALCULUS)


You will now look at a special type of least squares approximation called a Fourier
approximation. For this approximation, consider functions of the form
a0
gsxd 5 1 a1 cos x 1 . . . 1 an cos nx 1 b1 sin x 1 . . . 1 bn sin nx
2
in the subspace W of
C f0, 2pg
spanned by the basis
S 5 H1, cos x, cos 2x, . . . , cos nx, sin x, sin 2x, . . . , sin nxJ.
These 2n 1 1 vectors are orthogonal in the inner product space C f0, 2pg because

E
2p
k f , gl 5 f sxdgsxd dx 5 0, f Þ g
0

as demonstrated in Example 3 in Section 5.3. Moreover, by normalizing each function


in this basis, you obtain the orthonormal basis
B 5 Hw0, w1, . . . , wn, wn11, . . . , w2nJ

5 5 1
!2p !p
,
1
cos x, . . . ,
1
!p
cos nx,
1
!p
sin x, . . . ,
1
!p 6
sin nx .

With this orthonormal basis, you can apply Theorem 5.19 to write
gsxd 5 k f , w0lw0 1 k f , w1 lw1 1 . . . 1 k f , w2n lw2n.
The coefficients
a0, a1, . . . , an, b1, . . . , bn
for gsxd in the equation
a0
gsxd 5 1 a1 cos x 1 . . . 1 an cos nx 1 b1 sin x 1 . . . 1 bn sin nx
2
are given by the following integrals.

E E
2p 2p
2 2 1 1
a0 5 k f, w0 l 5 f sxd dx 5 f sxd dx
!2p !2p 0 !2p p 0

E E
2p 2p
1 1 1 1
a1 5 k f, w1 l 5 f sxd cos x dx 5 f sxd cos x dx
!p !p 0 !p p 0
.
.
.

E E
2p 2p
1 1 1 1
an 5 k f, wn l 5 f sxd cos nx dx 5 f sxd cos nx dx
!p !p 0 !p p 0

E E
2p 2p
1 1 1 1
b1 5 k f, wn11 l 5 f sxd sin x dx 5 f sxd sin x dx
!p !p 0 !p p 0
.
.
.

E E
2p 2p
1 1 1 1
bn 5 k f, w2n l 5 f sxd sin nx dx 5 f sxd sin nx dx
!p !p 0 !p p 0

The function gsxd is called the nth-order Fourier approximation of f on the


interval f0, 2pg. Like Fourier coefficients, this function is named after the French
mathematician Jean-Baptiste Joseph Fourier (1768 –1830). This brings you to
Theorem 5.20.
280 Chapter 5 Inner Product Spaces

THEOREM 5.20 Fourier Approximation


On the interval f0, 2pg, the least squares approximation of a continuous
function f with respect to the vector space spanned by
H1, cos x, . . . , cos nx, sin x, . . . , sin nxJ
is
a0
gsxd 5 1 a1 cos x 1 . . . 1 an cos nx 1 b1 sin x 1 . . . 1 bn sin nx
2
where the Fourier coefficients a0, a1, . . . , an, b1, . . . , bn are

E
2p
1
a0 5 f sxd dx
p 0

E
2p
1
aj 5 f sxd cos jx dx, j 5 1, 2, . . . , n
p 0

E
2p
1
bj 5 f sxd sin jx dx, j 5 1, 2, . . . , n.
p 0

Finding a Fourier Approximation

Find the third-order Fourier approximation of f sxd 5 x, 0 # x # 2p.


SOLUTION
Using Theorem 5.20, you have
a0
gsxd 5 1 a1 cos x 1 a2 cos 2x 1 a3 cos 3x 1 b1 sin x 1 b2 sin 2x 1 b3 sin 3x
2
where

E
2p
1 1
a0 5 x dx 5 2p 2 5 2p
p 0 p

E
2p

3p j 4
1 1 x 2p
aj 5 x cos jx dx 5 2
cos jx 1 sin jx 50
p 0 pj 0

E
2p

3 pj 4
1 1 x 2p 2
bj 5 x sin jx dx 5 2
sin jx 2 cos jx 52 .
p 0 pj 0 j

This implies that a0 5 2p, a1 5 0, a2 5 0, a3 5 0, b1 5 22, b2 5 2 22 5 21, and


b3 5 2 23. So, you have y
f(x) = x
2p 2
gsxd 5 2 2 sin x 2 sin 2x 2 sin 3x 2π
2 3
2
5 p 2 2 sin x 2 sin 2x 2 sin 3x.
3
π
Figure 5.36 compares the graphs of f and g.
g

x
π 2π

Third-Order Fourier Approximation


Figure 5.36
5.5 Applications of Inner Product Spaces 281

In Example 7, the pattern for the Fourier coefficients appears to be a0 5 2p,


a1 5 a2 5 . . . 5 an 5 0, and
2 2 2
b1 5 2 , b2 5 2 , . . . , bn 5 2 .
1 2 n
The nth-order Fourier approximation of f sxd 5 x is

1 2
1 1 1
gsxd 5 p 2 2 sin x 1 sin 2x 1 sin 3x 1 . . . 1 sin nx .
2 3 n
As n increases, the Fourier approximation improves. For instance, Figure 5.37 shows
the fourth- and fifth-order Fourier approximations of f sxd 5 x, 0 # x # 2p.

y y
f (x) = x f(x) = x

2π 2π

π π
g g

x x
π 2π π 2π

Fourth-Order Fourier Approximation Fifth-Order Fourier Approximation


Figure 5.37

In advanced courses it is shown that as n → `, the approximation error i f 2 g i


approaches zero for all x in the interval s0, 2pd. The infinite series for gsxd is called a
Fourier series.

Finding a Fourier Approximation

|
Find the fourth-order Fourier approximation of f sxd 5 x 2 p , 0 # x # 2p. |
SOLUTION
Using Theorem 5.20, find the Fourier coefficients as follows.

E|
2p
1
a0 5
p 0
|
x 2 p dx 5 p

E|
2p
1
aj 5
p 0
|
x 2 p cos jx dx

E
y p
2
5 sp 2 xd cos jx dx
p 0

f(x) = x − π 2
5 s1 2 cos jpd
pj 2

E|
π 2p
1
bj 5
p 0
|
x 2 p sin jx dx 5 0

x So, a0 5 p, a1 5 4yp, a2 5 0, a3 5 4y9p, a4 5 0, b1 5 0, b2 5 0, b3 5 0, and


π 2π b4 5 0, which means that the fourth-order Fourier approximation of f is

g(x) = π + 4 cos x + 4 cos 3x


p 4 4
2 π 9π gsxd 5 1 cos x 1 cos 3x.
2 p 9p
Figure 5.38 Figure 5.38 compares the graphs of f and g.

You might also like