{VERSION 5 0 "IBM INTEL NT" "5.0" } {USTYLETAB {CSTYLE "Maple Input" -1 0 "Courier" 0 1 255 0 0 1 0 1 0 0 1 0 0 0 0 1 }{CSTYLE "2D Math" -1 2 "Times" 0 1 0 0 0 0 0 0 2 0 0 0 0 0 0 1 }{CSTYLE "2D Comment" 2 18 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 } {CSTYLE "" -1 256 "" 0 1 0 0 0 0 0 0 2 0 0 0 0 0 0 1 }{CSTYLE "" -1 257 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 258 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 259 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 260 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 1 } {CSTYLE "" -1 261 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 262 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 263 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 264 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 265 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 } {CSTYLE "" -1 266 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 267 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 268 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 269 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 270 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 } {CSTYLE "" -1 271 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 272 "" 0 1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 0 0 0 0 0 1 }{CSTYLE "" -1 457 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 458 "" 0 14 0 0 0 0 0 0 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 459 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 460 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 } {CSTYLE "" -1 461 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 462 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 463 "" 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 464 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 }{PSTYLE "Normal" -1 0 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 1 1 1 1 }1 1 0 0 0 0 1 0 1 0 2 2 0 1 }{PSTYLE "Heading 1 " -1 3 1 {CSTYLE "" -1 -1 "Times" 1 18 0 0 0 1 2 1 2 2 2 2 1 1 1 1 }1 1 0 0 8 4 1 0 1 0 2 2 0 1 }{PSTYLE "Bullet Item" -1 15 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 1 1 1 1 }1 1 0 0 3 3 1 0 1 0 2 2 15 2 }{PSTYLE "Title" -1 18 1 {CSTYLE "" -1 -1 "Times" 1 18 0 0 0 1 2 1 1 2 2 2 1 1 1 1 }3 1 0 0 12 12 1 0 1 0 2 2 19 1 }{PSTYLE "Normal" -1 256 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 1 2 2 2 2 1 1 1 1 }1 1 0 0 0 0 1 0 1 0 2 2 0 1 }{PSTYLE "Normal" -1 257 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 1 2 2 2 2 2 1 1 1 1 }1 1 0 0 0 0 1 0 1 0 2 2 0 1 }{PSTYLE "Normal" -1 258 1 {CSTYLE "" -1 -1 "Times" 1 14 0 0 0 1 2 1 2 2 2 2 1 1 1 1 }1 1 0 0 0 0 1 0 1 0 2 2 0 1 }{PSTYLE "Normal" -1 259 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 1 2 2 2 1 1 1 1 }1 1 0 0 0 0 1 0 1 0 2 2 0 1 }{PSTYLE "Title" -1 260 1 {CSTYLE "" -1 -1 "Times " 1 18 0 0 0 1 2 1 2 2 2 2 1 1 1 1 }3 1 0 0 12 12 1 0 1 0 2 2 19 1 } {PSTYLE "Heading 2" -1 261 1 {CSTYLE "" -1 -1 "Times" 1 18 0 0 0 1 2 1 2 2 2 2 1 1 1 1 }1 1 0 0 8 2 1 0 1 0 2 2 0 1 }} {SECT 0 {EXCHG {PARA 18 "" 0 "" {TEXT 256 9 "Lecture 9" }}}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 4 "subs" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }} {EXCHG {PARA 0 "" 0 "" {TEXT -1 82 "Rather than convert an expression \+ to a function, sometimes the use of the command " }{TEXT 384 4 "subs" }{TEXT -1 53 " (substitution) may be used. Here are some examples:\n" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "restart;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "poly1:=x^2+1;" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 16 "subs(x=2,poly1);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 65 "Note that substitution does not change the value of x and poly1 :\n" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 9 "x, poly1;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 17 "Another example:\n" }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 29 "poly2:=subs(x=t^2+t+1,poly1);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 21 "poly2:=expand(poly2);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 33 "Still poly1 and x are unchanged:\n" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "poly1,x;" }}}{EXCHG {PARA 0 " " 0 "" {TEXT -1 95 "Here's another way to substitute something for x i n poly1. But this changes both x and poly1:\n" }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 5 "x:=2;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 6 "poly1;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 2 "x;" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 133 "Note that poly1 is now 5. The ori ginal value of poly1 is gone. So if we try the following we don't get \+ what you might have expected.\n" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 16 "subs(x=t,poly1);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 69 "We ca n put things back to their original state by just unassigning x:" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "x:='x';\n" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "poly1,x;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 16 "subs(x=t,poly1);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 32 "As you know, we could also make " }{TEXT 412 5 "poly1" }{TEXT -1 72 " into a function (procedure) in three ways: But note that only by \+ using " }{TEXT 411 7 "unapply" }{TEXT -1 26 " can we avoid retyping in " }{TEXT 413 5 "poly1" }{TEXT -1 2 ".\n" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 27 "f:=unapply(poly1,x);\nf(5);\n" }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 18 "g:=x->x^2+1;\ng(5);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 21 "g2:=x->poly1;\ng2(5);\n" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 34 "h:=proc(x) x^2+1; end proc;\nh(5);\n" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 50 "h2:=proc(x) global poly1; poly1; en d proc;\nh2(5);\n" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 60 "We may also \+ substitute several values at once. For example:\n" }}}{EXCHG {PARA 0 " > " 0 "" {MPLTEXT 1 0 23 "poly3:=x^2 + y^2 + z^2;" }}}{EXCHG {PARA 0 " > " 0 "" {MPLTEXT 1 0 30 "poly4:=subs(\{x=a,y=b\}, poly3);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 26 "subs(\{a=A,b=B,z=Z\},poly4);" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 36 "Now let's do some substitution wit h " }{TEXT 387 8 "Matrices" }{TEXT -1 2 ": " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "restart:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "with(LinearAlgebra):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 28 "A:=Matrix([[x,y],[z,x^2]]);\n" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 " " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 24 "subs(\{x=2,y=3\},A); \+ " }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 41 "However, things don't work so nicely for " }{TEXT 442 8 "matrices" }{TEXT -1 32 " as the followi ng examples show." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 56 "restar t:\nA:=matrix([[x,y],[z,x^2]]);\nsubs(\{x=2,y=3\},A);\n" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 9 "evalm(A);" }}}{EXCHG {PARA 0 "" 0 " " {TEXT -1 24 "Here's the way to do it:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 24 "subs(\{x=2,y=3\},eval( A));" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 8 "But for " }{TEXT 385 5 "lists" }{TEXT -1 5 " and " }{TEXT 386 4 "sets" }{TEXT -1 26 " there is no such problem:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 22 "subs(\{x=2, y=3\},[x,y]);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 34 "subs(\{x=2 ,y=3\},[x,x^2+y^2,r,w,z]);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 36 "subs(\{x=2,y=3\},\{x,x^2 + y^2,r,w,z\});" }}}{EXCHG {PARA 0 "" 0 " " {TEXT -1 74 "Notice that you cannot depend on a given order of eleme nts in a set.\n\nFor " }{TEXT 388 6 "tables" }{TEXT -1 47 " which are \+ more like matrices we must also use " }{TEXT 389 4 "eval" }{TEXT -1 75 " when doing a substitution. Here's an example. We create first the table T:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 34 "T[1]:=green;\n T[2]:=pink;\neval(T);\n" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 50 " T:=subs(\{green=GREEN,pink=PINK\},eval(T)):\neval(T);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 10 "T[1],T[2];" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 5 "eval " }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 20 "An important use of " }{TEXT 392 4 "eval" }{TEXT -1 8 " is to " }{TEXT 414 8 "evaluate" }{TEXT -1 96 " an expression at particular values of variables in the expression , as in the following example." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "restart:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "expr:=x^ 2 + 1;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 18 "eval(expr, x = 2) ;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 18 "eval(expr, x = t);" }} }{EXCHG {PARA 0 "" 0 "" {TEXT -1 126 "Note that if one evaluates the e xpression at more than one value one puts the equations in a set, as i n the following example." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 33 "eval(x^2+y^2+z^2, \{x=1,y=t,z=u\});" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 48 "The following shows a subtle difference between " }{TEXT 390 4 "subs" }{TEXT -1 5 " and " }{TEXT 391 5 "eval." }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 20 "eval(sin(x), x = 0);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 17 "subs(x=0,sin(x));" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "eval(%);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 22 "expr2:=sin(x) + ln(y);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 22 " eval(expr2,\{x=0,y=1\});" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 22 "subs(\{x=0,y=1\},expr2);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "eval(%);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 25 "A:=matrix([[1, 0],[1,1]]);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 88 "Note that to see w hat the matrix A is, the following will not work. It justs returns A. " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 2 "A;" }}}{EXCHG {PARA 0 " " 0 "" {TEXT -1 13 "One must use " }{TEXT 415 4 "eval" }{TEXT -1 4 " o r " }{TEXT 416 5 "evalm" }{TEXT -1 58 " to see the contents of A. Reca ll the distinction between " }{TEXT 417 11 "whattype(A)" }{TEXT -1 5 " and " }{TEXT 418 18 "whattype(eval(A));" }{TEXT -1 1 "\n" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 31 "whattype(A), whattype(eval(A));" }} }{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 18 "eval(A), evalm(A);" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 41 "Similarly to see the contents of a table:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 24 "T[1]:=xray:\nT[2 ]:=roger:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 2 "T;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "eval(T);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 43 "If you want to see more about eval execute " }{MPLTEXT 1 0 5 "?eval" }{TEXT -1 47 " but the above will suffice for most purpos es." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 " " }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{SECT 1 {PARA 261 "" 0 "" {TEXT -1 6 "assign " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 19 "First we note that " }{TEXT 419 11 "assign(x=2)" }{TEXT -1 16 " is the same as " }{TEXT 420 5 "x:=2:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "restart:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 5 " x:=2;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 2 "x;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "assign(y=2);" }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 2 "y;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 40 "Or w e can assign several things at once:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 23 "assign(\{a=2,b=3\}):\na,b;" }}}{EXCHG {PARA 0 "" 0 " " {TEXT -1 175 "One way this can be useful is illustrated below. Note \+ the output of the solve procedure is a set of equations if we make the second argument to solve a set of indeterminates. " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "restart:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 42 "sol:= solve(\{x+y=1, 2*x+4*y=10\}, \{x,y\} ); " }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 130 "Note that x and y are unassigned \+ after the solve command. We can assign the values -3 to x and 4 to y u sing the following command:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "assign(sol);\n" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 6 "[x,y]; " }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 70 "But note that now x and y hav e been changed, so, for example, we have:" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 4 "sol;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 70 "Another approach is to use eval or subs, as in the following examples:" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 50 "restart:\nsol:= solve(\{x+y= 1, 2*x+4*y=10\}, \{x,y\} );" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 16 "subs(sol,[x,y]);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 16 "eva l([x,y],sol);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 37 "Note that sol, x and y are unchanged:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "sol ,x,y;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 47 "Use of Maple to find extreme values of f (x,y) " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 12 "The command " }{TEXT 393 6 "fsolve" }{TEXT -1 56 " can be used to solve an equation or set of equations-- " }{TEXT 394 6 "fsolv e" }{TEXT -1 60 " gives an approximate floating point solution as oppo sed to " }{TEXT 395 6 "solve " }{TEXT -1 33 "which --when possible-- g ives an " }{TEXT 399 5 "exact" }{TEXT -1 10 " solution." }{TEXT 400 2 " " }{TEXT -1 92 "Of course, exact solutions are not always possible. Note that often it is necessary to give " }{TEXT 421 6 "fsolve" } {TEXT -1 61 " an interval where you expect a solution to be. Here we \+ use " }{TEXT 396 6 "fsolve" }{TEXT -1 2 ", " }{TEXT 397 6 "plot3d" } {TEXT -1 5 " and " }{TEXT 398 12 "contourplot " }{TEXT -1 36 "to find \+ the location of the peaks ( " }{TEXT 403 5 "a.k.a" }{TEXT -1 45 " loca l maxima) of the graph of the function. " }}{PARA 0 "" 0 "" {TEXT -1 27 " " }}{PARA 0 "" 0 "" {TEXT -1 33 " \+ " }{XPPEDIT 18 0 "f(x,y) = exp((x+y)/5)*sin (x)*cos(y)^2;" "6#/-%\"fG6$%\"xG%\"yG*(-%$expG6#*&,&F'\"\"\"F(F/F/\"\" &!\"\"F/-%$sinG6#F'F/-%$cosG6#F(\"\"#" }{TEXT -1 0 "" }}{PARA 0 "" 0 " " {TEXT -1 1 " " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 43 "in the region x = -4 to 4 and y = -2 to 4." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "restart:" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 12 "with(plots):" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 165 "Recall that if f is a differentiable function of two variables x \+ and y then extreme values (i.e., local (or relative) maxima and minima ) occur at points where both " }{XPPEDIT 422 0 "diff(f(x,y),x) = 0;" "6#/-%%diffG6$-%\"fG6$%\"xG%\"yGF*\"\"!" }{TEXT -1 5 " and " } {XPPEDIT 423 0 "diff(f(x,y),y) = 0;" "6#/-%%diffG6$-%\"fG6$%\"xG%\"yGF +\"\"!" }{TEXT -1 439 ". Recall that at such points one may also have a saddle point where the function takes on neither a local maximum or a local minimum. So one needs additional evidence to know what happen s when both partials are zero for a particular point. We will conside r such an example now. We could use calculus analogues of the second \+ derivative test, but for simplicity here we will use the graph to iden tify the nature of the points in question." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 259 "" 0 "" {TEXT 447 49 "Note that in the exa mple below we define f as an " }{TEXT 443 10 "expression" }{TEXT 448 11 " and not a " }{TEXT 444 8 "function" }{TEXT 449 2 ".\n" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 33 "f:=exp((x+y)/5)*sin(x)*cos(y)^2; " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 38 "plot3d(f,x=-4..4,y=-2..4, axes=boxed);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 330 "We can see two \+ peaks (local maxima) in the above picture. We also see several valleys , pits and maybe some saddle points. We need to be careful to distingu ish the peaks from the valleys and saddle points. Let's find the THRE E coordinates of each peak: The x and y coordinates of each peak will \+ be a solution to the two equations " }{XPPEDIT 18 0 "diff(f(x,y),x) = \+ 0;" "6#/-%%diffG6$-%\"fG6$%\"xG%\"yGF*\"\"!" }{TEXT -1 5 " and " } {XPPEDIT 18 0 "diff(f(x,y),y) = 0;" "6#/-%%diffG6$-%\"fG6$%\"xG%\"yGF+ \"\"!" }{TEXT -1 2 ". " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 31 "f x:=diff(f,x); \nfy:=diff(f,y); " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 50 "s1:=fsolve(\{fx=0,fy=0\},\{x,y\}, \{x=-4..4,y=-2..4\}); " }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 111 "Note that the above just gives us e one solution we cannot be sure if it identifies a peak, pit or pass. Using " }{TEXT 401 13 "contourplot3d" }{TEXT -1 75 " we can get a be tter idea of where the peaks are located. I use the option " }{TEXT 445 11 "filled=true" }{TEXT -1 73 " which colors the higher regions in yellow and the lower regions in red. " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 58 "contourplot3d(f,x=-4..4,y=-2..4, filled=true, axes=bo xed);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 10 "If we use " }{TEXT 446 11 "contourplot" }{TEXT -1 39 " we get a bird's eye view of this plot. " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 44 "contourplot(f,x=-4..4,y =-2..4, filled=true);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 768 "We are \+ interested in finding the x and y coordinates of the two yellow peaks. Clicking the cursor on a yellow region will cause the coordinates to \+ appear in the upper left corner of this worksheet. We see in this way \+ that the (x,y)-coordinates of the upper peak is about ( 1.68 , 3.24). \+ The lower peak has (x,y)-coordinates approximately (1.68, 0.12). Th e values obtained in this way are not exact. However, we can use them \+ to get ranges for use with fsolve as follows. Note that we must pick a region small enough about each to insure that we don't pick up other \+ critical points by mistake. For example, in the case of the upper peak surely x lies in the range 1..3 and y lies in the range 2.5..3.5. Usi ng these ranges we find the values to 10 decimals as follows:" }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 52 "s1:=fsolve(\{fx=0,fy=0\},\{x,y\}, \{x=1..3,y=2.5..3.5\}); " }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 84 "Using a similar analysis we find t he (x,y)-coordinates of the lower peak as follows:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 52 "s2:=fsolve(\{fx=0,fy=0\},\{x,y\}, \{x=1..2. 5,y=-.5...5\});" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 325 "Now s1 gives \+ the x and y coordinates of the upper peak and s2 gives the x and y coo rdinates of the lower peak. We can obtain the z coordinates of the two peaks by the following methods. Recall that f is an expression and no t a function so we cannot simply take f(1.768191887,0.09966865249). L et's see what s1, s2, and f are:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 10 "s1;\ns2;\nf;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 74 " We can evaluate f at the each of these solutions by the following meth ods:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 45 "z1:=evalf(subs(s1,f ));\nz2:=evalf(subs(s2,f));" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 56 "An alternative way to obtain these results is by use of " }{TEXT 402 5 " eval " }{TEXT -1 20 "as in the following:" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 15 "Z1:=eval(f,s1);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 15 "Z2:=eval(f,s2);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 113 "We can obtain the (x,y,z) coordinates of the two peaks by the fol lowing substitutions and applications of evalf: " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 63 "peak1:=evalf(subs(s1,[x,y,f]));\npeak2:=evalf (subs(s2,[x,y,f]));" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 45 "Alternativ ely, we can obtain this as follows:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 49 "Peak1:=eval([x,y,f],s1);\nPeak2:=eval([x,y,f],s2);" } }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 23 "Overview of the various" }{TEXT 350 1 " " }{TEXT -1 16 "solve procedures" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 314 "Below we will discuss the followi ng Maple procedures to solve different kinds of equations. Note that, \+ as is the case for mathematicians in general, Maple is often unable to solve a given equation. In that case Maple usually return NULL or not hing. We give first a very brief description of the various commands. \+ " }{TEXT 351 73 "All of these descriptions should have the words \"wh en possible\" appended." }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }} {PARA 0 "" 0 "" {TEXT 257 5 "solve" }{TEXT -1 17 " is used to give " } {TEXT 263 15 "exact solutions" }{TEXT -1 40 " of an equation or system of equation\n \n" }{TEXT 258 6 "fsolve" }{TEXT -1 17 " is used to giv e " }{TEXT 264 24 "floating point solutions" }{TEXT -1 39 " to equatio ns or systems of equations\n\n" }{TEXT 259 6 "isolve" }{TEXT -1 8 " so lves " }{TEXT 265 21 "Diophantine equations" }{TEXT -1 36 ", i.e., equ ations over the integers." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 " " 0 "" {TEXT 358 6 "msolve" }{TEXT -1 8 " solves " }{TEXT 359 36 "equa tions over the integers modulo n" }{TEXT -1 1 "." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT 260 6 "rsolve" }{TEXT -1 8 " sol ves " }{TEXT 266 20 "recurrence equations" }{TEXT -1 7 " (aka, " } {TEXT 267 20 "difference equations" }{TEXT -1 23 "). We will see examp les" }}{PARA 0 "" 0 "" {TEXT -1 53 "of this below in case you don't kn ow what this means." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 " " {TEXT 261 6 "dsolve" }{TEXT -1 8 " solves " }{TEXT 268 22 "different ial equations" }{TEXT -1 1 "." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }} {PARA 0 "" 0 "" {TEXT 450 11 "LinearSolve" }{TEXT -1 8 " solves " } {TEXT 269 16 "matrix equations" }{TEXT -1 1 "." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT 262 14 "Linsolve mod n" }{TEXT -1 8 " solves " }{TEXT 270 46 "matrix equations over the integers modu lo n.\n\n" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 55 "Below we discuss eac h of these commands in more detail:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 8 "solve " }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 478 "R ecall that solve attempts to find an exact solution for an equation or system of equations. For polynomials in one variable of degrees 2,3,a nd 4 there is always a solution \"by radicals\", but it may be difficu lt to interpret for degrees 3 and 4. Sometimes polynomials of degrees \+ > 4 can be solved by radicals but as Galois showed there are polynomi als of degree n for each n greater than 4 which are not solvable by ra dicals. We first consider the general quadratic polynomial." }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 18 "poly:=a*x^2+b*x+c;" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 10 "Note that " }{TEXT 273 10 "solve(p ,x)" }{TEXT -1 5 " and " }{TEXT 274 12 "solve(p=0,x)" }{TEXT -1 67 " h ave the same meaning to Maple. Maple knows the quadratic formula:" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "solve(poly,x);" }{TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 151 "It is a good idea to always put braces \{ \} around the variable. This tells Maple to return the solutions as sets of equations. Making it easier to use " }{TEXT 424 4 "subs" }{TEXT -1 2 ", " }{TEXT 425 4 "eval" }{TEXT -1 6 " , or " }{TEXT 426 6 "assign" }{TEXT -1 35 " to us e the solutions. For example:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 21 "Sol:=solve(poly,\{x\});" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 7 "Sol[1];" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 7 "Sol[2];" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 53 "We now check the solutions. Note t hat we need to use " }{TEXT 280 8 "simplify" }{TEXT -1 34 " to see tha t we actually obtain 0." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 18 " eval(poly,Sol[1]);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "simpl ify(%);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 19 "eval(poly,Sol[2] ); " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "simplify(%);" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 405 "Maple does know an analogue of th e quadratic formula for 3rd and 4th degree polynomials, but they are s o complicated that they are not very useful for most purposes: To see \+ the 3th degree general case formula use the command. Replace the colon by a semi-colon before executing. After you view the mess, replace th e semi-colon by a colon and re-execute to remove the messy out put. DO NOT print it out.\n >" }{MPLTEXT 1 0 36 "solve(a*x^3 + b*x^2 + c*x + d, \{x\}):" }{TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 304 "We can o btain a formula similar to the above formula for the roots of a 4-th \+ degree polynomial, but is it too complicated to be of much use. If you really want to see it, replace the colon in the next command by a sem i-colon and execute. Then reverse the replacement as above to remove t he messy output." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 47 "solve(a *x^4+b*x^3+c*x^2+d*x+e,x):\nallvalues(%):" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 43 "To keep things mo re manageable let's try a " }{TEXT 352 8 "specific" }{TEXT -1 77 " 4th degree polynomial. We will write it as an equation and give it the na me " }{TEXT 451 3 "eqn" }{TEXT -1 2 ".\n" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 29 "eqn := x^3 - x^2 + x + 1=0; " }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 20 "X:=solve( eqn, x); " }{TEXT -1 54 "Give the s equence of solutions a name, in this case X." }}}{EXCHG {PARA 0 "" 0 " " {TEXT -1 17 "Note that X is a " }{TEXT 281 8 "sequence" }{TEXT -1 157 " of solutions since we used x instead of \{x\} for the second arg ument to solve. To count the number of solutions we must turn the sequ ence into a list or set." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 11 "nops([X]); " }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 122 "We can put the s olutions in a somewhat nicer form by removing all the square roots fro m the denominator via the procedure " }{TEXT 353 11 "rationalize" } {TEXT -1 108 ". Recall that I is the square root of -1. At the same t ime we assign the i-th root to the indexed variable " }{XPPEDIT 18 0 " r[i];" "6#&%\"rG6#%\"iG" }{TEXT -1 1 "." }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 119 "for i from 1 to 3 do \nr[i]:=rationalize(X[i]); \nprint(`----------------------- -------------------------------`); \nod;\n\n" }}}{EXCHG {PARA 0 "" 0 " " {TEXT -1 72 "To see the approximate numerical values of these soluti ons we use evalf:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 58 "for i \+ from 1 to nops([X]) do approx_r[i]:=evalf(X[i]); od;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 24 "Now let's try a specific" }{TEXT 354 8 " quinti c" }{TEXT -1 2 " (" }{TEXT 275 3 "aka" }{TEXT -1 4 ", a " }{TEXT 276 21 "5th degree polynomial" }{TEXT -1 2 ")." }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 20 "poly2:=2*x^5-10*x+2;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "SOL:=solve(poly2,x);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 2 ":\n" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 19 "Here the notation " }{XPPEDIT 18 0 "RootOf(_Z^5-5*_ Z+1,index = 1);" "6#-%'RootOfG6$,(*$%#_ZG\"\"&\"\"\"*&F)F*F(F*!\"\"F*F */%&indexGF*" }{TEXT -1 136 " indicate the \"first\" of the five roots of this polynomial. _Z is a variable introduced by Maple. To see wha t this root is approximate:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "evalf(SOL[1]);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 69 "We can see \+ approximations for all the roots by the following command:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 11 "evalf(SOL);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 68 "Or, if we want to spread them out to see them better we can do this:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 39 "for i f rom 1 to 5 do evalf(SOL[i]); od;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 51 "But sometimes we are lucky, as in the next example:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 18 "Y:=solve(x^5+1,x);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 66 "Let's spread them out a little so we can \+ look at them more easily:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 65 "for i from 1 to nops([Y]) do \nprintf(\"\\n\\n\"); \nprint(Y[i]); \+ \nod;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 13 "The procedure" }{TEXT 282 6 " solve" }{TEXT -1 5 " can " }{TEXT 452 9 "sometimes" }{TEXT -1 9 " solve a " }{TEXT 278 20 "system of equations," }{TEXT -1 90 " for \+ example here we solve a system of two linear equations in the three un knowns x, y, z:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 48 "solve(\{ 2*x+3*y+4*z = 4, 3*x+4*y+6*z=3\},\{x,y,z\});" }}}{EXCHG {PARA 0 "" 0 " " {TEXT -1 107 "A solution of the form z = z means that the variable \+ z is a free variable, that is, it can be any number.\n" }}{PARA 0 "" 0 "" {TEXT -1 10 "These are " }{TEXT 279 16 "linear equations" }{TEXT -1 140 " and therefore Maple can always solve such systems (if not too big). The next example is a system of non-linear equations. Note that we use " }{TEXT 427 13 "indets(syst1)" }{TEXT -1 56 " to obtain the v ariables (indeterminates) in the system " }{TEXT 428 5 "syst1" }{TEXT -1 1 "." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 53 "syst1:=\{x^2 + y^2 = 1, y = 3*x\};\nvars:=indets(syst 1);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 24 "sol1:=solve(syst1,va rs);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 22 "sol1:=allvalues(sol 1);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 25 "This gives two solutions \+ " }{TEXT 277 7 "sol1[1]" }{TEXT -1 5 " and " }{TEXT 283 7 "sol1[2]" } {TEXT -1 29 ". Let's check that they work:" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 20 "eval(syst1,sol1[1]);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "eval(syst1,sol1[2]);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 164 "Since in both cases we obtain true equations, we can con clude that the solutions are correct. If we plot the equations we can \+ get a better idea of what is going on:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 66 "plots[implicitplot](syst1,x=-3..3,y=-3..3, scaling = \+ constrained);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 115 "This is a line \+ and a circle. They intersect in two points. The coordinates of these p oints are obtained as follows:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 57 "Point1:=eval([x,y],sol1[1]);\nPoint2:=eval([x,y],sol1[2]);" }} }{EXCHG {PARA 0 "" 0 "" {TEXT -1 75 "Or, if we apply evalf we get floa ting point approximations of these points:" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 34 "evalf[3](Point1),evalf[3](Point2);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 36 "Let's look at another example where " } {TEXT 355 6 "RootOf" }{TEXT -1 34 " is given as part of the solution. " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 69 "restart:\neqn:=x^7 - 2* x^6 - 4*x^5 - x^3 + x^2 + 6*x+4;\nSol:=solve(%);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "nops([Sol]);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 127 "Note that solve gives 7 solutions. The first two are cle ar, but the others five solutions are the five roots of the polynomial " }{XPPEDIT 18 0 "_Z^5-_Z-1;" "6#,(*$%#_ZG\"\"&\"\"\"F%!\"\"F'F(" } {TEXT 271 3 ". " }{TEXT -1 45 "This means that any one of the five ro ots of " }{XPPEDIT 18 0 "_Z^5-_Z-1" "6#,(*$%#_ZG\"\"&\"\"\"F%!\"\"F'F( " }{TEXT 356 1 " " }{TEXT -1 50 "is a solution. Note that Maple uses \+ the variable " }{TEXT 357 2 "_Z" }{TEXT -1 279 " in such cases. In ge neral, when Maple introduces variables they begin with an underscore i n order to avoid variables that the user might wish to introduce. This degree 5 polynomial has no solutions by radicals. So it is not possib le to get precise solutions to this polynomial." }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 1 "\n" }{TEXT 453 56 "Comment for those who have had adv ance abstract algebra:" }{TEXT -1 447 " The proof that a general n-th \+ degree polynomial cannot be solved by radicals is proved in advanced a lgebra courses using Galois theory. Briefly to each polynomial p(x) o ver the rationals (say) Galois theory assigns a certain finite group G al(p). The main result is that p(x) can be solved using radicals if a nd only if the finite group Gal(p(x)) has a certain property (it is \" solvable\"). The following command computes the group Gal(x^5-x-1)." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 16 "galois(x^5-x-1);" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 50 "This shows that the galois group of x^5 - x -1 is " } {XPPEDIT 18 0 "S[5];" "6#&%\"SG6#\"\"&" }{TEXT -1 24 " which is known \+ to be a " }{TEXT 272 19 "non-solvable group " }{TEXT -1 261 "and hence x^5 - x - 1 cannot be \"solved by radicals\". (You will learn about s uch things if you take the second semester of Abstract Algebra.) For \+ more details on the meaning of the output of galois see the help page \+ for galois and follow the links found there." }}}}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 30 "solve for solving inequalities" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "" 0 "" {TEXT 284 13 "Inequalities " } {TEXT -1 9 "may also " }{TEXT 286 9 "sometimes" }{TEXT -1 25 " be solv ed using Maple's " }{TEXT 285 5 "solve" }{TEXT -1 159 " procedure. If \+ the inequalities become very complicated don't expect Maple to be abl e to solve them. Here is an example where Maple is able to get the ans wer." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "restart:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 27 "poly:=5*x^3-30*x^2+55*x-30;" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "solve(poly > 0 , x);" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 61 "Ploting the expression, we see tha t the solution looks right:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 21 "plot(poly,x=.5..3.5);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 57 "Here 's another use of solve with inequalities. Note that " }{XPPEDIT 18 0 "x^2 = 10;" "6#/*$%\"xG\"\"#\"#5" }{TEXT -1 99 " has two roots, one po sitive and one negative. We can have Maple select the positive one if \+ needed:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 44 "solve(\{x^2=10,x >0\},\{x\});\nconvert(%,radical);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 20 "Or the negative one:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 44 "solve(\{x^2=10,x<0\},\{x\});\nconvert(%,radical);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 6 "fs olve" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 74 "As we have see before we can approximate the roots of a polynom ial using :" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 30 "fsolve(x^5-x ^3+2*x^2-2*x-4,x);" }}}{EXCHG {PARA 15 "" 0 "" {TEXT -1 24 "For a gene ral equation, " }{TEXT 337 46 "fsolve attempts to compute a single rea l root." }{TEXT -1 46 " However, for polynomials it will compute all \+ " }{TEXT 454 4 "real" }{TEXT -1 74 " (non-complex) roots, although ex ceptionally ill-conditioned polynomials " }{TEXT 338 35 "may cause fso lve to miss some roots" }{TEXT -1 2 ". " }}{PARA 15 "" 0 "" {TEXT -1 11 "To compute " }{TEXT 341 25 "all roots of a polynomial" }{TEXT -1 51 " over the field of complex numbers, use the option " }{TEXT 342 7 "complex" }{TEXT -1 30 " as in the following example: " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 38 "fsolve (x^5-x^3+2*x^2-2*x-4,x,complex);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT 334 55 "Some solutions may be lost when t he equation contains " }{TEXT 344 14 "transcendental" }{TEXT 343 1 " \+ " }{TEXT 345 9 "functions" }{TEXT 346 1 " " }{TEXT 347 90 "(sin, cos, \+ exp, ln, etc..). Consider the following example: We want to solve the \+ equation " }{XPPEDIT 18 0 "sin(x) = x^2;" "6#/-%$sinG6#%\"xG*$F'\"\"# " }{TEXT -1 48 ". To see what to expect, let's plot sin(x) and " } {XPPEDIT 18 0 "x^2;" "6#*$%\"xG\"\"#" }{TEXT -1 67 ". We want to find the value of x where these two curves intersect." }}}{EXCHG {PARA 0 " > " 0 "" {MPLTEXT 1 0 54 "plot(\{sin(x),x^2\},x=-2..2,color=BLACK, thi ckness = 2);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 182 "We can see that \+ there are two solutions for x between 0 and 1. Clearly x = 0 is one so lution. We seek the other solution. The following three methods fail t o find the other solution." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 25 "solve(sin(x) = x^2,\{x\}); " }{TEXT -1 25 "This is not very helpfu l." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 25 "fsolve(sin(x) = x^2, \{x\});" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 33 "fsolve(sin(x) = \+ x^2,\{x\},x=-2..2);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 111 "But we ge t the other solution by specifying a range where the second root is lo cated and the first root is not:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 37 "fsolve(sin(x) = x^2,\{x\},x= (1/2)..1);" }}}{EXCHG {PARA 258 "" 0 "" {TEXT -1 0 "" }}{PARA 258 "" 0 "" {TEXT -1 44 "Use o f fsolve to solve systems of equations:" }{TEXT 339 1 " " }{TEXT 340 22 "We saw a few examples " }{TEXT 348 142 "of this in the last lectur e on finding critical points of z = f(x,y) by finding places where bot h partials are zero. Here is another example: " }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 42 "syst : = \{ x^2 + y^2 = 25, y = x^2 - 5 \}; " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "vars:=indets(syst); " }{TEXT 349 6 "indets" }{TEXT -1 70 " is sometimes useful if you don't know the variables in the equ ations." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 17 "solve(syst,vars) ;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 109 "Note that there appears to \+ be four solutions, but two solutions are the same. If we plot the equa tions using " }{TEXT 335 12 "implicitplot" }{TEXT -1 8 " we can " } {TEXT 336 3 "see" }{TEXT -1 114 " the solutions. Note that if the para bola were moved down just a bit there would be 4 instead of just 3 sol utions." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "with(plots):" }} }{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 88 "implicitplot(syst,x=-10..10 ,y=-10..10,numpoints=1000,\nscaling=CONSTRAINED, thickness=2);" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 0 "" }}}}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 6 "isolve" }} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "restart:" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "" 0 "" {TEXT 287 31 "Solving for integ er solutions: " }{TEXT -1 87 " Maple can --with limited abilities --so lve some equations for integer solutions using " }{TEXT 288 8 "isolve. " }{TEXT 360 26 "Such equations are called " }{TEXT 362 21 "Diophanti ne equations" }{TEXT 363 1 "." }{TEXT 361 2 " " }{TEXT 364 467 "The s olution of such equations is a difficult area of number theory. Where \+ or not such an algorithm exists was stated as Hilbert's 10th Problem. \+ Yuri Matiyasevich proved that there is no algorithm that will determi ne whether or not an arbitrary polynomial equations has integral solut ions. Of course, for some polynomial equations there are solution, bu t there is no algorithm that will settle the question for all polynomi als. For more details do a web search for " }{TEXT 455 22 "Hilbert's 1 0th Problem" }{TEXT 456 95 ".\n\nNevertheless, a few can be solved. H ere's a simple example. Note that nothing is returned!\n" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "isolve(3*x+12*y=7);\n" }}{PARA 0 " " 0 "" {TEXT -1 34 "There are no integer solutions to " }{TEXT 289 11 "3*x+12*y=7." }{TEXT -1 167 " ( We can see this since if there were in teger solutions x and y, 7 would have to be divisible by 3.). So Maple returns nothing. Here's an equation that has solutions:" }}{PARA 0 " " 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 22 "isol ve (3*x+12*y=15);\n" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 211 "Note that _Z1 is a free variable generated by Maple. It can be any integer val ue. We can also specify what we want for the free variable by the foll owing means. In this case we specify that we want it to be t.\n" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 28 "X:=isolve(3*x+12*y=15,\{t\}) ;\n" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 89 "The following technique wi ll allow us to generate some of the infinitely many solutions. " } {TEXT 365 63 "After generating each solution we check that it is a sol ution. " }{TEXT -1 106 "Note that we write the equation in the form 3* x+12*x-15, so that if we evaluation at a solution we get 0." }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 75 "for a from -3 to 3 do\n Y[a ]:=subs(t=a,X); \n eval(3*x+12*y - 15,Y[a]);\nod;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 31 "Consider the following example:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 18 "isolve(x^3+y^2=2);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 57 "\nNote that here Maple fails to find the obvious sol ution " }{TEXT 290 9 "x = y = 1" }{TEXT -1 34 ". Here's one that it \+ can solve. " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "isolve(x^2+y^2 = 2);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 24 "Compare with the use of " }{TEXT 429 5 "solve" }{TEXT -1 23 " for the same equation:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 19 "solve(x^2+y^2 = 2);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 " " }}}}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 6 "rsolve" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 256 "" 0 "" {TEXT -1 8 "Solving " }{TEXT 295 20 "recurrence equations" }{TEXT -1 2 " (" }{TEXT 366 4 "aka," } {TEXT -1 1 " " }{TEXT 296 20 "difference equations" }{TEXT -1 2 "):" } }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 90 " An example of a recurrence equation is the famous equation defining th e Fibonacci numbers:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 " " {TEXT -1 10 " " }{TEXT 291 50 "F(n) = F(n-1) + F(n-2) wit h F(0) = 0 and F(1)=1" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 178 "Note each such \"recurrence equation\" usually come s with an equation and one or more initial conditions. In this case th e equations F(0)=0 and F(1) = 1 are the initial conditions." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 27 "Many su ch equations can be " }{TEXT 293 6 "solved" }{TEXT -1 16 " by Maple us ing " }{TEXT 292 6 "rsolve" }{TEXT -1 68 ". Here are some examples, st arting with the Fibonacci recurrence. " }{TEXT 294 28 "By solving su ch an equation " }{TEXT 297 20 "we mean obtaining a " }{TEXT 430 7 "fo rmula" }{TEXT 431 75 " for the value of F(n)--as opposed to writing a procedure to compute F(n)." }{TEXT -1 134 "\n\nOne can learn more abo ut such matters in a combinatorics course. Look closely at the followi ng syntax for solving such a recurrence." }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 53 "fib:=rsolve (\{F(n)=F(n-1)+F(n-2),F(0)=0,F(1)=1\},F(n));" }}}{EXCHG {PARA 0 "" 0 " " {TEXT -1 104 "\nNote this gives us a closed form for F(n). We can dr ess it up and turn it into a functions as follows:" }}{PARA 0 "" 0 " " {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 22 "fib:=rati onalize(fib);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "Fib:=unapp ly(fib,n);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 155 "We need to rationalize again after we apply the function Fib(n) in order to obtain an integer as output. Otherwise we get an e xpression involving radicals." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 34 "Fibonacci:=n->rationalize(Fi b(n));" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 69 "Now we show that this g ives the usual sequence of Fibonacci numbers:\n" }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 26 "seq(Fibonacci(n),n=0..20);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 42 "Here's another re currence Maple can solve:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 66 "fun:=rsolve( \{f(n)=2*f(n-1) + 3*f( n-2) + n, f(0)=0,f(1)=1\}, f(k));" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "Fun:=unapply(fun,k);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 71 "Now we can generate the sequence of values for k = 0, 1, \+ 2, . . . , 15:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "seq(Fun(k ),k=0..15);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 184 "One can, of cours e, write a recursive procedure to compute the values of a function giv en by a recurrence, but one is usually happier to find a formula for t he function as we just did." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 6 "msolve" }}{PARA 0 "" 0 " " {TEXT -1 0 "" }}{EXCHG {PARA 0 "" 0 "" {TEXT 298 7 "msolve " }{TEXT 311 83 "is used to solve equations over the ring of integers modulo m \+ where m is an integer" }{TEXT -1 15 ". We first use " }{TEXT 299 7 "ms olve " }{TEXT -1 22 "to solve the equation " }{TEXT 300 21 "x^3 = 2 \+ modulo 5. " }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 23 "Sol:=msolve(x^3=2, 5); " }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 20 "We check the answer:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "subs(Sol,x^3) mod 5;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 17 "Another example:\n" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 17 "msolve(7^n=5,11);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 187 "Here there are infinitely many so lutions. One for each integral value of the variable _Z1. [Note here M aple uses _Z1 since _Z was used above.\n\nThe next example gives only one solution:\n" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 24 "msolve (x^3+4*x^2+x+5,7);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 247 "We next fa ctor the same polynomial over the integers modulo 7. Note that for thi s factorization we see that -1 is a root. Note that -1 is the same as \+ 6 modulo 7. Also since the other factor is irreducible modulo 7, x= 6 \+ is the only root modulo 7.\n" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 28 "Factor(x^3+4*x^2+x+5) mod 7;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 2 "\n\n" }}}}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 6 "dsolve" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "" 0 "" {TEXT 313 12 "The command " }{TEXT 315 6 "dsolve" }{TEXT 314 56 " is used to solve \+ ODE's (ordinary differential equation)" }{TEXT 312 1 "." }{TEXT -1 89 " Maple has many tool for solving differential equations. There is an entire book called " }{TEXT 301 36 "Differential Equations With Maple , " }{TEXT -1 17 "by K. R. Coombes," }{TEXT 302 7 " et al," }{TEXT -1 46 " on this subject. Maple has a packages called " }{TEXT 303 7 "D Etools" }{TEXT -1 5 " and " }{TEXT 305 8 "PDEtools" }{TEXT -1 39 " whi ch may be loaded with the commands " }{TEXT 304 13 "with(DEtools)" } {TEXT -1 5 " and " }{TEXT 306 14 "with(PDEtools)" }{TEXT -1 142 ". Her e we give just a few examples that don't require these packages. Some \+ of the DE courses at USF use Maple to solve differential equations." } }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 53 " Maple 5, 6 and 7 uses the partial derivative symbol " }{XPPEDIT 18 0 "Diff(x,t);" "6#-%%DiffG6$%\"xG%\"tG" }{TEXT -1 22 " instead of the us ual " }{XPPEDIT 18 0 "dx/dt" "6#*&%#dxG\"\"\"%#dtG!\"\"" }{TEXT -1 147 " notation even when x is a function of t alone. In Maple 8 this c osmetic defect has been corrected. We begin by solving the differenti al equation " }{XPPEDIT 18 0 "t*dx/dt" "6#*(%\"tG\"\"\"%#dxGF%%#dtG!\" \"" }{TEXT -1 5 " = " }{XPPEDIT 18 0 "x^2" "6#*$%\"xG\"\"#" }{TEXT -1 31 " with initial condition x(1) = " }{XPPEDIT 18 0 "1" "6#\"\"\"" }{TEXT -1 83 ". Recall that this means we are seeking a function f tha t satisfies the conditions " }{XPPEDIT 18 0 "f(1) = 1;" "6#/-%\"fG6#\" \"\"F'" }{TEXT -1 6 " and " }{XPPEDIT 18 0 "t*diff(f(t),t) = f(t)^2; " "6#/*&%\"tG\"\"\"-%%diffG6$-%\"fG6#F%F%F&*$-F+6#F%\"\"#" }{TEXT -1 75 ". Note that by writing x(t) we are telling Maple that x is a funct ion of t." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "restart:" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 28 "eq:=t*diff(x(t),t) = x(t)^2; " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 18 "init_cond:=x(1)=1;" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 35 "Sol:=dsolve(\{eq,init_cond\} ,\{x(t)\});" }}}{EXCHG {PARA 0 "" 0 "" {TEXT 432 8 "Warning:" }{TEXT -1 180 " x(t) is of type function, but it is not of type procedure so \+ cannot be treated as a function in the mathematical sense. The solutio n is give the equation a name. Here we name it " }{TEXT 433 3 "Sol" } {TEXT -1 2 ". " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 9 "lhs(Sol); " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "whattype(%);" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 120 "Note that even if we use evalf we cannot substitute values for t in the expression x(t) to check the in itial condition.\n" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "evalf (x(1));" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 59 "Let's change this solu tion , i. e., the right hand side of " }{TEXT 434 3 "Sol" }{TEXT -1 20 ", into a procedure:\n" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 23 "f:=unapply(rhs(Sol),t);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 20 "\n Check the solution:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 26 "t*diff(f(t),t) = f(t)^2; \n" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 30 "Check the initial condition:\n" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 5 "f(1);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 101 "We can plot the sol ution. Noting that there is a vertical asymptote when ln(t) = 1, i.e., when t = e." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 41 "plot(f, 1..exp(1), 0..100, discont=true);" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 40 "Next we solve the second order equ ation " }{XPPEDIT 18 0 "d^2*y/(dx^2) = 9*y+2*sin(x);" "6#/*(%\"dG\"\"# %\"yG\"\"\"*$%#dxGF&!\"\",&*&\"\"*F(F'F(F(*&F&F(-%$sinG6#%\"xGF(F(" } {TEXT -1 136 " with initial conditions y(0) = 1 and y'(0)=0. Note tha t here we assume that y is a function of x. We tell Maple this by writ ing y(x).\n" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "restart:" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 36 "eq2:=diff(y(x),x$2)=9*y(x)+2*sin(x);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 32 "initial_conds:=y(0)=1,D(y)(0)=0;" } }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 33 "dsolve(\{eq2,initial_conds \},y(x));" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 21 "Change to a function :" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 21 "Y:=unapply(rhs(%),x);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 52 "plot(Y,0..1,xtickmarks=[0,.5,1],ytickmarks=[0,1,2]); " }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 174 "Note that if we leave out th e initial conditions Maple gives the answer in terms of two constants \+ _C1 and _C2 in this case. Choice of constants determines the initial v alues." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 17 "dsolve(eq2,y(x)); " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}}}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 23 "Indetermin ate functions" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "restart:" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 70 " Expressions of the form x(t), g(t), y(x), etc.. are sometimes called \+ " }{TEXT 367 23 "indeterminate functions" }{TEXT -1 43 " in Maple. As \+ we saw previously if you ask " }{MPLTEXT 1 0 16 "whattype(x(t)); " } {TEXT -1 13 "you will get " }{TEXT 369 8 "function" }{TEXT -1 68 ". Bu t this is NOT the same kind of function that we obtain with the " } {TEXT 457 14 "arrow notation" }{TEXT -1 2 ", " }{TEXT 370 7 "unapply" }{TEXT -1 4 " or " }{TEXT 371 4 "proc" }{TEXT -1 56 " ! So you have to be a little carefully dealing with it." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 15 "whattype(x(t));" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 56 "For example, if we differentiate z(w) with respect to w:" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "diff(z(w),w);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 3 "But" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "diff(z(w),x);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 37 "That is, Maple recognizes z(w) as an " }{TEXT 374 22 "indeterminate function" }{TEXT -1 287 " of w, but not a function of x. So even though it doesn 't know what z(w) is, it knows its derivative with respect to w should not be automatically reduced to 0. But it doesn't recognize it as a f unction of x so it gives the derivative with respect to x as 0. On the other hand, we have:\n" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 15 " diff(z(w,x),x);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 179 "You can use t his notation to do formal calculations with derivatives. (And that's w hat DE is all about.) For example, we see that Maple knows various rul es for taking derivatives:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 36 "Diff(z(w)*r(w),w)=diff(z(w)*r(w),w);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 44 "Diff(f(t)/g(t),t)=normal(diff(f(t)/g(t),t));" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 34 "Diff(f(g(t)),t) = diff(f(g(t )),t);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 136 "But as we know they ar e NOT really functions in the mathematical sense; that's why they are \+ called indeterminate functions. For example," }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "z(w):=2*w^2;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 5 "z(4);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 382 "Note th at there is nothing special about z and w. In DE one usually uses x(t) for an indeterminate function of t or, say, y(x) as an indeterminate \+ function of x. In ordinary usage in DE and many applications this nota tion is suppressed. That is, one writes dx/dt instead of d(x(t))/dt. \n\nBut to translate a differential equation such as dx/dt = 10x + sin (t) into maple write\n\n >" }{MPLTEXT 1 0 36 "eq:=diff(x(t),t) = 1 0*x(t) + sin(t);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 292 "\n\nThat is, each occurrence of x should be replaced by x(t). You can tell that t \+ is the independent variable since we take derivatives with respect to \+ t. The same would hold if we replace x by y and t by x. The output of \+ dsolve will have the form\n\n x(t) = some expression containin g t\n" }}{PARA 0 "" 0 "" {TEXT -1 83 "One way to convert this to a fun ction is, as we saw above, to give the output of " }{TEXT 372 6 "dso lve" }{TEXT -1 16 " a name such as " }{TEXT 373 3 "Sol" }{TEXT -1 72 " . Then this can be converted to a function, call it f, by the command: \n\n" }{TEXT 368 2 "> " }{MPLTEXT 1 0 57 "Sol:=dsolve(\{eq, x(0) =1\}, x(t)):\nf:=unapply(rhs(Sol),t); " }{TEXT -1 294 "\n\nThen in mathemati cal notation we say that x = f(t) is a solution to the differential eq uation. And you can use the usual means of plotting the function f or \+ doing whatever application you have in mind. After all the purpose of \+ solving a DE is to find a function that has some use (hopefully)." }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{SECT 1 {PARA 3 "" 0 " " {TEXT -1 11 "LinearSolve" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "restart:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "with(LinearAlg ebra):" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "" 0 "" {TEXT 310 14 "The procedure " }{TEXT 317 11 "LinearSolve" }{TEXT 458 135 " can be used to solve a linear equation Ax = b where A is a known Matrix, b is a known column Vector and x is an unknown column Vector. " }{TEXT 316 1 " " }{TEXT -1 23 "An example is given by\n" }}{PARA 0 " " 0 "" {TEXT -1 26 " " }{XPPEDIT 18 0 "matrix ([[1, 2], [3, 4], [4, 5]]);" "6#-%'matrixG6#7%7$\"\"\"\"\"#7$\"\"$\"\" %7$F,\"\"&" }{TEXT -1 1 " " }{XPPEDIT 18 0 "matrix([[x[1]], [x[2]]]); " "6#-%'matrixG6#7$7#&%\"xG6#\"\"\"7#&F)6#\"\"#" }{TEXT -1 4 " = " } {XPPEDIT 18 0 "matrix([[5], [11], [14]]);" "6#-%'matrixG6#7%7#\"\"&7# \"#67#\"#9" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 24 " Consider the following:" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 71 "v:=Vector([1,2]);\nb:=Vector ([5,11,14]);\nA:=Matrix([[1,2],[3,4],[4,5]]);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 1 " " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 4 "A.v;" }} }{EXCHG {PARA 0 "" 0 "" {TEXT -1 11 "Now we use " }{TEXT 307 16 "Linea rSolve(A,b)" }{TEXT -1 23 " to solve the equation " }{TEXT 309 7 "Ax = b:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "X:=LinearSolve(A,b); " }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 166 "Here we get a single solutio n. More typically one obtains infinitely many solutions. Here's an exa mple where there is an affine subspace of solutions to the equation " }{TEXT 308 7 "Ax = b." }{TEXT -1 1 "\n" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 43 "A:=RandomMatrix(2,4, generator=rand(0..5));" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 17 "b:=Vector([2,0]);" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "X:=LinearSolve(A,b);" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 65 "Here we get a two dimensional subs pace of solution. The variable " }{XPPEDIT 18 0 "_tO[3];" "6#&%$_tOG6# \"\"$" }{TEXT -1 5 " and " }{XPPEDIT 18 0 "_tO[4];" "6#&%$_tOG6#\"\"% " }{TEXT -1 67 " may take any real values. Note that in Maple one type s _tO[3] for " }{XPPEDIT 18 0 "_tO[3]" "6#&%$_tOG6#\"\"$" }{TEXT -1 117 ". A particular solution is obtained by setting these variables to 0 (or any other value): Let's check what type X is:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 15 "type(X,Vector);" }}}{EXCHG {PARA 0 "" 0 " " {TEXT -1 62 "To avoid typing in the indeterminates we can do the fol lowing:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "x:=indets(X);" } }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 78 "Using this we can convert X into a function of these two variables as follows:" }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 24 "f:=unapply(X,x[1],x[2]):" }}}{EXCHG {PARA 0 " " 0 "" {TEXT -1 151 "The above will not work properly in Maple 7. If \+ you are using Maple 7 use instead the following definition of f. It wo rks in both Maple 7 and Maple 8." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 34 "f:=(a,b)->eval(X,\{x[1]=a,x[2]=b\});" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 10 "w:=f(0,0);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 60 "Let's check th at w is a solution to Ax = b, by showing Aw=b." }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 4 "A.w;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 60 "We can find other solutions by putting in other values for " }{XPPEDIT 18 0 "_tO[3];" "6#&%$_tOG6#\"\"$" }{TEXT -1 5 " and " }{XPPEDIT 18 0 " _tO[4];" "6#&%$_tOG6#\"\"%" }{TEXT -1 14 ". For example:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 11 "w2:=f(1,3);" }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 5 "A.w2;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 67 "I n this way we can obtain as many solutions to Ax = b as we desire." }} }{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{SECT 1 {PARA 3 "" 0 " " {TEXT -1 24 "LeastSquares and simplex" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 80 "I just mention a couple of other procedures which will \" solve\" certain problems:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 " " 0 "" {TEXT -1 9 "The call " }{TEXT 324 18 "LeastSquares(A, b)" } {TEXT -1 40 " returns the vector that best satisfies " }{TEXT 325 5 "A x =b" }{TEXT -1 62 " in the least-squares sense. The result returned i s the vector" }{TEXT 326 2 " x" }{TEXT -1 17 " which minimizes " } {TEXT 460 13 "Norm(A.x-b,2)" }{TEXT -1 7 ". Here " }{TEXT 461 9 "Norm( v,2)" }{TEXT -1 37 " is the Euclidean norm of the vector " }{TEXT 462 1 "v" }{TEXT -1 32 ". This is a part of the package " }{TEXT 327 15 "L inearAlgebra. " }{TEXT 331 14 "It can be used" }{TEXT 332 1 " " } {TEXT -1 5 "when " }{TEXT 459 11 "LinearSolve" }{TEXT -1 20 " finds no solution. " }}{PARA 0 "" 0 "" {TEXT -1 5 "\nThe " }{TEXT 328 8 "simpl ex " }{TEXT -1 70 "package is a collection of routines for linear opti mization using the " }{TEXT 329 17 "simplex algorithm" }{TEXT -1 42 ". It is used after executing the command " }{TEXT 330 13 "with(simplex )" }{TEXT -1 6 ". See " }{TEXT 333 8 "?simplex" }{TEXT -1 14 " for exa mples." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 38 "Assign ment 9, Due Tuesday, November 12" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }} {EXCHG {PARA 0 "" 0 "" {TEXT -1 1 " " }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }{TEXT 320 9 "Problem 1" }{TEXT -1 13 ". \n\n(a) Find " } {TEXT 375 17 "positive integers" }{TEXT -1 22 " x, y, z such that \n \n" }{XPPEDIT 18 0 "22*x+33*y+55*z = 28129200;" "6#/,(*&\"#A\"\"\"%\"x GF'F'*&\"#LF'%\"yGF'F'*&\"#bF'%\"zGF'F'\")+#H\"G" }{TEXT -1 21 " \n\nu sing the command " }{TEXT 323 6 "isolve" }{TEXT -1 122 " and whatever \+ else is required. After finding the solution, check that it actually \+ is a solution. [Note that after using " }{TEXT 379 6 "isolve" }{TEXT -1 114 " you will have to inspect the solutions given and choose appro priate values for the free variables that will give " }{TEXT 376 8 "po sitive" }{TEXT -1 108 " integer solutions. That is, find x, y and z th at satisfy the equation and have: x > 0, y > 0, z > 0.]\n\n(b) " } {TEXT 380 4 "Find" }{TEXT -1 5 " and " }{TEXT 381 5 "check" }{TEXT -1 1 " " }{TEXT 319 21 "10 distinct solutions" }{TEXT -1 23 " to the matr ix equation" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 6 " " }{XPPEDIT 18 0 "matrix([[1, 2, 3, 4], [5, 6, 7, 8]]);" " 6#-%'matrixG6#7$7&\"\"\"\"\"#\"\"$\"\"%7&\"\"&\"\"'\"\"(\"\")" }{TEXT -1 1 " " }{XPPEDIT 18 0 "matrix([[x[1]], [x[2]], [x[3]], [x[4]]]);" "6 #-%'matrixG6#7&7#&%\"xG6#\"\"\"7#&F)6#\"\"#7#&F)6#\"\"$7#&F)6#\"\"%" } {TEXT -1 4 " = " }{XPPEDIT 18 0 "matrix([[10], [10]]);" "6#-%'matrixG 6#7$7#\"#57#F(" }{TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }} {PARA 0 "" 0 "" {TEXT -1 19 "using the command " }{TEXT 435 11 "Linea rSolve" }{TEXT -1 81 " and whatever else is needed. Put the 10 solutio ns in a set and exhibit the set. " }{TEXT 463 24 "Use a do loop to do \+ this" }{TEXT -1 1 "." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 " " {TEXT 404 10 "Problem 2." }{TEXT -1 2 " " }{TEXT 409 3 "(a)" } {TEXT -1 112 " Plot the graph of the following function. If you choose your ranges appropriately you will see two \"mountains\"." }{TEXT 410 2 " " }{TEXT 464 130 "Copy and paste in the formula, making neces sary changes. For example, replace the left side g(x,y) by something m ore appropriate. " }}{PARA 0 "" 0 "" {TEXT -1 1 " " }}{PARA 0 "" 0 "" {TEXT -1 1 " " }{XPPEDIT 18 0 "g(x,y) = (3*x^2*y^2+4*x^2*y+21*x^2-4*x* y^2-72*x*y-128*x+21*y^2+128*y+297)/((x^2+2*x+2)*(y^2-2*y+2)*(x^2-8*x+1 7)*(y^2+8*y+17));" "6#/-%\"gG6$%\"xG%\"yG*&,4*(\"\"$\"\"\"*$F'\"\"#F-F (F/F-*(\"\"%F-*$F'F/F-F(F-F-*&\"#@F-*$F'F/F-F-*(F1F-F'F-F(F/!\"\"*(\"# sF-F'F-F(F-F7*&\"$G\"F-F'F-F7*&F4F-*$F(F/F-F-*&F;F-F(F-F-\"$(HF-F-**,( *$F'F/F-*&F/F-F'F-F-F/F-F-,(*$F(F/F-*&F/F-F(F-F7F/F-F-,(*$F'F/F-*&\"\" )F-F'F-F7\"#