{VERSION 3 0 "APPLE_PPC_MAC" "3.0" } {USTYLETAB {CSTYLE "Maple Input" -1 0 "Courier" 0 1 255 0 0 1 0 1 0 0 1 0 0 0 0 }{CSTYLE "2D Math" -1 2 "Times" 0 1 0 0 0 0 0 0 2 0 0 0 0 0 0 }{CSTYLE "2D Comment" 2 18 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 } {CSTYLE "" -1 256 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 257 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 258 "" 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 }{CSTYLE "" -1 259 "" 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 } {CSTYLE "" -1 260 "" 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 }{CSTYLE "" -1 261 "" 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 }{CSTYLE "" -1 262 "" 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 }{CSTYLE "" -1 263 "" 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 } {CSTYLE "" -1 264 "" 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 }{CSTYLE "" -1 265 "" 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 }{CSTYLE "" -1 266 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 267 "" 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 } {CSTYLE "" -1 268 "" 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 }{CSTYLE "" -1 269 "" 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 }{CSTYLE "" -1 270 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 271 "" 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 } {CSTYLE "" -1 272 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 273 "" 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 }{PSTYLE "Normal" -1 0 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "Heading 1" 0 3 1 {CSTYLE "" -1 -1 "" 1 18 0 0 0 0 0 1 0 0 0 0 0 0 0 }1 0 0 0 6 6 0 0 0 0 0 0 -1 0 }{PSTYLE "Heading 2" 3 4 1 {CSTYLE "" -1 -1 "" 1 14 0 0 0 0 0 0 0 0 0 0 0 0 0 }0 0 0 -1 4 4 0 0 0 0 0 0 -1 0 }{PSTYLE "Title" 0 18 1 {CSTYLE "" -1 -1 "" 1 18 0 0 0 0 0 1 1 0 0 0 0 0 0 }3 0 0 -1 12 12 0 0 0 0 0 0 19 0 }{PSTYLE "" 4 256 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 }3 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "" 4 257 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 }3 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }} {SECT 0 {PARA 18 "" 0 "" {TEXT -1 37 "Linear Methods of Applied Mathem atics" }}{PARA 256 "" 0 "" {TEXT -1 25 "The Geometry of Functions" }} {PARA 257 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }} {SECT 0 {PARA 3 "" 0 "" {TEXT -1 85 "Copyright 1998, 2000 by Evans M. \+ Harrell II and James V. Herod. All rights reserved." }}}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 9 "Norms in " }{XPPEDIT 18 0 "R^n;" "6#)%\"RG %\"nG" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "" 0 "" {TEXT -1 24 "There are many norms in " }{XPPEDIT 18 0 "R^n;" "6#)%\"RG %\"nG" }{TEXT -1 32 ". We illustrate four of them in " }{XPPEDIT 18 0 "R^3;" "6#*$%\"RG\"\"$" }{TEXT -1 123 ". We find the norms of the vect or [1, 2, 3]. The one norm is defined to be the sum of the absolute va lue of the components." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 52 "v :=[1,2,3];\none_norm:=abs(v[1])+abs(v[2])+abs(v[3]);" }}}{PARA 0 "" 0 "" {TEXT -1 36 "Maple has other norms preprogrammed." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "with(linalg):" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 16 "norm([1,2,3],2);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 16 "norm([1,2,3],3);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 23 "norm([1,2,3],infinity);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{PARA 0 "" 0 "" {TEXT -1 65 "Note that an undesig nated norm for a vector is the infinity norm." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "v:=[a,b,c];\nnorm(v);" }}}{PARA 0 "" 0 "" {TEXT 259 11 "Assignment:" }{TEXT -1 65 " find the one, two, and infinity no rm for the vector [-1, 2, -3]." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 102 "There ar e many norms in C([0,1]). We illustrate three of them. We find the nor ms for the function sin(" }{XPPEDIT 18 0 "pi;" "6#%#piG" }{TEXT -1 62 " x). We compute the one, two, and infinite norms respectively." }} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 54 "Int(abs(sin(Pi*x)),x=0..1)=i nt(abs(sin(Pi*x)),x=0..1);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 48 "Int(sin(Pi*x)^2,x=0..1)=int(sin(Pi*x)^2,x=0..1);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 33 "maximize(sin(Pi*x),\{x\},\{x=0..1\});" }} }{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT 260 11 "Assignment:" }{TEXT -1 55 " Fi nd the 1, 2, and infinity norm for the function sin(" }{XPPEDIT 18 0 " Pi;" "6#%#PiG" }{TEXT -1 28 " x) on the interval [-1, 1]." }}{PARA 0 " " 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 86 "Distance is define d in terms of the norm. We find the distance between two vectors in " }{XPPEDIT 18 0 "R^3;" "6#*$%\"RG\"\"$" }{TEXT -1 54 " and between the \+ functions sin(x) and cos(x) in C([0, " }{XPPEDIT 18 0 "pi;" "6#%#piG" }{TEXT -1 4 " ])." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 48 "u:=[1,2,3];\nv:=[-4,5,-6];\ndistance:=norm(u- v,2);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 31 "int((sin(x)-cos(x) )^2,x=0..Pi);" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT 261 11 "Assignment:" }{TEXT -1 55 " Find the distance from the f unction x to the function " }{XPPEDIT 18 0 "x^2;" "6#*$%\"xG\"\"#" } {TEXT -1 36 " in C([-1, 1]) using the usual norm." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 266 "The usual dot product of vectors is programmed in Maple. The usual dot product of functions ca n be computed. We illustrate by computing the usual dotproduct of vect ors u and v from above. We also compute the usual dotproduct of the fu nction sin(x) with the function " }{XPPEDIT 18 0 "x^2;" "6#*$%\"xG\"\" #" }{TEXT -1 10 " in C([0, " }{XPPEDIT 18 0 "pi;" "6#%#piG" }{TEXT -1 3 "])." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "dotprod(u,v);" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 24 "int(x^2*sin(x),x=0..Pi);" }} }{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }{TEXT -1 0 "" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT 262 11 "Assignment:" } {TEXT -1 46 " Find the dot product of x with sin(x) in C([-" } {XPPEDIT 18 0 "pi;" "6#%#piG" }{TEXT -1 3 " , " }{XPPEDIT 18 0 "pi;" " 6#%#piG" }{TEXT -1 4 " ])." }}}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 38 "Pr ojections of vectors and functions I" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 91 "Let us begin by defining the projection of the vector v onto th e direction of the vector w." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "with(linalg):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 41 "proj :=(v,w)->dotprod(v,w)/dotprod(w,w)*w;" }}}{PARA 0 "" 0 "" {TEXT -1 115 " We illustrate by taking three vectors: u, v, and w. The vect ors v and w will be orthogonal. We will note that " }}{PARA 0 "" 0 "" {TEXT -1 55 " proj(u,v) + proj(u,w) = u." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 30 "u:=[3,2]; v:=[1,1]; w:=[1, -1];" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 32 "a:=proj(u,v); b:=pr oj(u,w);\na+b;" }}}{PARA 0 "" 0 "" {TEXT -1 200 " As a second illu stration, we assume that a plane is specified by two orthogonal vector s u and v. We define the projection onto the plane as the sum of the p rojections onto the orthogonal vectors." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 42 "projp:=(v,P)->proj(v,P[1]) + proj(v,P[2]);" }}}{PARA 0 "" 0 "" {TEXT -1 114 "For example, take the plane defined by [1,1,1] and [1,-1,0]. We compute the projection of [3,4,5] onto this plane." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 23 "P1:=[[1,1,1],[1,-1,0]];" } }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 18 "projp([3,4,5],P1);" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "P1[1];P1[2];" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 217 " In Model Probl em II.8, we consider the plane spanned by [1,1,1] and [1,2,3] and seek to find the vector closest to [3,4,5] and the vector closest to [1,-1 ,0]. Since [1,1,1] and [1,2,3] we not orthogonal, we take " }{XPPEDIT 18 0 "v[1]" "6#&%\"vG6#\"\"\"" }{TEXT -1 40 " to be [1,1,1] and find a second vector " }{XPPEDIT 18 0 "v[2]" "6#&%\"vG6#\"\"#" }{TEXT -1 33 " in the plane, but orthogonal to " }{XPPEDIT 18 0 "v[1]" "6#&%\"vG6# \"\"\"" }{TEXT -1 52 ". Such a vector will satisfy these two requireme nts:" }}{PARA 0 "" 0 "" {TEXT -1 53 " \+ " }{XPPEDIT 18 0 "v[2] = alpha*v[1]+[1,2,3]" "6#/& %\"vG6#\"\"#,&*&%&alphaG\"\"\"&F%6#\"\"\"F+F+7%\"\"\"\"\"#\"\"$F+" }} {PARA 0 "" 0 "" {TEXT -1 50 "and \+ " }{XPPEDIT 18 0 "v[2]" "6#&%\"vG6#\"\"#" }{TEXT -1 21 " is p erpendicular to " }{XPPEDIT 18 0 "v[1]" "6#&%\"vG6#\"\"\"" }{TEXT -1 2 ". " }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "v1:=[1,1,1];" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 49 "sol:=solve(dotprod([1,2,3]+a lpha*v1,v1)=0,alpha);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 25 "v2 :=eval([1,2,3]+sol*v1);" }}}{PARA 0 "" 0 "" {TEXT -1 19 " The ve ctors " }{XPPEDIT 18 0 "v[1]" "6#&%\"vG6#\"\"\"" }{TEXT -1 5 " and " } {XPPEDIT 18 0 "v[2]" "6#&%\"vG6#\"\"#" }{TEXT -1 68 " are orthogonal v ectors that span the same plane as that spanned by " }{XPPEDIT 18 0 "v [1]" "6#&%\"vG6#\"\"\"" }{TEXT -1 90 " and [1,2,3]. Thus, we can compu te the projection of [3,4,5] and [1,-1,0] onto this plane." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 48 "projp([3,4,5],[v1,v2]);\nprojp([1,- 1,0],[v1,v2]);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}} {PARA 0 "" 0 "" {TEXT -1 161 " Two remarks should be made:\n(1) Th e implication of having the projection of [3,4,5] onto the plane being [3,4,5] is that [3,4,5] is a linear combination of " }{XPPEDIT 18 0 " v[1]" "6#&%\"vG6#\"\"\"" }{TEXT -1 5 " and " }{XPPEDIT 18 0 "v[2]" "6# &%\"vG6#\"\"#" }{TEXT -1 23 ". In fact, we compute:\n" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 85 "dotprod([3,4,5],v1)/dotprod(v1,v1)*v1\n \+ + dotprod([3,4,5],v2)/dotprod(v2,v2)*v2;" }}}{PARA 0 "" 0 "" {TEXT -1 163 "(2) While [1,-1,0] is not in this plane, the projection \+ of [1,-1,0] is. Thus, we expect that if we do the projection twice, we get the same thing as doing it once." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 59 "once:=projp([1,-1,0],[v1,v2]);\ntwice:=projp(once,[v1 ,v2]);\n" }}}{PARA 0 "" 0 "" {TEXT -1 76 " This is the commonly a ccepted definition of an abstract projection: a " }{TEXT 256 10 "proje ction" }{TEXT -1 44 " is any function P having the property that " } {XPPEDIT 18 0 "P^(2) = P" "6#/*$%\"PG\"\"#F%" }{TEXT -1 1 "." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 111 " We repeat thes e processes in the context of a function space. First we define and il lustrate a projection." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 64 "pr ojf:=(f,g,a,b)->g(x)*int(f(t)*g(t),t=a..b)/int(g(t)^2,t=a..b);" }}} {PARA 0 "" 0 "" {TEXT -1 17 "For illustration:" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 24 "f:=x->x;\ng:=x->sin(3*x);" }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 33 "projf(f,g,0,Pi);\nprojf(g,g,0,Pi);" }}}{PARA 0 "" 0 "" {TEXT -1 4 " " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 173 " Model Problem II.9. Consider the set of fun ction on the interval [0,¹]. We wish to find the function in the span of 1, sin(2 x) and sin(3 x) that is closest to f(x) = " }{XPPEDIT 18 0 "x^2" "6#*$%\"xG\"\"#" }{TEXT -1 41 ". That is, we find a function i n the form" }}{PARA 0 "" 0 "" {TEXT -1 64 " \+ a + b sin(2 x) + c sin(3 x)" }}{PARA 0 "" 0 "" {TEXT -1 20 " which is closest to " }{XPPEDIT 18 0 "x^2" "6#*$%\"xG\"\"#" }{TEXT -1 16 " in the sense of" }{TEXT 257 17 " root-mean-square" }{TEXT -1 2 ". " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT 258 8 "Solu tion" }{TEXT -1 212 ": Note that the three functions are not orthogon al. The function sin(2 x) is orthogonal to the other two but 1 and sin (3 x) are not orthogonal. Thus, we replace sin(3 x) by subtracting off its projection onto 1." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 48 "o ne:=x->1;\nsin2:=x->sin(2*x);\nsin3:=x->sin(3*x);" }}}{EXCHG {PARA 0 " > " 0 "" {MPLTEXT 1 0 43 "f3:=x->sin3(x)-projf(sin3,one,0,Pi);\nf3(x); " }}}{PARA 0 "" 0 "" {TEXT -1 92 " We can now define the best appr oximation for a function f with the span of these three." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 91 "bestapprox:=f->projf(f,one,0,Pi) + \+ projf(f,sin2,0,Pi) + \n projf(f,sin3,0,Pi);" }}}{PARA 0 "" 0 "" {TEXT -1 42 " We compute the best approximation to " } {XPPEDIT 18 0 "x^2" "6#*$%\"xG\"\"#" }{TEXT -1 22 " and sketch the gra ph." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 28 "f:=x->x^2;\nH:=bestap prox(f);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 22 "plot([x^2,H],x= 0..Pi);" }}}}{PARA 0 "" 0 "" {TEXT -1 5 " " }}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 19 "Orthogonal families" }}{PARA 0 "" 0 "" {TEXT -1 108 "In one of our examples we stated that the family \{sin(n x), n = 1, 2 , 3...\} is an orthogonal family in C([0," }{XPPEDIT 18 0 "pi;" "6#%#p iG" }{TEXT -1 57 " ]). We establish this here. It is necessary to show that" }}{PARA 0 "" 0 "" {TEXT -1 13 " " }{XPPEDIT 18 0 "i nt(sin(n*x)*sin(m*x),x = 0 .. Pi);" "6#-%$intG6$*&-%$sinG6#*&%\"nG\"\" \"%\"xGF,F,-F(6#*&%\"mGF,F-F,F,/F-;\"\"!%#PiG" }{TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 38 "is zero for integers n and m, n not m." }} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "restart:" }}}{EXCHG {PARA 0 " > " 0 "" {MPLTEXT 1 0 37 "assume(n,integer);\nassume(m,integer);" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 31 "int(sin(n*x)*sin(m*x),x=0..P i);" }}}{PARA 0 "" 0 "" {TEXT -1 54 "You might be interested to know w hat happens if n = m." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 31 "int (sin(n*x)*sin(n*x),x=0..Pi);" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }} {PARA 0 "" 0 "" {TEXT 263 11 "Assignment:" }{TEXT -1 72 " Show that \{ cos(n x), n = 0,1, 2, 3...\} is an orthogonal family in C([0," } {XPPEDIT 18 0 "pi;" "6#%#piG" }{TEXT -1 4 " ])." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 114 "We stated that the collection \{sin(n x), cos(m x), n and m po sitive integers\} is not an orthogonal family in C([0," }{XPPEDIT 18 0 "pi;" "6#%#piG" }{TEXT -1 50 " ]). To see this we made the following evaluation:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 58 "Int(sin(x)*cos(2*x),x=0..Pi)=int(sin(x)*cos(2*x),x =0..Pi);" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT 265 11 "Assignment:" }{TEXT -1 49 " Integrate sin(2x) and cos(x) on th e interval [0," }{XPPEDIT 18 0 "pi;" "6#%#piG" }{TEXT -1 24 " ] and on the interval [" }{XPPEDIT 18 0 "-pi;" "6#,$%#piG!\"\"" }{TEXT -1 2 ", " }{XPPEDIT 18 0 "pi;" "6#%#piG" }{TEXT -1 3 " ]." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 44 "If we take a function f o n the interval [0, " }{XPPEDIT 18 0 "pi;" "6#%#piG" }{TEXT -1 287 " ] \+ and try to use the collection of sine terms, but only a finite number \+ of them, we may get only an approximation for f. We illustrate this by drawing a graph of an f in black, two terms of sines in red, and six \+ terms of sine in blue. The graphs show that this is only an approximat ion." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 23 "f:=t->Pi/2-abs(t-Pi/2);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 332 "a1:=int(f(t)*sin(t),t=0..Pi)/int(sin(t)^2,t=0..Pi); \+ \na2:=int(f(t)*sin(2*t),t=0..Pi)/int(sin(2*t)^2,t=0..Pi);\na3:=int(f(t )*sin(3*t),t=0..Pi)/int(sin(3*t)^2,t=0..Pi);\na4:=int(f(t)*sin(4*t),t= 0..Pi)/int(sin(4*t)^2,t=0..Pi);\na5:=int(f(t)*sin(5*t),t=0..Pi)/int(si n(5*t)^2,t=0..Pi);\na6:=int(f(t)*sin(6*t),t=0..Pi)/int(sin(6*t)^2,t=0. .Pi);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 142 "plot([f(t),a1*sin (t)+a2*sin(2*t),\n a1*sin(t)+a2*sin(2*t)+a3*sin(3*t)+a4*sin(4*t)+a5*s in(5*t)+a6*sin(6*t)],\n t=0..Pi,color=[black,red,blue]);" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 24 "Assignment: Appro ximate " }{XPPEDIT 18 0 "x^2-Pi*x;" "6#,&*$%\"xG\"\"#\"\"\"*&%#PiGF'F% F'!\"\"" }{TEXT -1 60 " with two and with six terms. Here's how to ty pe in this f." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 15 "f:=t->t^2-P i*t;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{PARA 0 "" 0 " " {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 80 "I presented an inequality that is at the foundation of th is course. Suppose the " }{XPPEDIT 18 0 "phi[p];" "6#&%$phiG6#%\"pG" } {TEXT -1 52 " 's are orthogonal and have norm 1. Then, for any f," }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 10 " 0 ² " }{XPPEDIT 18 0 "abs(f-sum(a[p]*phi[p],p))^2" "6#*$-%$absG6#,&%\"fG \"\"\"-%$sumG6$*&&%\"aG6#%\"pGF)&%$phiG6#F1F)F1!\"\"\"\"#" }{TEXT -1 3 " = " }{XPPEDIT 18 0 "abs(f)^2" "6#*$-%$absG6#%\"fG\"\"#" }{TEXT -1 3 " + " }{XPPEDIT 18 0 "sum(abs(anglebracket(f,phi[p])-a[p])^2,p);" "6 #-%$sumG6$*$-%$absG6#,&-%-anglebracketG6$%\"fG&%$phiG6#%\"pG\"\"\"&%\" aG6#F2!\"\"\"\"#F2" }{TEXT -1 4 " - " }{XPPEDIT 18 0 "sum(abs(anglebr acket(f,phi[p]))^2,p);" "6#-%$sumG6$*$-%$absG6#-%-anglebracketG6$%\"fG &%$phiG6#%\"pG\"\"#F1" }{TEXT -1 1 "." }}{PARA 0 "" 0 "" {TEXT -1 0 " " }}{PARA 0 "" 0 "" {TEXT -1 172 "To see this, simply expand the middl e term of the right side, cancel part with the last sum, and compare w hat is left with the expanded right side. Here is the arithmetic: " }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 1 " " } {XPPEDIT 18 0 "abs(f-Sum(a[p]*phi[p],p = 1 .. n)^2);" "6#-%$absG6#,&% \"fG\"\"\"*$-%$SumG6$*&&%\"aG6#%\"pGF(&%$phiG6#F1F(/F1;\"\"\"%\"nG\"\" #!\"\"" }{TEXT -1 3 " = " }{XPPEDIT 18 0 "abs(f)^2;" "6#*$-%$absG6#%\" fG\"\"#" }{TEXT -1 2 "- " }{XPPEDIT 18 0 "2*sum(a[p]*anglebracket(f,ph i[p]),p = 1 .. n);" "6#*&\"\"#\"\"\"-%$sumG6$*&&%\"aG6#%\"pGF%-%-angle bracketG6$%\"fG&%$phiG6#F-F%/F-;\"\"\"%\"nGF%" }{TEXT -1 3 " + " } {XPPEDIT 18 0 "sum(a[p],p = 1 .. n)^2;" "6#*$-%$sumG6$&%\"aG6#%\"pG/F* ;\"\"\"%\"nG\"\"#" }{TEXT -1 1 " " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }} {PARA 0 "" 0 "" {TEXT -1 7 " = " }{XPPEDIT 18 0 "abs(f)^2;" "6#*$- %$absG6#%\"fG\"\"#" }{TEXT -1 3 " + " }{XPPEDIT 18 0 "sum(anglebracket (f,phi[p])-a[p])^2;" "6#*$-%$sumG6#,&-%-anglebracketG6$%\"fG&%$phiG6#% \"pG\"\"\"&%\"aG6#F/!\"\"\"\"#" }{TEXT -1 3 " - " }{XPPEDIT 18 0 "sum( anglebracket(f,phi[p]),p = 1 .. n)^2;" "6#*$-%$sumG6$-%-anglebracketG6 $%\"fG&%$phiG6#%\"pG/F.;\"\"\"%\"nG\"\"#" }{TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 8 "If the " }{XPPEDIT 18 0 "phi[p];" "6#&%$phiG6#%\"pG" }{TEXT -1 17 " 's are not ortho" } {TEXT 264 6 "normal" }{TEXT -1 35 ", then the FOURIER COEFFICIENTS are " }}{PARA 0 "" 0 "" {TEXT -1 36 " \+ " }{XPPEDIT 18 0 "a[p];" "6#&%\"aG6#%\"pG" }{TEXT -1 3 " = " } {XPPEDIT 18 0 "anglebracket(f,phi[p])/(abs(phi[p])^2);" "6#*&-%-angleb racketG6$%\"fG&%$phiG6#%\"pG\"\"\"*$-%$absG6#&F)6#F+\"\"#!\"\"" } {TEXT -1 3 " . " }}{PARA 0 "" 0 "" {TEXT -1 180 "Review the approximat ion calculations above to see that these are the ones calculated. In t hat case, the dotproduct was defined by the integral. More about this \+ in the next module." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}} {SECT 1 {PARA 3 "" 0 "" {TEXT -1 24 "The Gram-Schmidt process" }} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "" 0 "" {TEXT -1 62 "In the text we have started with linearly independent vectors " } {XPPEDIT 18 0 "v[1],v[2],v[3];" "6%&%\"vG6#\"\"\"&F$6#\"\"#&F$6#\"\"$ " }{TEXT -1 26 ", ... and created an ortho" }{TEXT 269 6 "normal" } {TEXT -1 94 " family. The orthonormal family spans the same set that t he linearly independent vectors did. " }}{PARA 0 "" 0 "" {TEXT -1 171 " Here is a Modified Gramm Schmidt Process. We generate an orthogon al family, not necessarily an orthonormal family. We begin with the sa me linearly independent vectors." }}{PARA 0 "" 0 "" {TEXT -1 3 " " } {XPPEDIT 18 0 "theta[1];" "6#&%&thetaG6#\"\"\"" }{TEXT -1 3 " = " } {XPPEDIT 18 0 "v[1];" "6#&%\"vG6#\"\"\"" }{TEXT -1 1 "." }}{PARA 0 "" 0 "" {TEXT -1 3 " " }{XPPEDIT 18 0 "theta[2];" "6#&%&thetaG6#\"\"#" }{TEXT -1 3 " = " }{XPPEDIT 18 0 "v[2]-anglebracket(v[2],theta[1])*the ta[1]/anglebracket(theta[1],theta[1]);" "6#,&&%\"vG6#\"\"#\"\"\"*(-%-a nglebracketG6$&F%6#\"\"#&%&thetaG6#\"\"\"F(&F16#\"\"\"F(-F+6$&F16#\"\" \"&F16#\"\"\"!\"\"F?" }{TEXT -1 2 " ," }}{PARA 0 "" 0 "" {TEXT -1 3 " \+ " }{XPPEDIT 18 0 "theta[3];" "6#&%&thetaG6#\"\"$" }{TEXT -1 3 " = " }{XPPEDIT 18 0 "v[3]-anglebracket(v[3],theta[1])*theta[1]/anglebracket (theta[1],theta[1])-anglebracket(v[3],theta[2])*theta[2]/anglebracket( theta[2],theta[2]);" "6#,(&%\"vG6#\"\"$\"\"\"*(-%-anglebracketG6$&F%6# \"\"$&%&thetaG6#\"\"\"F(&F16#\"\"\"F(-F+6$&F16#\"\"\"&F16#\"\"\"!\"\"F ?*(-F+6$&F%6#\"\"$&F16#\"\"#F(&F16#\"\"#F(-F+6$&F16#\"\"#&F16#\"\"#F?F ?" }{TEXT -1 2 " ," }}{PARA 0 "" 0 "" {TEXT -1 7 " etc." }}{PARA 0 " " 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT 268 11 "Assignment:" } {TEXT -1 12 " Argue that " }{XPPEDIT 18 0 "anglebracket(theta[2],theta [1]) = 0;" "6#/-%-anglebracketG6$&%&thetaG6#\"\"#&F(6#\"\"\"\"\"!" } {TEXT -1 17 " , and that both " }{XPPEDIT 18 0 "anglebracket(theta[3], theta[1]) = 0;" "6#/-%-anglebracketG6$&%&thetaG6#\"\"$&F(6#\"\"\"\"\"! " }{TEXT -1 5 " and " }{XPPEDIT 18 0 "anglebracket(theta[3],theta[2]) \+ = 0;" "6#/-%-anglebracketG6$&%&thetaG6#\"\"$&F(6#\"\"#\"\"!" }{TEXT -1 2 " ." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 29 "A Finite Dimensional example." }}{PARA 0 "" 0 "" {TEXT -1 75 " We create Maple code to perform the Modified Gramm Schmidt Process on " }{XPPEDIT 18 0 "v[1];" "6#&%\"vG6#\"\"\"" }{TEXT -1 17 " = [1, 1, 1] and " }{XPPEDIT 18 0 "v[2];" "6#&%\"vG6#\"\"#" }{TEXT -1 14 " = [1, 0, 1]. " }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "with(l inalg):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 29 "v[1]:=[1,1,1];\n v[2]:=[1,0,1];" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 15 "theta[1]: =v[1];" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 74 "theta[2]:=v[2]-do tprod(v[2],theta[1])/dotprod(theta[1],theta[1])*theta[1];" }}}{PARA 0 "" 0 "" {TEXT -1 23 "It is easy to see that " }{XPPEDIT 18 0 "theta[1] ;" "6#&%&thetaG6#\"\"\"" }{TEXT -1 5 " and " }{XPPEDIT 18 0 "theta[2]; " "6#&%&thetaG6#\"\"#" }{TEXT -1 64 " do not have norm 1. Is it easy t o see that they are orthogonal?" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 27 "dotprod(theta[1],theta[2]);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 57 " We find the closest point in the plane generated by \+ " }{XPPEDIT 18 0 "v[1];" "6#&%\"vG6#\"\"\"" }{TEXT -1 5 " and " } {XPPEDIT 18 0 "v[2];" "6#&%\"vG6#\"\"#" }{TEXT -1 56 " to the point [0 , 1, 1]. This comes in three easy steps." }}{PARA 0 "" 0 "" {TEXT -1 45 "STEP 1: Perform the Gramm Schmidt Process on " }{XPPEDIT 18 0 "v[1 ];" "6#&%\"vG6#\"\"\"" }{TEXT -1 5 " and " }{XPPEDIT 18 0 "v[2];" "6#& %\"vG6#\"\"#" }{TEXT -1 2 " ." }}{PARA 0 "" 0 "" {TEXT -1 26 "We did t hat above. We got:" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 19 "theta[ 1];\ntheta[2];" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 66 "STEP 2: U se the Fourier Inequality to compute the coefficients of " }{XPPEDIT 18 0 "theta[1];" "6#&%&thetaG6#\"\"\"" }{TEXT -1 5 " and " }{XPPEDIT 18 0 "theta[2];" "6#&%&thetaG6#\"\"#" }{TEXT -1 2 " ." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 119 "a[1]:=dotprod([0,1,1],theta[1])/dotprod( theta[1],theta[1]);\na[2]:=dotprod([0,1,1],theta[2])/dotprod(theta[2], theta[2]);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{PARA 0 " " 0 "" {TEXT -1 30 "STEP 3: Write down the answer." }}{EXCHG {PARA 0 " > " 0 "" {MPLTEXT 1 0 37 "closest:=a[1]*theta[1]+a[2]*theta[2];" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 16 "It's Really True" }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 207 " How could I convince you that this answer is correct? Draw a picture, you say. Pictures can lie! Let me show you that this is the closest point an analytic way. First agree that the plane determined by " } {XPPEDIT 18 0 "v[1];" "6#&%\"vG6#\"\"\"" }{TEXT -1 5 " and " } {XPPEDIT 18 0 "v[2];" "6#&%\"vG6#\"\"#" }{TEXT -1 22 " cosists of all \+ points" }}{PARA 0 "" 0 "" {TEXT -1 19 " s " }{XPPEDIT 18 0 "v[1];" "6#&%\"vG6#\"\"\"" }{TEXT -1 5 " + t " }{XPPEDIT 18 0 "v[ 2];" "6#&%\"vG6#\"\"#" }{TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 107 " where s and t range over all real numbers. The distance of any point i n this plane to [0, 1, 1] is given by" }}{PARA 0 "" 0 "" {TEXT -1 14 " | s " }{XPPEDIT 18 0 "v[1];" "6#&%\"vG6#\"\"\"" }{TEXT -1 5 " + t " }{XPPEDIT 18 0 "v[2];" "6#&%\"vG6#\"\"#" }{TEXT -1 19 " - [0, \+ 1, 1] | = " }{XPPEDIT 18 0 "sqrt((s+t-0)^2+(s-1)^2+(s+t-1)^2);" "6#- %%sqrtG6#,(*$,(%\"sG\"\"\"%\"tGF*\"\"!!\"\"\"\"#F**$,&F)F*\"\"\"F-\"\" #F**$,(F)F*F+F*\"\"\"F-\"\"#F*" }{TEXT -1 0 "" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 30 "norm(s*v[1]+t*v[2]-[0,1,1],2);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }} {PARA 0 "" 0 "" {TEXT -1 72 "The square of the norm is a function of t wo variables which we can plot." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 36 "d:=(s,t)->(s+t)^2+(s-1)^2+(s+t-1)^2;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 43 "plot3d(d(s,t),s=-1..2,t=-1..2,axes=NORMAL);" }}} {PARA 0 "" 0 "" {TEXT -1 150 "This is a parabolic curve. To find the m inimum value, take the derivative with respect to s and with respect t o t, set these equal to zero, and solve." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 49 "solve(\{diff(d(s,t),s)=0,diff(d(s,t),t)=0\},\{s,t\}); " }}}{PARA 0 "" 0 "" {TEXT -1 59 "We get a value for s and a value for t. Assign these value." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 10 "a ssign(%);" }}}{PARA 0 "" 0 "" {TEXT -1 8 "Compute " }{XPPEDIT 18 0 "s* v[1]+t*v[2];" "6#,&*&%\"sG\"\"\"&%\"vG6#\"\"\"F&F&*&%\"tGF&&F(6#\"\"#F &F&" }{TEXT -1 88 ". If we get the same value we had for closest, we'v e got the correct value --- two ways!" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "s*v[1]+t*v[2];" }}}{PARA 0 "" 0 "" {TEXT -1 177 "You \+ ask, why not do the problem this geometric way everytime? Why have all this Fourier stuff? Look at the next example where all notions of pla nes and three dimensions is lost." }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 23 "An Example in C([-1,1])" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "restart:" }}}{PARA 0 "" 0 "" {TEXT -1 71 " We perform the Mod ified Gramm Schmidt Process on the functions 1, " }{XPPEDIT 18 0 "x;" "6#%\"xG" }{TEXT -1 2 ", " }{XPPEDIT 18 0 "x^2;" "6#*$%\"xG\"\"#" } {TEXT -1 2 ", " }{XPPEDIT 18 0 "x^3;" "6#*$%\"xG\"\"$" }{TEXT -1 46 " \+ in C([-1,1]). First, we define the functions " }{XPPEDIT 18 0 "v[1];" "6#&%\"vG6#\"\"\"" }{TEXT -1 9 " through " }{XPPEDIT 18 0 "v[4];" "6#& %\"vG6#\"\"%" }{TEXT -1 28 ", Since we form the quotient" }}{PARA 0 " " 0 "" {TEXT -1 15 " " }{XPPEDIT 18 0 "anglebracket(f,g) *g/anglebracket(g,g);" "6#*(-%-anglebracketG6$%\"fG%\"gG\"\"\"F(F)-F%6 $F(F(!\"\"" }{TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 197 "so many tim e, why not make that a special function of f and g. In this case, the \+ dot product in an integral from -1 to 1. Thus, for convenience, we def ine a function of f and g that we will call P." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 58 "P:=(f,g)->g(x)*int(f(t)*g(t),t=-1..1)/int(g(t)^2 ,t=-1..1);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 51 "v[1]:=x->1;\n v[2]:=x->x;\nv[3]:=x->x^2;\nv[4]:=x->x^3;" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 15 "theta[1]:=v[1];" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 91 "form:=v[2](x)-P(v[2],theta[1])/P(theta[1],theta[1])*t heta[1](x);\ntheta[2]:=unapply(form,x);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 155 "form:=v[3](x)-P(v[3],theta[1])/P(theta[1],theta[1])* theta[1](x)\n -P(v[3],theta[2])/P(theta[2],theta[2])*theta [2](x);\ntheta[3]:=unapply(form,x);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 219 "form:=v[4](x)-P(v[4],theta[1])/P(theta[1],theta[1])* theta[1](x)\n -P(v[4],theta[2])/P(theta[2],theta[2])*theta [2](x)\n -P(v[4],theta[3])/P(theta[3],theta[3])*theta[3](x );\ntheta[4]:=unapply(form,x);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 132 " We find the \"best approximation\" in C([-1, 1]) to the abso lute value function with a polynomial of degree three. We follow the \+ " }{TEXT 266 4 "same" }{TEXT -1 21 " four steps as above." }}{PARA 0 " " 0 "" {TEXT -1 55 "STEP 1: Perform a Modified Gramm Schmidt Process o n 1, " }{XPPEDIT 18 0 "x;" "6#%\"xG" }{TEXT -1 2 ", " }{XPPEDIT 18 0 " x^2;" "6#*$%\"xG\"\"#" }{TEXT -1 2 ", " }{XPPEDIT 18 0 "x^3;" "6#*$%\" xG\"\"$" }{TEXT -1 2 " ." }}{PARA 0 "" 0 "" {TEXT -1 25 "We did that a bove. We got" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 51 "theta[1](x); \ntheta[2](x);\ntheta[3](x);\ntheta[4](x);" }}}{PARA 0 "" 0 "" {TEXT -1 38 "STEP 2: Form the Fourier coefficients." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 263 "a[1]:=int(abs(t)*theta[1](t),t=-1..1)/int(theta [1](t)^2,t=-1..1);\na[2]:=int(abs(t)*theta[2](t),t=-1..1)/int(theta[2] (t)^2,t=-1..1);\na[3]:=int(abs(t)*theta[3](t),t=-1..1)/int(theta[3](t) ^2,t=-1..1);\na[4]:=int(abs(t)*theta[4](t),t=-1..1)/int(theta[4](t)^2, t=-1..1);" }}}{PARA 0 "" 0 "" {TEXT -1 30 "STEP 3: Write down the answ er." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 51 "sum(a[p]*theta[p](x), p=1..3);\napprox:=unapply(%,x);" }}}{PARA 0 "" 0 "" {TEXT -1 58 "You m ight like to see the graph of these two superimposed." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 33 "plot([abs(x),approx(x)],x=-1..1);" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT 267 11 "Assignment:" }{TEXT -1 110 " F ind the \"best approximation\" in C([-1, 1]) to the absolute value fun ction with a polynomial of degree four. " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 17 "Remark in closing" }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 227 "Perhaps \+ it is no surprise that Maple already knows these polynomials on [-1, 1 ]. After all, polynomial approximations for functions is common. Here \+ is how to access these in Maple and a listing of the first four for co mparison." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 16 "with(orthopoly) ;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 19 "theta[1](x);P(0,x);" } }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 19 "theta[2](x);P(1,x);" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 19 "theta[3](x);P(2,x);" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 19 "theta[4](x);P(3,x);" }}} {PARA 0 "" 0 "" {TEXT -1 111 "We see that Maple's listing of the Legen dre Polynomials differs from our computation only by a constant factor ." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{PARA 0 "" 0 "" {TEXT -1 1 " " }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 39 "Projections of vectors and functions II" }}{EXCHG {PARA 0 "" 0 "" {TEXT 272 11 "Definition:" }{TEXT -1 3 " A " }{TEXT 273 10 "projection" }{TEXT -1 58 " P is a function from the space to i tself which satisfies " }{XPPEDIT 18 0 "P^2 = P;" "6#/*$%\"PG\"\"#F%" }{TEXT -1 2 " ." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "restart: " }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{SECT 1 {PARA 3 "" 0 "" {TEXT 270 23 "Projection onto a plane" }{TEXT -1 2 " " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 68 " Here is what this se ction is about. Suppose we have a plane in " }{XPPEDIT 18 0 "R^3;" "6# *$%\"RG\"\"$" }{TEXT -1 96 " which contains the origin. We want to fin d a function P such that if [x, y, z] is any point in " }{XPPEDIT 18 0 "R^3;" "6#*$%\"RG\"\"$" }{TEXT -1 116 " , then P([x, y, z]) is the c losest point in the plane to [x, y, z]. Such a function would be a pro jection function." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 245 " A plane is determined by three points. We take the \+ three points to be \{0, 0, 0\}, \{a, b, c\}, and \{r, s, t\}. From the se three points, we make two vectors -- [a, b, c] and [r, s, t]. Thus, we make up the projection function with domain all of " }{XPPEDIT 18 0 "R^3" "6#*$%\"RG\"\"$" }{TEXT -1 115 " and with range in the plane d etermined by these two vectors. We set up things to call one point A a nd the other R." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 114 "restart: \nwith(linalg):\nassume(a,real);assume(b,real);assume(c,real);\nassume (r,real);assume(s,real);assume(t,real);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 39 "A:=vector([a,b,c]);\nR:=vector([r,s,t]);" }}}{PARA 0 "" 0 "" {TEXT -1 417 "To define the projection, we need two orthogonal vectors in the plane onto which we are making the projection. Thus, w e find a vector B which is orthogonal to A and which is a linear combi nation of A and R. We described how to get this vector in class: split R into two parts. The part in the direction of A and what ever is lef t to make R. Call whatever is left B. This is the already familiar Gra mm Schmidt Process." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 33 "B:=R- dotprod(R,A)/dotprod(A,A)*A;" }}}{PARA 0 "" 0 "" {TEXT -1 38 "We verif y that A and B are orthogonal." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 23 "simplify(dotprod(A,B));" }}}{PARA 0 "" 0 "" {TEXT -1 195 "Since \+ B is a linear combination of R and A, it is in the plane of interest. \+ Now, we can make the projection onto the plane by using the orthogonal vectors A and B -- by using the Fourier Process." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 65 "P2:=v->dotprod(v,A)/dotprod(A,A)*A + dotprod( v,B)/dotprod(B,B)*B;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }} }{PARA 0 "" 0 "" {TEXT -1 79 " The point P([x,y,z]) is closest to \+ [x. y. z]. We need a numerical example." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 433 " Here is a numerical example. T ake the vector [1, 2, 3]. We find the projection onto the x-y plane, t hat is, onto the plane containing [1, 0, 0] and [0, 1, 0]. We know at \+ the outset that the answer should be that the projection of [1, 2, 3] \+ onto this x-y plane is [1, 2, 0]. Let's use the procedure. These two v ectors, [1, 0, 0] and [0, 1, 0], are already orthogonal. We make thes e A and R anyway, so as to follow the procedure." }}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 39 "A:=vector([1,0,0]);\nR:=vector([0,1,0]);" }}} {PARA 0 "" 0 "" {TEXT -1 112 "We Gramm Schmidt A and R to form orthogo nal vectors A and B. For safety, we confirm that A and B are orthogona l." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 47 "B:=R-dotprod(R,A)/dotp rod(A,A)*A;\ndotprod(A,B);" }}}{PARA 0 "" 0 "" {TEXT -1 86 "Now, we ca n make the two dimensional projection of [1, 2, 3] onto the span of A \+ and B." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 22 "P2([1,2,3]);\neval m(%);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{PARA 0 "" 0 " " {TEXT -1 54 " You try an example where the outcome is not so clear. " }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT 271 11 "Ass ignment:" }{TEXT -1 86 " Find the projection of [1, 2, 2] onto the pla ne determined by [1, 1, 1] and [1, 0, 1]" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 30 "Projection in a function space" }}{PARA 0 "" 0 "" {TEXT -1 0 " " }}{PARA 0 "" 0 "" {TEXT -1 386 " Perhaps you feel comfortable wit h the finite dimension example. We repeat these processes in the conte xt of a function space. First we define and illustrate a projection. I f g is a function in the space C([a, b]), then the projection of any f unction f onto the span of g is given by the FOURIER COEFFICIENT times g. The dot product is now an integral; if is an integral from a to b. " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 14 " \+ " }{XPPEDIT 18 0 "anglebracket(f,g);" "6#-%-anglebracketG6$% \"fG%\"gG" }{TEXT -1 7 " = " }{XPPEDIT 18 0 "int(f(t)*g(t),t = a . . b);" "6#-%$intG6$*&-%\"fG6#%\"tG\"\"\"-%\"gG6#F*F+/F*;%\"aG%\"bG" } {TEXT -1 2 " ." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 64 "projf:=(f,g,a,b)->g(x)*int(f(t)*g(t),t=a..b)/int (g(t)^2,t=a..b);" }}}{PARA 0 "" 0 "" {TEXT -1 17 "For illustration:" } }{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 24 "g:=x->sin(3*x);\nf:=x->x;" }}}{PARA 0 "" 0 "" {TEXT -1 225 "Let's check our intuition. First, not e that the projection of g onto g should be g. And the projection of t he above f should not be g. Rather, it multiplies g by the right thing to be as close to f as possible with this norm." }}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 33 "projf(g,g,0,Pi);\nprojf(f,g,0,Pi);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" } }{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 198 "The abo ve notion provides a method to conceive of what is the FOURIER IDEA. I n what follows, we use the Fourier Idea to find the approximation of a function f by sin(x), sin(2 x), sin(3 x). Simply," }}{PARA 0 "" 0 " " {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 9 " f(x) ~ " }{XPPEDIT 18 0 "int(f(x)*sin(pi*x),x = 0 .. 1)/int(sin(Pi*x)^2,x = 0 .. 1);" "6#*&- %$intG6$*&-%\"fG6#%\"xG\"\"\"-%$sinG6#*&%#piGF,F+F,F,/F+;\"\"!\"\"\"F, -F%6$*$-F.6#*&%#PiGF,F+F,\"\"#/F+;F4\"\"\"!\"\"" }{TEXT -1 5 " sin(" } {XPPEDIT 18 0 "pi;" "6#%#piG" }{TEXT -1 7 " x) + " }{XPPEDIT 18 0 "in t(f(x)*sin(2*pi*x),x = 0 .. 1)/int(sin(2*Pi*x)^2,x = 0 .. 1);" "6#*&-% $intG6$*&-%\"fG6#%\"xG\"\"\"-%$sinG6#*(\"\"#F,%#piGF,F+F,F,/F+;\"\"!\" \"\"F,-F%6$*$-F.6#*(\"\"#F,%#PiGF,F+F,\"\"#/F+;F5\"\"\"!\"\"" }{TEXT -1 7 " sin(2 " }{XPPEDIT 18 0 "pi;" "6#%#piG" }{TEXT -1 7 " x) + " } {XPPEDIT 18 0 "int(f(x)*sin(3*pi*x),x = 0 .. 1)/int(sin(3*Pi*x)^2,x = \+ 0 .. 1);" "6#*&-%$intG6$*&-%\"fG6#%\"xG\"\"\"-%$sinG6#*(\"\"$F,%#piGF, F+F,F,/F+;\"\"!\"\"\"F,-F%6$*$-F.6#*(\"\"$F,%#PiGF,F+F,\"\"#/F+;F5\"\" \"!\"\"" }{TEXT -1 7 " sin(3 " }{XPPEDIT 18 0 "pi;" "6#%#piG" }{TEXT -1 4 " x)." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 28 "Or, f(x) ~ proj( f(x), sin( " }{XPPEDIT 18 0 "pi;" "6#%#piG" } {TEXT -1 31 " x), 0, 1) + proj( f(x), sin(2 " }{XPPEDIT 18 0 "pi;" "6# %#piG" }{TEXT -1 31 " x), 0, 1) + proj( f(x), sin(3 " }{XPPEDIT 18 0 " pi;" "6#%#piG" }{TEXT -1 13 " x), 0, 1)\000\000\000" }}{PARA 0 "" 0 " " {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 104 "These ideas are used t o find an approximation for the function defined on the interval [0,1] as follows:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 69 " if 0 < x < 1/2 then f(x) = 2 x; otherwise f(x) = 2 - 2 x" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 60 "We find the best approximation with sin(n ¹ x), n = 1, 2, 3." }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 92 "f:=x->piecewise(x<1/2,2*x,-2*x+2);\ng1:=x->sin(Pi*x);\ng2:=x->sin( 2*Pi*x);\ng3:=x->sin(3*Pi*x);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 18 "plot(f(x),x=0..1);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 63 "approx:=x->projf(f,g1,0,1) + projf(f,g2,0,1) + projf(f,g3,0,1);" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 30 "plot([f(x),approx(x)],x=0..1 );" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 66 "We repeat this process for f(x) = 1 if x > 1/2 and zero otherwise." }} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 87 "f:=x->Heaviside(x-1/2);\napp rox:=x->projf(f,g1,0,1) + projf(f,g2,0,1) + projf(f,g3,0,1);" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 43 "plot([f(x),approx(x)],x=0..1 ,discont=true);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 16 "with(ort hopoly);" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 162 "Finally, we repeat the process for f(x) defined on the interval [ -1, 1] by f(x) = | x | and, instead of using the sine functions, we us e the Legendre Polynomials." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 88 "f:=x->abs(x);\ng1:=x->P(0,x);\ng2:=x->P(1,x);\ng3:=x->P(2,x);\ng4: =x->P(3,x);\ng5:=x->P(4,x);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 104 "approx:=x->projf(f,g1,-1,1) + projf(f,g2,-1,1) + projf(f,g3,-1,1) + projf(f,g4,-1,1) + projf(f,g5,-1,1);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 31 "plot([f(x),approx(x)],x=-1..1);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 105 "Assignment: Let f(x) = x. Find the projection of f onto the span of sin(x), sin(2 x) and sin(3 x) on [0, " }{XPPEDIT 18 0 "pi;" "6#%#piG" }{TEXT -1 46 " ]. Sketch the graph on the larger \+ interval [ " }{XPPEDIT 18 0 "-Pi;" "6#,$%#PiG!\"\"" }{TEXT -1 2 ", " } {XPPEDIT 18 0 "Pi;" "6#%#PiG" }{TEXT -1 53 "]. Repeat this with 1, cos (x), cos(2 x) and cos(3 x)." }}}}{MARK "11" 0 }{VIEWOPTS 1 1 0 1 1 1803 }