Sei sulla pagina 1di 12

LINEAR ALGEBRA

W W L CHEN
c _ W W L Chen, 1997, 2008.
This chapter is available free to all individuals, on the understanding that it is not to be used for nancial gain,
and may be downloaded and/or photocopied, with or without permission from the author.
However, this document may not be kept on any information storage and retrieval system without permission
from the author, unless such system is not accessible to any individuals other than its owners.
Chapter 11
APPLICATIONS OF
REAL INNER PRODUCT SPACES
11.1. Least Squares Approximation
Given a continuous function f : [a, b] R, we wish to approximate f by a polynomial g : [a, b] R of
degree at most k, such that the error
_
b
a
[f(x) g(x)[
2
dx
is minimized. The purpose of this section is to study this problem using the theory of real inner product
spaces. Our argument is underpinned by the following simple result in the theory.
PROPOSITION 11A. Suppose that V is a real inner product space, and that W is a nite-dimensional
subspace of V . Given any u V , the inequality
|u proj
W
u| |u w|
holds for every w W.
In other words, the distance from u to any w W is minimized by the choice w = proj
W
u, the
orthogonal projection of u on the subspace W. Alternatively, proj
W
u can be thought of as the vector
in W closest to u.
Proof of Proposition 11A. Note that
u proj
W
u W

and proj
W
u w W.
Chapter 11 : Applications of Real Inner Product Spaces page 1 of 12
Linear Algebra c _ W W L Chen, 1997, 2008
It follows from Pythagorass theorem that
|u w|
2
= |(u proj
W
u) + (proj
W
u w)|
2
= |u proj
W
u|
2
+|proj
W
u w|
2
,
so that
|u w|
2
|u proj
W
u|
2
= |proj
W
u w|
2
0.
The result follows immediately. _
Let V denote the vector space C[a, b] of all continuous real valued functions on the closed interval
[a, b], with inner product
f, g) =
_
b
a
f(x)g(x) dx.
Then
_
b
a
[f(x) g(x)[
2
dx = f g, f g) = |f g|
2
.
It follows that the least squares approximation problem is reduced to one of nding a suitable polynomial
g to minimize the norm |f g|.
Now let W = P
k
[a, b] be the collection of all polynomials g : [a, b] R with real coecients and of
degree at most k. Note that W is essentially P
k
, although the variable is restricted to the closed interval
[a, b]. It is easy to show that W is a subspace of V . In view of Proposition 11A, we conclude that
g = proj
W
f
gives the best least squares approximation among polynomials in W = P
k
[a, b]. This subspace is of
dimension k + 1. Suppose that v
0
, v
1
, . . . , v
k
is an orthogonal basis of W = P
k
[a, b]. Then by Propo-
sition 9L, we have
g =
f, v
0
)
|v
0
|
2
v
0
+
f, v
1
)
|v
1
|
2
v
1
+. . . +
f, v
k
)
|v
k
|
2
v
k
.
Example 11.1.1. Consider the function f(x) = x
2
in the interval [0, 2]. Suppose that we wish to nd a
least squares approximation by a polynomial of degree at most 1. In this case, we can take V = C[0, 2],
with inner product
f, g) =
_
2
0
f(x)g(x) dx,
and W = P
1
[0, 2], with basis 1, x. We now apply the Gram-Schmidt orthogonalization process to this
basis to obtain an orthogonal basis 1, x 1 of W, and take
g =
x
2
, 1)
|1|
2
1 +
x
2
, x 1)
|x 1|
2
(x 1).
Now
x
2
, 1) =
_
2
0
x
2
dx =
8
3
and |1|
2
= 1, 1) =
_
2
0
dx = 2,
Chapter 11 : Applications of Real Inner Product Spaces page 2 of 12
Linear Algebra c _ W W L Chen, 1997, 2008
while
x
2
, x 1) =
_
2
0
x
2
(x 1) dx =
4
3
and |x 1|
2
= x 1, x 1) =
_
2
0
(x 1)
2
dx =
2
3
.
It follows that
g =
4
3
+ 2(x 1) = 2x
2
3
.
Example 11.1.2. Consider the function f(x) = e
x
in the interval [0, 1]. Suppose that we wish to nd a
least squares approximation by a polynomial of degree at most 1. In this case, we can take V = C[0, 1],
with inner product
f, g) =
_
1
0
f(x)g(x) dx,
and W = P
1
[0, 1], with basis 1, x. We now apply the Gram-Schmidt orthogonalization process to this
basis to obtain an orthogonal basis 1, x 1/2 of W, and take
g =
e
x
, 1)
|1|
2
1 +
e
x
, x 1/2)
|x 1/2|
2
_
x
1
2
_
.
Now
e
x
, 1) =
_
1
0
e
x
dx = e 1 and e
x
, x) =
_
1
0
e
x
xdx = 1,
so that
_
e
x
, x
1
2
_
= e
x
, x)
1
2
e
x
, 1) =
3
2

e
2
.
Also
|1|
2
= 1, 1) =
_
1
0
dx = 1 and
_
_
_
_
x
1
2
_
_
_
_
2
=
_
x
1
2
, x
1
2
_
=
_
1
0
_
x
1
2
_
2
dx =
1
12
.
It follows that
g = (e 1) + (18 6e)
_
x
1
2
_
= (18 6e)x + (4e 10).
Remark. From the proof of Proposition 11A, it is clear that |uw| is minimized by the unique choice
w = proj
W
u. It follows that the least squares approximation problem posed here has a unique solution.
11.2. Quadratic Forms
A real quadratic form in n variables x
1
, . . . , x
n
is an expression of the form
n

i=1
n

j=1
ij
c
ij
x
i
x
j
, (1)
where c
ij
R for every i, j = 1, . . . , n satisfying i j.
Chapter 11 : Applications of Real Inner Product Spaces page 3 of 12
Linear Algebra c _ W W L Chen, 1997, 2008
Example 11.2.1. The expression 5x
2
1
+ 6x
1
x
2
+ 7x
2
2
is a quadratic form in two variables x
1
and x
2
. It
can be written in the form
5x
2
1
+ 6x
1
x
2
+ 7x
2
2
= ( x
1
x
2
)
_
5 3
3 7
__
x
1
x
2
_
.
Example 11.2.2. The expression 4x
2
1
+5x
2
2
+3x
2
3
+2x
1
x
2
+4x
1
x
3
+6x
2
x
3
is a quadratic form in three
variables x
1
, x
2
and x
3
. It can be written in the form
4x
2
1
+ 5x
2
2
+ 3x
2
3
+ 2x
1
x
2
+ 4x
1
x
3
+ 6x
2
x
3
= ( x
1
x
2
x
3
)
_
_
4 1 2
1 5 3
2 3 3
_
_
_
_
x
1
x
2
x
3
_
_
.
Note that in both examples, the quadratic form can be described in terms of a real symmetric matrix.
In fact, this is always possible. To see this, note that given any quadratic form (1), we can write, for
every i, j = 1, . . . , n,
a
ij
=
_

_
c
ij
if i = j,
1
2
c
ij
if i < j,
1
2
c
ji
if i > j.
(2)
Then
n

i=1
n

j=1
ij
c
ij
x
i
x
j
=
n

i=1
n

j=1
a
ij
x
i
x
j
= ( x
1
. . . x
n
)
_
_
a
11
. . . a
1n
.
.
.
.
.
.
a
n1
. . . a
nn
_
_
_
_
x
1
.
.
.
x
n
_
_
.
The matrix
A =
_
_
a
11
. . . a
1n
.
.
.
.
.
.
a
n1
. . . a
nn
_
_
is clearly symmetric, in view of (2).
We are interested in the case when x
1
, . . . , x
n
take real values. In this case, we can write
x =
_
_
x
1
.
.
.
x
n
_
_
.
It follows that a quadratic form can be written as
x
t
Ax,
where A is an n n real symmetric matrix and x takes values in R
n
.
Many problems in mathematics can be studied using quadratic forms. Here we shall restrict our
attention to two fundamental problems which are in fact related. The rst is the question of what
conditions the matrix A must satisfy in order that the inequality
x
t
Ax > 0
holds for every non-zero x R
n
. The second is the question of whether it is possible to have a change of
variables of the type x = Py, where P is an invertible matrix, such that the quadratic form x
t
Ax can
be represented in the alternative form y
t
Dy, where D is a diagonal matrix with real entries.
Chapter 11 : Applications of Real Inner Product Spaces page 4 of 12
Linear Algebra c _ W W L Chen, 1997, 2008
Definition. A quadratic form x
t
Ax is said to be positive denite if x
t
Ax > 0 for every non-zero x R
n
.
In this case, we say that the symmetric matrix A is a positive denite matrix.
To answer our rst question, we shall prove the following result.
PROPOSITION 11B. A quadratic form x
t
Ax is positive denite if and only if all the eigenvalues of
the symmetric matrix A are positive.
Our strategy here is to prove Proposition 11B by rst studying our second question. Since the matrix
A is real and symmetric, it follows from Proposition 10E that it is orthogonally diagonalizable. In other
words, there exists an orthogonal matrix P and a diagonal matrix D such that P
t
AP = D, and so
A = PDP
t
. It follows that
x
t
Ax = x
t
PDP
t
x,
and so, writing
y = P
t
x,
we have
x
t
Ax = y
t
Dy.
Also, since P is an orthogonal matrix, we also have x = Py. This answers our second question.
Furthermore, in view of the Orthogonal diagonalization process, the diagonal entries in the matrix D
can be taken to be the eigenvalues of A, so that
D =
_
_

1
.
.
.

n
_
_
,
where
1
, . . . ,
n
R are the eigenvalues of A. Writing
y =
_
_
_
y
1
.
.
.
y
n
_
_
_,
we have
x
t
Ax = y
t
Dy =
1
y
2
1
+. . . +
n
y
2
n
. (3)
Note now that x = 0 if and only if y = 0, since P is an invertible matrix. Proposition 11B now follows
immediately from (3).
Example 11.2.3. Consider the quadratic form 2x
2
1
+ 5x
2
2
+ 2x
2
3
+ 4x
1
x
2
+ 2x
1
x
3
+ 4x
2
x
3
. This can be
written in the form x
t
Ax, where
A =
_
_
2 2 1
2 5 2
1 2 2
_
_
and x =
_
_
x
1
x
2
x
3
_
_
.
The matrix A has eigenvalues
1
= 7 and (double root)
2
=
3
= 1; see Example 10.3.1. Furthermore,
we have P
t
AP = D, where
P =
_
_
1/

6 1/

2 1/

3
2/

6 0 1/

3
1/

6 1/

2 1/

3
_
_
and D =
_
_
7 0 0
0 1 0
0 0 1
_
_
.
Writing y = P
t
x, the quadratic form becomes 7y
2
1
+y
2
2
+y
2
3
which is clearly positive denite.
Chapter 11 : Applications of Real Inner Product Spaces page 5 of 12
Linear Algebra c _ W W L Chen, 1997, 2008
Example 11.2.4. Consider the quadratic form 5x
2
1
+ 6x
2
2
+ 7x
2
3
4x
1
x
2
+ 4x
2
x
3
. This can be written
in the form x
t
Ax, where
A =
_
_
5 2 0
2 6 2
0 2 7
_
_
and x =
_
_
x
1
x
2
x
3
_
_
.
The matrix A has eigenvalues
1
= 3,
2
= 6 and
3
= 9; see Example 10.3.3. Furthermore, we have
P
t
AP = D, where
P =
_
_
2/3 2/3 1/3
2/3 1/3 2/3
1/3 2/3 2/3
_
_
and D =
_
_
3 0 0
0 6 0
0 0 9
_
_
.
Writing y = P
t
x, the quadratic form becomes 3y
2
1
+ 6y
2
2
+ 9y
2
3
which is clearly positive denite.
Example 11.2.5. Consider the quadratic form x
2
1
+x
2
2
+ 2x
1
x
2
. Clearly this is equal to (x
1
+x
2
)
2
and
is therefore not positive denite. The quadratic form can be written in the form x
t
Ax, where
A =
_
1 1
1 1
_
and x =
_
x
1
x
2
_
.
It follows from Proposition 11B that the eigenvalues of A are not all positive. Indeed, the matrix A has
eigenvalues
1
= 2 and
2
= 0, with corresponding eigenvectors
_
1
1
_
and
_
1
1
_
.
Hence we may take
P =
_
1/

2 1/

2
1/

2 1/

2
_
and D =
_
2 0
0 0
_
.
Writing y = P
t
x, the quadratic form becomes 2y
2
1
which is not positive denite.
11.3. Real Fourier Series
Let E denote the collection of all functions f : [, ] R which are piecewise continuous on the
interval [, ]. This means that any f E has at most a nite number of points of discontinuity, at
each of which f need not be dened but must have one sided limits which are nite. We further adopt
the convention that any two functions f, g E are considered equal, denoted by f = g, if f(x) = g(x)
for every x [, ] with at most a nite number of exceptions.
It is easy to check that E forms a real vector space. More precisely, let E denote the function
: [, ] R, where (x) = 0 for every x [, ]. Then the following conditions hold:
For every f, g E, we have f +g E.
For every f, g, h E, we have f + (g +h) = (f +g) +h.
For every f E, we have f + = +f = f.
For every f E, we have f + (f) = .
For every f, g E, we have f +g = g +f.
For every c R and f E, we have cf E.
For every c R and f, g E, we have c(f +g) = cf +cg.
For every a, b R and f E, we have (a +b)f = af +bf.
For every a, b R and f E, we have (ab)f = a(bf).
For every f E, we have 1f = f.
Chapter 11 : Applications of Real Inner Product Spaces page 6 of 12
Linear Algebra c _ W W L Chen, 1997, 2008
We now give this vector space E more structure by introducing an inner product. For every f, g E,
write
f, g) =
1

f(x)g(x) dx.
The integral exists since the function f(x)g(x) is clearly piecewise continuous on [, ]. It is easy to
check that the following conditions hold:
For every f, g E, we have f, g) = g, f).
For every f, g, h E, we have f, g +h) = f, g) +f, h).
For every f, g E and c R, we have cf, g) = cf, g).
For every f E, we have f, f) 0, and f, f) = 0 if and only if f = .
Hence E is a real inner product space.
The diculty here is that the inner product space E is not nite-dimensional. It is not straightforward
to show that the set
_
1

2
, sinx, cos x, sin2x, cos 2x, sin3x, cos 3x, . . .
_
(4)
in E forms an orthonormal basis for E. The diculty is to show that the set spans E.
Remark. It is easy to check that the elements in (4) form an orthonormal system. For every k, m N,
we have
_
1

2
,
1

2
_
=
1

1
2
dx = 1;
_
1

2
, sinkx
_
=
1

2
sinkx = 0;
_
1

2
, cos kx
_
=
1

2
cos kx = 0;
as well as
sinkx, sinmx) =
1

sinkxsinmxdx =
1

1
2
(cos(k m)x cos(k +m)x) dx =
_
1 if k = m,
0 if k ,= m;
cos kx, cos mx) =
1

cos kxcos mxdx =


1

1
2
(cos(k m)x + cos(k +m)x) dx =
_
1 if k = m,
0 if k ,= m;
and
sinkx, cos mx) =
1

sinkxcos mxdx =
1

1
2
(sin(k m)x + sin(k +m)x) dx = 0.
Let us assume that we have established that the set (4) forms an orthonormal basis for E. Then a
natural extension of Proposition 9H gives rise to the following: Every function f E can be written
uniquely in the form
a
0
2
+

n=1
(a
n
cos nx +b
n
sinnx), (5)
known usually as the (trigonometric) Fourier series of the function f, with Fourier coecients
a
0

2
=
_
f,
1

2
_
=
1

f(x) dx,
Chapter 11 : Applications of Real Inner Product Spaces page 7 of 12
Linear Algebra c _ W W L Chen, 1997, 2008
and, for every n N,
a
n
= f, cos nx) =
1

f(x) cos nxdx and b


n
= f, sinnx) =
1

f(x) sinnxdx.
Note that the constant term in the Fourier series (5) is given by
_
f,
1

2
_
1

2
=
a
0
2
.
Example 11.3.1. Consider the function f : [, ] R, given by f(x) = x for every x [, ]. For
every n N 0, we have
a
n
=
1

xcos nxdx = 0,
since the integrand is an odd function. On the other hand, for every n N, we have
b
n
=
1

xsinnxdx =
2

_

0
xsinnxdx,
since the integrand is an even function. On integrating by parts, we have
b
n
=
2

_
xcos nx
n
_

0
+
_

0
cos nx
n
dx
_
=
2

_
xcos nx
n
_

0
+
_
sinnx
n
2
_

0
_
=
2(1)
n+1
n
.
We therefore have the (trigonometric) Fourier series

n=1
2(1)
n+1
n
sinnx.
Note that the function f is odd, and this plays a crucial role in eschewing the Fourier coecients a
n
corresponding to the even part of the Fourier series.
Example 11.3.2. Consider the function f : [, ] R, given by f(x) = [x[ for every x [, ]. For
every n N 0, we have
a
n
=
1

[x[ cos nxdx =


2

_

0
xcos nxdx,
since the integrand is an even function. Clearly
a
0
=
2

_

0
xdx = .
Furthermore, for every n N, on integrating by parts, we have
a
n
=
2

__
xsinnx
n
_

_

0
sinnx
n
dx
_
=
2

__
xsinnx
n
_

0
+
_
cos nx
n
2
_

0
_
=
_

_
0 if n is even,

4
n
2
if n is odd.
On the other hand, for every n N, we have
b
n
=
1

[x[ sinnxdx = 0,
Chapter 11 : Applications of Real Inner Product Spaces page 8 of 12
Linear Algebra c _ W W L Chen, 1997, 2008
since the integrand is an odd function. We therefore have the (trigonometric) Fourier series

n=1
n odd
4
n
2
cos nx =

2

k=1
4
(2k 1)
2
cos(2k 1)x.
Note that the function f is even, and this plays a crucial role in eschewing the Fourier coecients b
n
corresponding to the odd part of the Fourier series.
Example 11.3.3. Consider the function f : [, ] R, given for every x [, ] by
f(x) = sgn(x) =
_
+1 if 0 < x ,
0 if x = 0,
1 if x < 0.
For every n N 0, we have
a
n
=
1

sgn(x) cos nxdx = 0,


since the integrand is an odd function. On the other hand, for every n N, we have
b
n
=
1

sgn(x) sinnxdx =
2

_

0
sinnxdx,
since the integrand is an even function. It is easy to see that
b
n
=
2

_
cos nx
n
_

0
=
_

_
0 if n is even,
4
n
if n is odd.
We therefore have the (trigonometric) Fourier series

n=1
n odd
4
n
sinnx =

k=1
4
(2k 1)
sin(2k 1)x.
Example 11.3.4. Consider the function f : [, ] R, given by f(x) = x
2
for every x [, ]. For
every n N 0, we have
a
n
=
1

x
2
cos nxdx =
2

_

0
x
2
cos nxdx,
since the integrand is an even function. Clearly
a
0
=
2

_

0
x
2
dx =
2
2
3
.
Furthermore, for every n N, on integrating by parts, we have
a
n
=
2

__
x
2
sinnx
n
_

_

0
2xsinnx
n
dx
_
=
2

__
x
2
sinnx
n
_

0
+
_
2xcos nx
n
2
_

_

0
2 cos nx
n
2
dx
_
=
2

__
x
2
sinnx
n
_

0
+
_
2xcos nx
n
2
_

_
2 sinnx
n
3
_

0
_
=
4(1)
n
n
2
.
Chapter 11 : Applications of Real Inner Product Spaces page 9 of 12
Linear Algebra c _ W W L Chen, 1997, 2008
On the other hand, for every n N, we have
b
n
=
1

x
2
sinnxdx = 0,
since the integrand is an odd function. We therefore have the (trigonometric) Fourier series

2
3
+

n=1
4(1)
n
n
2
cos nx.
Chapter 11 : Applications of Real Inner Product Spaces page 10 of 12
Linear Algebra c _ W W L Chen, 1997, 2008
Problems for Chapter 11
1. Consider the function f : [1, 1] R : x x
3
. We wish to nd a polynomial g(x) = ax +b which
minimizes the error
_
1
1
[f(x) g(x)[
2
dx.
Follow the steps below to nd this polynomial g:
a) Consider the real vector space C[1, 1]. Write down a suitable real inner product on C[1, 1] for
this problem, explaining carefully the steps that you take.
b) Consider now the subspace P
1
[1, 1] of all polynomials of degree at most 1. Describe the poly-
nomial g in terms of f and orthogonal projection with respect to the inner product in part (a).
Give a brief explanation for your choice.
c) Write down a basis of P
1
[1, 1].
d) Apply the Gram-Schmidt process to your basis in part (c) to obtain an orthogonal basis of
P
1
[1, 1].
e) Describe your polynomial in part (b) as a linear combination of the elements of your basis in part
(d), and nd the precise values of the coecients.
2. For each of the following functions, nd the best least squares approximation by linear polynomials
of the form ax +b, where a, b R:
a) f : [0, /2] R : x sinx b) f : [0, 1] R : x x
3
c) f : [0, 2] R : x e
x
3. Consider the quadratic form 2x
2
1
+x
2
2
+x
2
3
+ 2x
1
x
2
+ 2x
1
x
3
in three variables x
1
, x
2
, x
3
.
a) Write the quadratic form in the form x
t
Ax, where
x =
_
_
x
1
x
2
x
3
_
_
and where A is a symmetric matrix with real entries.
b) Apply the Orthogonal diagonalization process to the matrix A.
c) Find a transformation of the type x = Py, where P is an invertible matrix, so that the quadratic
form can be written as y
t
Dy, where
y =
_
_
y
1
y
2
y
3
_
_
and where D is a diagonal matrix with real entries. You should give the matrices P and D
explicitly.
d) Is the quadratic form positive denite? Justify your assertion both in terms of the eigenvalues of
A and in terms of your solution to part (c).
4. For each of the following quadratic forms in three variables, write it in the form x
t
Ax, nd a
substitution x = Py so that it can be written as a diagonal form in the variables y
1
, y
2
, y
3
, and
determine whether the quadratic form is positive denite:
a) x
2
1
+x
2
2
+ 2x
2
3
2x
1
x
2
+ 4x
1
x
3
+ 4x
2
x
3
b) 3x
2
1
+ 2x
2
2
+ 3x
2
3
+ 2x
1
x
3
c) 3x
2
1
+ 5x
2
2
+ 4x
2
3
+ 4x
1
x
3
4x
2
x
3
d) 5x
2
1
+ 2x
2
2
+ 5x
2
3
+ 4x
1
x
2
8x
1
x
3
4x
2
x
3
e) x
2
1
5x
2
2
x
2
3
+ 4x
1
x
2
+ 6x
2
x
3
Chapter 11 : Applications of Real Inner Product Spaces page 11 of 12
Linear Algebra c _ W W L Chen, 1997, 2008
5. Determine which of the following matrices are positive denite:
a)
_
_
0 1 1
1 0 1
1 1 0
_
_
b)
_
_
3 1 1
1 1 2
1 2 1
_
_
c)
_
_
6 1 7
1 1 2
7 2 9
_
_
d)
_
_
6 2 1
2 6 1
1 1 5
_
_
e)
_
_
3 2 4
2 6 2
4 2 3
_
_
f)
_
_
_
2 0 0 0
0 1 0 1
0 0 2 0
0 1 0 1
_
_
_
6. Find the trigonometric Fourier series for each of the following functions f : [, ] C:
a) f(x) = x[x[ for every x [, ]
b) f(x) = [ sinx[ for every x [, ]
c) f(x) = [ cos x[ for every x [, ]
d) f(x) = 0 for every x [, 0] and f(x) = x for every x (0, ]
e) f(x) = sinx for every x [, 0] and f(x) = cos x for every x (0, ]
f) f(x) = cos x for every x [, 0] and f(x) = sinx for every x (0, ]
g) f(x) = cos(x/2) for every x [, ]
h) f(x) = sin(x/2) for every x [, ]
Chapter 11 : Applications of Real Inner Product Spaces page 12 of 12

Potrebbero piacerti anche