[AR Chap 6]
251
vu
kvkkuk
with
066
(u v)
u
kuk2
252
253
2. hu, vi = hu, vi
3. hu + v, wi = hu, wi + hv, wi
4. a. hu, ui > 0
b. hu, ui = 0 u = 0
In words these axioms say that we require the inner product to:
1. be symmetric;
2. be linear with respect to scalar multiplication;
3. be linear with respect to addition;
4.
255
Example
Show that, in R2 , if u = (u1 , u2 ) and v = (v1 , v2 ) then
hu, vi = u1 v1 + 2u2 v2
defines an inner product.
256
More examples
1. Show that in R3 , hu, vi = u1 v1 u2 v2 + u3 v3 does not define an
inner product by showing that axiom 4a does not hold.
2. Show that in R2 ,
T
hu, vi = u
2 1 v1
2 1
v = u1 u2
1 1
1 1
v2
257
258
Another example
In the case of the vector space Pn of polynomials of degree less than or
equal to n, a possible choice of inner product is
Z 1
p(x)q(x) dx.
hp, qi =
0
260
hv, ui
kvkkuk
with
066
261
Note
In order for this definition of angle to make sense we need
1 6
hv, ui
61
kvkkuk
262
Example
h(u1 , u2 ), (v1 , v2 )i = u1 v1 + 2u2 v2 defines an inner product on R2
If u = (3, 1) and v = (2, 3), then
p
263
f (x)g (x)dx
a
264
Example
Consider C [0, 2] with the inner product hf , g i =
R 2
0
f (x)g (x)dx
The norms of the functions s(x) = sin(x) and c(x) = cos(x) are:
2
ksk = hs, si =
sin (x)dx =
2
0
1
(1 cos(2x))dx
2
2
1
x
=
sin(2x)
=
2 4
0
sin(x) cos(x)dx =
2
0
2
1
1
=0
sin(2x)dx = cos(2x)
2
4
0
266
Application
For two continuous functions f , g : [a, b] R, it follows directly from
the Cauchy-Schwarz inequality that
Z
f (x)g (x)dx
2
Z
f (x)dx
a
Z
g (x)dx
a
1 dx
2
which becomes
2
t 1
2
(t 1) 6
loge t
2
Z
x dx
or
Z
1
dx
x
loge t >
2(t 1)
, t > 1.
t+1
267
[AR 6.2]
Orthogonal sets
Recall that u and v are orthogonal if hu, vi = 0
268
Examples
1. {(1, 0, 0), (0, 1, 0), (0, 0, 1)} is orthogonal in R3 with the dot
product as inner product.
2. So is {(1, 1, 1), (1, 1, 0), (1, 1, 2)} using the dot product.
269
Proposition
Every orthogonal set of nonzero vectors is linearly independent
Proof:
270
Orthonormal sets
Definition
A set of vectors {v1 , . . . , vk } is called orthonormal if it is orthogonal
and each vector has length one. That is
(
0 i 6= j
{v1 , . . . , vk } is orthonormal
hvi , vj i =
1 i =j
Note
Any orthogonal set of non-zero vectors can be made orthonormal by
dividing each vector by its length.
Examples
1. In R3 with the dot product:
271
f (x)g (x)dx
0
2
is orthonormal.
272
Orthonormal bases
Bases that are orthonormal are particularly convenient to work with.
For example, we have the following
Lemma
If {v1 , . . . , vn } is an orthonormal basis for V and x V , then
x = hx, v1 iv1 + + hx, vn ivn
Proof: Exercise!
273
Orthogonal projection
[AR 6.2]
Definition
The orthogonal projection of v onto u is
p = hv, uiu
Note
p = kvk cos u
v p is orthogonal to u
Example
The orthogonal projection (using the dot product) of (2, 3) onto
1 (1, 1) is:
2
274
Definition
The orthogonal projection of v V onto the subspace W is:
projW (v) = hv, u1 iu1 + + hv, uk iuk
Properties of p = projW (v)
pW
Example
Let W = {(x, y , z) | x + y + z = 0} in V = R3 with the dot product.
The set
1
1
{u1 = (1, 1, 0), u2 = (1, 1, 2)}
2
6
is an orthonormal basis for W .
is orthogonal to W .
276
Gram-Schmidt procedure
Suppose {v1 , . . . , vk } is a basis for V .
1
kv1 k v1
1.
Let u1 =
2a.
w2 = v2 hv2 , u1 iu1
2b.
u2 =
3a.
1
kw2 k w2
3b.
..
.
ka.
u3 = kw13 k w3
..
.
wk = vk hvk , u1 iu1 hvk , uk1 iuk1
kb.
uk =
1
kwk k wk
277
Example
Find an orthonormal basis for the subspace W of R4 (with dot product)
spanned by
{(1, 1, 1, 1), (2, 4, 2, 4), (1, 5, 1, 3)}
Answer
1
1
1
{ (1, 1, 1, 1), (1, 1, 1, 1), (1, 1, 1, 1)}
2
2
2
Example
Find the point in W closest to v = (2, 2, 1, 3)
Answer
1
2 (3, 5, 3, 5)
278
279
(AR 6.4)
a+bx
i =1
n
X
(yi (a + bxi ))2
=
i =1
280
1 x1
1 x2
A = . .
.
.
. .
1 xn
a
u=
b
281
that is closest to y
The closest vector is precisely projW y
So to find u we could project y to W to get Au = projW y
and from this calculate u
282
for all w W
Summary
Given data points (x1 , y1 ), (x2 , y2 ),. . . , (xn , yn ), to find the straight line
y = a + bx of
best
fit,
a
we find u =
satisfying the normal equation
b
AT Au = AT y
()
1 x1
y1
1 x2
..
where y = . and A = .. ..
. .
yn
1 xn
284
Example
Find the straight line which best fits the data points
(1, 1), (1, 1), (2, 3)
Answer
Line of best fit is: y =
9
7
+ 47 x
285
Extension
The same method works for finding quadratic fitting curves.
To find the quadratic y = a + bx + cx 2 which best fits data (x1 , y1 ),
(x2 , y2 ),. . . , (xn , yn ) we take
1 x1 x12
y1
1 x2 x 2
2
..
A = . .
y=.
..
.. ..
.
yn
1 xn xn2
and solve
AT Au = AT y
for
a
u = b
c
286