{VERSION 2 3 "IBM INTEL NT" "2.3" } {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 "" 1 18 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 257 "" 1 14 0 0 0 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 260 "" 1 14 0 0 0 0 0 0 0 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 "" 0 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 }} {SECT 0 {PARA 256 "" 0 "" {TEXT 256 21 "Linear Approximations" }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT 257 58 "We compu te the linear approximation of a function f(x,y) =" }{XPPEDIT 18 0 "x* cos(x-y)+y^2" ",&*&%\"xG\"\"\"-%$cosG6#,&F$F%%\"yG!\"\"F%F%*$F*\"\"#F% " }{TEXT 260 32 " near (1,1) and check the error." }}{EXCHG {PARA 0 " " 0 "" {TEXT -1 134 "We first compute the linear approximation functio n. Recall the approximation of f(x,y) near (a,b) is given by\napprox(x ,y) := f(a,b) + " }{XPPEDIT 18 0 "diff(f,x)" "-%%diffG6$%\"fG%\"xG" } {TEXT -1 14 "(a,b) (x-a) + " }{XPPEDIT 18 0 "diff(f,y)" "-%%diffG6$%\" fG%\"yG" }{TEXT -1 11 "(a,b) (y-b)" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 238 "restart;\nf := x*cos(x-y) + y^2:\nfx := diff(f, x): \nfy := diff( f, y): \nfab := value( subs(\{x=1,y=1\}, f) ); # this is f(a,b)\nfxa b := value( subs(\{x=1,y=1\}, fx) ); # this is f_x(a,b)\nfyab := value ( subs(\{x=1,y=1\}, fy) ); # this is f_y(a,b)" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 40 "So the linear approximation function is " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 41 "approx := fab + (x-1)*fxab + (y-1)*fyab ;" }} }{EXCHG {PARA 0 "" 0 "" {TEXT -1 55 "We now plot f(x,y) and approx(x,y ) for (x,y) near (1,1)" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 176 "myrange \+ :=x=0.5..1.5, y=0.5..1.5;\na := plot3d(f, myrange, color=red):\nb := p lot3d( approx, myrange, color=blue):\nwith(plots):\ndisplay( \{a,b\}, \+ style = patchnogrid, axes=boxed );" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 155 "It is difficult to judge from this plot the accuracy of the ap proximation. A better judgement may be made from a plot of the percent age error function = | " }{XPPEDIT 18 0 "(f-approx)/f*100" "*(,&%\"fG \"\"\"%'approxG!\"\"F%F$F'\"$+\"F%" }{TEXT -1 2 " |" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 151 "perror := abs( (f-approx)*100/f );\nplot3d( perro r, x=0.9..1.1, y=0.9..1.1, axes=boxed, style=patchnogrid,\n tit le = `% error in linear approx` );" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 92 "So the linear approx is accurate to 0.6% near (1,1) over the rectangle 0.9