{VERSION 5 0 "Windows 8" "5.0" } {USTYLETAB {PSTYLE "Ordered List 1" -1 200 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 1 0 0 1 }1 1 0 0 3 3 2 0 2 0 2 2 -1 1 } {PSTYLE "Ordered List 2" -1 201 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 1 0 0 1 }1 1 0 0 3 3 2 36 2 0 2 2 -1 1 }{PSTYLE "Ordered List 3" -1 202 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 1 0 0 1 }1 1 0 0 3 3 2 72 2 0 2 2 -1 1 }{PSTYLE "Ordered List 4" -1 203 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 1 0 0 1 }1 1 0 0 3 3 2 108 2 0 2 2 -1 1 }{PSTYLE "Ordered List 5" -1 204 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 1 0 0 1 }1 1 0 0 3 3 2 144 2 0 2 2 -1 1 }{PSTYLE "Author" -1 19 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 1 0 0 1 }3 1 0 0 8 8 2 0 2 0 2 2 -1 1 }{PSTYLE "Warning" -1 7 1 {CSTYLE "" -1 -1 "Courier" 1 10 0 0 255 1 2 2 2 2 2 1 1 0 0 1 } 1 1 0 0 0 0 2 0 2 0 2 2 -1 1 }{PSTYLE "Annotation Title" -1 205 1 {CSTYLE "" -1 -1 "Times" 1 18 0 0 0 1 2 1 2 2 2 2 1 0 0 1 }3 1 0 0 12 12 2 0 2 0 2 2 -1 1 }{PSTYLE "Fixed Width" -1 17 1 {CSTYLE "" -1 -1 "C ourier" 1 10 0 0 0 1 2 2 2 2 2 2 1 0 0 1 }3 1 0 0 0 0 2 0 2 0 2 2 -1 1 }{PSTYLE "Maple Plot" -1 13 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 1 0 0 1 }3 1 0 0 0 0 2 0 2 0 2 2 -1 1 }{PSTYLE "Line Printe d Output" -1 6 1 {CSTYLE "" -1 -1 "Courier" 1 10 0 0 255 1 2 2 2 2 2 1 1 0 0 1 }1 1 0 0 0 0 2 0 2 0 2 2 -1 1 }{PSTYLE "Help" -1 10 1 {CSTYLE "" -1 -1 "Courier" 1 9 0 0 255 1 2 2 2 2 2 1 1 0 0 1 }1 1 0 0 0 0 2 0 2 0 2 2 -1 1 }{PSTYLE "Text Output" -1 2 1 {CSTYLE "" -1 -1 "Courier" 1 10 0 0 255 1 2 2 2 2 2 1 1 0 0 1 }1 1 0 0 0 0 2 0 2 0 2 2 -1 1 } {PSTYLE "Diagnostic" -1 9 1 {CSTYLE "" -1 -1 "Courier" 1 10 64 128 64 1 2 2 2 2 2 1 1 0 0 1 }1 1 0 0 0 0 2 0 2 0 2 2 -1 1 }{PSTYLE "Normal" -1 0 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 1 0 0 1 }1 1 0 0 0 0 2 0 2 0 2 2 -1 1 }{PSTYLE "Maple Output" -1 11 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 1 0 0 1 }3 1 0 0 0 0 2 0 2 0 2 2 -1 1 }{PSTYLE "Dash Item" -1 16 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 1 0 0 1 }1 1 0 0 3 3 2 0 2 0 2 2 -1 1 }{PSTYLE "Hyperlin kError" -1 206 1 {CSTYLE "" -1 -1 "Courier New" 1 12 255 0 255 1 2 2 1 2 2 1 1 0 0 1 }1 1 0 0 0 0 2 0 2 0 2 2 -1 1 }{PSTYLE "Error" -1 8 1 {CSTYLE "" -1 -1 "Courier" 1 10 255 0 255 1 2 2 2 2 2 1 1 0 0 1 }1 1 0 0 0 0 2 0 2 0 2 2 -1 1 }{PSTYLE "Title" -1 18 1 {CSTYLE "" -1 -1 "Tim es" 1 18 0 0 0 1 2 1 1 2 2 2 1 0 0 1 }3 1 0 0 12 12 2 0 2 0 2 2 -1 1 } {PSTYLE "Heading 1" -1 3 1 {CSTYLE "" -1 -1 "Times" 1 18 0 0 0 1 2 1 2 2 2 2 1 0 0 1 }1 1 0 0 8 4 2 0 2 0 2 2 -1 1 }{PSTYLE "Bullet Item" -1 15 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 1 0 0 1 }1 1 0 0 3 3 2 0 2 0 2 2 -1 1 }{PSTYLE "Heading 4" -1 20 1 {CSTYLE "" -1 -1 "Times" 1 10 0 0 0 1 1 1 2 2 2 2 1 0 0 1 }1 1 0 0 0 0 2 0 2 0 2 2 -1 1 }{PSTYLE "Heading 3" -1 5 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 1 1 2 2 2 2 1 0 0 1 }1 1 0 0 0 0 2 0 2 0 2 2 -1 1 }{PSTYLE "Heading 2" -1 4 1 {CSTYLE "" -1 -1 "Times" 1 14 0 0 0 1 2 1 2 2 2 2 1 0 0 1 }1 1 0 0 8 2 2 0 2 0 2 2 -1 1 }{PSTYLE "HyperlinkWarning" -1 207 1 {CSTYLE "" -1 -1 "Courier New" 1 12 0 0 255 1 2 2 1 2 2 1 1 0 0 1 }1 1 0 0 0 0 2 0 2 0 2 2 -1 1 }{PSTYLE "Left Justified Maple Output" -1 12 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 1 0 0 1 }1 1 0 0 0 0 2 0 2 0 2 2 -1 1 }{PSTYLE "List Item" -1 14 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 1 0 0 1 }1 1 0 0 3 3 2 0 2 0 2 2 -1 1 }{CSTYLE "An notation Text" -1 200 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 0 0 0 1 } {CSTYLE "Help Maple Name" -1 35 "Times" 1 12 104 64 92 1 2 1 2 2 2 2 0 0 0 1 }{CSTYLE "2D Math Bold" -1 5 "Times" 1 12 0 0 0 1 2 1 2 2 2 2 0 0 0 1 }{CSTYLE "Help Menus" -1 36 "Times" 1 12 0 0 0 1 2 1 2 2 2 2 0 0 0 1 }{CSTYLE "2D Math Italic" -1 3 "Times" 1 12 0 0 0 1 1 2 2 2 2 2 0 0 0 1 }{CSTYLE "Help Normal" -1 30 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 0 0 0 1 }{CSTYLE "Plot Text" -1 28 "Times" 1 8 0 0 0 1 2 2 2 2 2 2 0 0 0 1 }{CSTYLE "Help Nonterminal" -1 24 "Courier" 1 12 0 0 0 1 2 1 2 2 2 2 0 0 0 1 }{CSTYLE "Help Heading" -1 26 "Times" 1 14 0 0 0 1 2 1 2 2 2 2 0 0 0 1 }{CSTYLE "Help Italic" -1 42 "Times" 1 12 0 0 0 1 1 2 2 2 2 2 0 0 0 1 }{CSTYLE "Help Variable" -1 25 "Courier" 1 12 0 0 0 1 2 2 2 2 2 2 0 0 0 1 }{CSTYLE "Help Italic Bold" -1 40 "Times" 1 12 0 0 0 1 1 2 2 2 2 2 0 0 0 1 }{CSTYLE "Default" -1 38 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 0 0 0 1 }{CSTYLE "Help Underlined Italic" -1 43 "Times" 1 12 0 0 0 1 1 2 1 2 2 2 0 0 0 1 }{CSTYLE "Maple Input" -1 0 "Courier" 1 12 255 0 0 1 2 1 2 2 1 2 0 0 0 1 }{CSTYLE "2D Output" -1 20 "Times" 1 12 0 0 255 1 2 2 2 2 2 2 0 0 0 1 }{CSTYLE "2D Math Bold Small" -1 10 " Times" 1 1 0 0 0 1 2 1 2 2 2 2 0 0 0 1 }{CSTYLE "2D Math Small" -1 7 " Times" 1 1 0 0 0 1 2 2 2 2 2 2 0 0 0 1 }{CSTYLE "Page Number" -1 33 "T imes" 1 12 0 0 0 1 2 2 2 2 2 2 0 0 0 1 }{CSTYLE "Output Labels" -1 29 "Times" 1 8 0 0 0 1 2 2 2 2 2 2 0 0 0 1 }{CSTYLE "Plot Title" -1 27 "T imes" 1 10 0 0 0 1 2 1 2 2 2 2 0 0 0 1 }{CSTYLE "Help Emphasized" -1 22 "Times" 1 12 0 0 0 1 1 2 2 2 2 2 0 0 0 1 }{CSTYLE "2D Math Symbol 2 " -1 16 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 0 0 0 1 }{CSTYLE "Maple Comme nt" -1 21 "Courier" 1 12 0 0 0 1 2 1 2 2 2 2 0 0 0 1 }{CSTYLE "Caption Reference" -1 201 "Times" 1 12 0 0 0 1 2 1 2 2 2 2 0 0 0 1 }{CSTYLE " Maple Input Placeholder" -1 202 "Courier New" 1 12 200 0 200 1 2 1 2 2 1 2 0 0 0 1 }{CSTYLE "Code" -1 203 "Courier New" 1 12 255 0 0 1 2 2 2 2 2 2 0 0 0 1 }{CSTYLE "2D Inert Output" -1 204 "Times" 1 12 144 144 144 1 2 2 2 2 1 2 0 0 0 1 }{CSTYLE "2D Math Italic Small" -1 205 "Time s" 1 1 0 0 0 1 1 2 2 2 2 2 0 0 0 1 }{CSTYLE "2D Comment" -1 18 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 0 0 0 1 }{CSTYLE "Help Underlined Bold" -1 41 "Times" 1 12 0 0 0 1 1 1 2 2 2 2 0 0 0 1 }{CSTYLE "Copyright" -1 34 "Times" 1 10 0 0 0 1 2 2 2 2 2 2 0 0 0 1 }{CSTYLE "Hyperlink" -1 17 " Times" 1 12 0 128 128 1 2 2 1 2 2 2 0 0 0 1 }{CSTYLE "Help Underlined" -1 44 "Times" 1 12 0 0 0 1 2 2 1 2 2 2 0 0 0 1 }{CSTYLE "Prompt" -1 1 "Courier" 1 12 0 0 0 1 2 1 2 2 2 2 0 0 0 1 }{CSTYLE "2D Math" -1 2 "T imes" 1 12 0 0 0 1 2 2 2 2 2 2 0 0 0 1 }{CSTYLE "2D Input" -1 19 "Time s" 1 12 255 0 0 1 2 2 2 2 1 2 0 0 0 1 }{CSTYLE "Header and Footer" -1 206 "Times" 1 10 0 0 0 1 2 2 2 2 2 2 0 0 0 1 }{CSTYLE "Text" -1 207 "T imes" 1 12 0 0 0 1 2 2 2 2 2 2 0 0 0 1 }{CSTYLE "Help Notes" -1 37 "Ti mes" 1 12 0 0 0 1 2 1 2 2 2 2 0 0 0 1 }{CSTYLE "Help Bold" -1 39 "Time s" 1 12 0 0 0 1 2 1 2 2 2 2 0 0 0 1 }{CSTYLE "Equation Label" -1 208 " Times" 1 12 0 0 0 1 2 1 2 2 2 2 0 0 0 1 }{CSTYLE "LaTeX" -1 32 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 0 0 0 1 }{CSTYLE "Popup" -1 31 "Times" 1 12 0 128 128 1 1 2 1 2 2 2 0 0 0 1 }{CSTYLE "Atomic Variable" -1 209 "Tim es" 1 12 175 0 175 1 1 2 2 2 2 2 0 0 0 1 }{CSTYLE "Dictionary Hyperlin k" -1 45 "Times" 1 12 147 0 15 1 2 2 1 2 2 2 0 0 0 1 }{CSTYLE "Caption Text" -1 210 "Times" 1 12 0 0 0 1 2 1 2 2 2 2 0 0 0 1 }{CSTYLE "Help \+ Fixed" -1 23 "Courier" 1 10 0 0 0 1 2 2 2 2 2 2 0 0 0 1 }{CSTYLE "" -1 211 "Times" 1 12 0 0 0 1 2 1 1 2 2 2 0 0 0 1 }{CSTYLE "" -1 212 "Time s" 1 12 0 0 0 1 2 1 2 2 2 2 0 0 0 1 }} {SECT 0 {EXCHG {PARA 18 "" 0 "" {TEXT 213 42 "Directional Derivative \+ and Gradient Vector" }}{PARA 0 "" 0 "" {TEXT 214 69 "This worksheet is modifed from 'http://omega.albany.edu:8008/calc3/'." }}{PARA 0 "" 0 " " {TEXT 214 11 "Problem 1:\n" }{TEXT 214 152 "Use the definition of di rectional derivative to compute the directional derivative of the foll owing function at the given point p and given direction u." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 22 "restart;with(linalg): " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 37 "f := (x,y) -> x/y: 'f(x,y)' = f(x,y );" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 21 "p := vector([6,-2]); " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 29 "u := vector([-1,3])/sqr t(10);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 39 "Duf := Limit('(f( p+h*u)-f(p))/h',h=0); " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 71 "p h := evalm(p+h*u): Duf := Limit((f(ph[1],ph[2])-f(p[1],p[2]))/h,h=0); " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 62 " Duf := Limit(simplify( (f(ph[1],ph[2])-f(p[1],p[2]))/h),h=0); " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 52 " Duf := limit((f(ph[1],ph[2])-f(p[1],p[2]))/h,h=0); " }}}{EXCHG {PARA 0 "" 0 "" {TEXT 214 59 " Of course the formula with t he grad gives the same answer," }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 46 " formula := innerprod(grad(f(x,y),[x,y]), u); " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 36 " answer := subs(\{x=6,y=-2\},formul a);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT 214 11 "Problem 2:\n" }{TEXT 214 48 "Find the maximum rate of change of the function," }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 48 "g := (x,y) -> sqrt(x^2+2*y): 'g(x,y)' = g (x,y); " }}}{EXCHG {PARA 0 "" 0 "" {TEXT 214 1 "\n" }{TEXT 214 84 "at \+ the point r=(4,10) and the direction at which the maximum rate of chan ge occurs.\n" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 30 "grad_g := g rad(g(x,y),[x,y]); " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 59 "dire ction := map(simplify,subs(\{x=4,y=10\},evalm(grad_g))); " }}}{EXCHG {PARA 0 "" 0 "" {TEXT 214 330 " The rate of change of a function in a \+ given direction is nothing but the directional derivative in that dire ction. When the direction is given by the grad however, then the rate \+ becomes the magnitude of the gradient (recall that the directional der ivative is always equal to the projection of the grad onto that direct ion). Thus," }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 31 "rate := sqrt ((2/3)^2+(1/6)^2); " }}}{EXCHG {PARA 0 "" 0 "" {TEXT 211 10 "Problem 3 \n" }{TEXT 214 63 "Imagine yourself is climbing a mountain of the foll owing shape," }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 59 " z := exp( -((x-1)^2+y^2)/2)+ 2*exp(-((x-2)^2+(y+2)^2)/2); " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 40 " plot3d(z,x=-4..4,y=-4..4,axes=frame); " }}} {EXCHG {PARA 0 "" 0 "" {TEXT 214 34 " If you are standing at the point \n" }{TEXT 214 29 "(2,0, exp(-1/2) + 2 exp(-2))\n" }{TEXT 214 1 "\n" } {TEXT 214 156 "in which direction should you proceed initially in orde r to reach the top of the mountain fastest? At what angle above the ho rizontal will you be climbing? " }}}{EXCHG {PARA 0 "" 0 "" {TEXT 214 83 "Solution: The steepest ascend direction is given by the direction of the gradient," }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 48 "restar t;with(linalg):with(plots): with(student):" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 62 "x0:=2 : y0:=0: z0:=exp(-1/2)+2*exp(-2); X0:=vector([x0,y0,z0]);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 67 "G:=(x,y,z)->(exp(-((x-1)^2+y^2)/2)+ 2*exp(-((x-2)^2+(y+2)^2)/2))-z;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 15 "K:=G(x0,y0,z0);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 30 "gradG:=grad(G(x,y,z),[x,y,z]);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 34 "N:=subs(x=x0,y=y0,z=z0,op(gradG));" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 19 "X:=vector([x,y,z]):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 48 "tplane1:=evalm(innerprod(N,X)=innerprod(N,X0));\n" }} }{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 22 "zee:=solve(tplane1,z);" }}} {EXCHG {PARA 0 "" 0 "" {TEXT 214 27 "Now let\222s set up the plots." } }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 60 "tplane:=plot3d(zee,x=0..3, y=-1..1,color=red,numpoints=1000):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 85 "graphG:=implicitplot3d(G(x,y,z)=K,x=-4..4,y=-4..4,z=0 ..2,color=cyan,numpoints=10000):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 62 "Nvec:=spacecurve(evalm(X0+t*N),t=0..1,color=blue,thickness=3) :" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 39 "display(tplane,graphG,Nvec,axes=BOXED);" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 45 "tplane:=plot3d(zee,x=0..3,y= -1..1,color=red):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 84 "graphG :=implicitplot3d(G(x,y,z)=K,x=0..3,y=-1..1,z=0..2,color=cyan,numpoints =10000):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 62 "Nvec:=spacecurv e(evalm(X0+t*N),t=0..1,color=blue,thickness=3):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 39 " display(tplane,graphG,Nvec,axes=BOXED);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 57 "z := exp(-((x-1)^2+y^2)/2)+ 2*exp(-((x-2)^2+(y+2)^2)/ 2); " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 25 " grad_z := grad(z,[ x,y]);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 57 " grad_z := map(si mplify, subs(\{x=2,y=0\},evalm(grad_z))); " }}}{EXCHG {PARA 0 "" 0 "" {TEXT 214 493 " Notice that this is a vector on the xy plane. To find \+ the angle at which you'll be climbing we need to get the direction in \+ 3D. But when moving on the xy plane in the grad_z direction the height \"z\" will be changing at the rate given by the directional derivativ e of z in that particular direction. This is just what we mean by dire ctional derivative. Hence, the vector (in 3D) showing the direction of steepest ascent at the point, (2,0,exp(-1/2)+2exp(-2)) on the surface of the mountain is," }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 63 " u := vector([grad_z[1],grad_z[2],innerprod(grad_z,grad_z)]); " }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 53 " theta := angle(u, vector([g rad_z[1],grad_z[2],0])); " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 32 " theta_approx := evalf(theta); " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 41 " evalf(convert(theta_approx,degrees),4); " }}}{EXCHG {PARA 0 "" 0 "" {TEXT 212 12 "Exercise 1: " }{TEXT 214 50 "If we start with P=(2,0, exp(-1/2) + 2 exp(-2)), " }}{PARA 0 "" 0 "" {TEXT 214 73 "(1) draw the level curves for z=k, when k=0,0.5,0.8,1,1.2,1.5,1.8, and 2;" }}{PARA 0 "" 0 "" {TEXT 214 81 "(2) draw the 'curve of the st eepest ascent' together with the level curves above;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 62 "f:=(x,y)-> exp(-((x-1)^2+y^2)/2)+ 2*exp(- ((x-2)^2+(y+2)^2)/2);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 42 "pl ot3d(f(x,y),x=-5..5,y=-5..5,axes=boxed);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 169 "implicitplot(\{f(x,y)=0,f(x,y)=0.2,f(x,y)=0.5,f(x,y) =0.6,f(x,y)=0.8,f(x,y)=1,f(x,y)=1.2,f(x,y)=1.3,f(x,y)=1.5,f(x,y)=1.6,f (x,y)=1.8,f(x,y)=1.9,f(x,y)=2\},x=-1..4,y=-5..3);" }}}{EXCHG {PARA 0 " " 0 "" {TEXT 214 62 "Exercise 2. Repeat the problem above but start wi th x=0, y=-2." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 48 "restart;wi th(linalg):with(plots): with(student):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 62 "f:=(x,y)-> exp(-((x-1)^2+y^2)/2)+ 2*exp(-((x-2)^2+(y+ 2)^2)/2);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 51 "x0:=0: y0:=-2: z0:=f(0,-2); X0:=vector([x0,y0,z0]);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 67 "G:=(x,y,z)->(exp(-((x-1)^2+y^2)/2)+ 2*exp(-((x-2)^2+( y+2)^2)/2))-z;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 15 "K:=G(x0,y 0,z0);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 30 "gradG:=grad(G(x,y ,z),[x,y,z]);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 34 "N:=subs(x= x0,y=y0,z=z0,op(gradG));" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 19 "X:=vector([x,y,z]):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 48 "tpl ane1:=evalm(innerprod(N,X)=innerprod(N,X0));\n" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 22 "zee:=solve(tplane1,z);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT 214 58 "Now let\222s set up the plots, including labels for t he axes." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 46 "tplane:=plot3d( zee,x=-4..4,y=-4..4,color=red):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 85 "graphG:=implicitplot3d(G(x,y,z)=K,x=-4..4,y=-4..4,z=0..2,color =cyan,numpoints=10000):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 62 " Nvec:=spacecurve(evalm(X0+t*N),t=0..1,color=blue,thickness=3):" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 39 "display(tplane,graphG,Nvec,axes=BOXED);" }}}{EXCHG {PARA 0 "> " 0 "" {XPPEDIT 19 1 "" "%#%?G" }}}} {MARK "0 0 0" 0 }{VIEWOPTS 1 1 0 15 10 1804 1 1 1 1 }{PAGENUMBERS 0 1 2 33 1 1 }