{VERSION 5 0 "APPLE_PPC_MAC" "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 0 1 0 0 0 0 0 0 0 1 }{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 1 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 272 "" 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0 0 0 0 0 0 0 0 }{CSTYLE "" -1 457 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 458 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{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 }{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 398 4 "subs" }{TEXT -1 49 " (substitution) is best. 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=3,poly1);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 70 "We ca n put things back to their original values 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=3,poly1);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 32 "As you know, we could also make " }{TEXT 428 5 "poly1" }{TEXT -1 73 " into a function (aka procedure) in three ways: But note that only using " }{TEXT 427 7 "unapply" }{TEXT -1 26 " can we avoid retyping i n " }{TEXT 429 5 "poly1" }{TEXT -1 2 ".\n" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 120 "f:=unapply(poly1,x);\ng:=x->x^2+1;\ng2:=x->poly1; \nh:=proc(x) x^2+1; end proc;\nh2:=proc(x) global poly1; poly1; end pr oc;\n\n" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 45 "f(5),g(5),g2(5), h(5),h2(5), subs(x=5,poly1); " }}}{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\}, pol y3);" }}}{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 s ubstitution with " }{TEXT 401 8 "matrices" }{TEXT -1 33 ": Things are \+ a little different:\n" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "res tart:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "with(linalg):" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 28 "A:=matrix([[x,y],[z,x^2]]); \n" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 61 "One might think the followi ng would change x to 2 and y to 3:" }}{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 29 "To see what A is we must use \+ " }{TEXT 402 5 "evalm" }{TEXT -1 4 " or " }{TEXT 405 4 "eval" }{TEXT -1 60 " (for evaluate matrix): But as you will see it doesn't work." } }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "eval(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 399 5 "lists" }{TEXT -1 5 " and " } {TEXT 400 4 "sets" }{TEXT -1 26 " there is no such problem:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 22 "s ubs(\{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 elements in a set.\n\nFor " }{TEXT 403 6 "tables" }{TEXT -1 47 " which are more like matrices we must also use " }{TEXT 404 4 "eva l" }{TEXT -1 75 " when doing a substitution. Here's an example. We cre ate first the table T:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 34 "T [1]:=green;\nT[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 12 "The command " } {TEXT 408 4 "eval" }{TEXT -1 16 " may be used to " }{TEXT 430 8 "evalu ate" }{TEXT -1 87 " an expression at particular values of variables in the expression, as in the following" }}}{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 48 "The fol lowing shows a subtle difference between " }{TEXT 406 4 "subs" }{TEXT -1 5 " and " }{TEXT 407 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 23 "expr2:=sin(x) + exp(y);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 22 "eval(expr2,\{x=0,y=2\});" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 22 "subs(\{x=0,y=2\},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 86 "Note that to s ee what 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 431 4 "eval" }{TEXT -1 4 " \+ or " }{TEXT 432 5 "evalm" }{TEXT -1 58 " to see the contents of A. Rec all the distinction between " }{TEXT 433 11 "whattype(A)" }{TEXT -1 5 " and " }{TEXT 434 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 435 11 "assign(x=2)" }{TEXT -1 16 " is the same as " }{TEXT 436 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 "" {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 "T he command " }{TEXT 409 6 "fsolve" }{TEXT -1 56 " can be used to solve an equation or set of equations-- " }{TEXT 410 6 "fsolve" }{TEXT -1 60 " gives an approximate floating point solution as opposed to " } {TEXT 411 6 "solve " }{TEXT -1 29 "which when possible gives an " } {TEXT 415 5 "exact" }{TEXT -1 10 " solution." }{TEXT 416 2 " " } {TEXT -1 40 "Note that often it is necessary to give " }{TEXT 437 6 "f solve" }{TEXT -1 61 " an interval where you expect a solution to be. \+ Here we use " }{TEXT 412 6 "fsolve" }{TEXT -1 2 ", " }{TEXT 413 6 "plo t3d" }{TEXT -1 5 " and " }{TEXT 414 12 "contourplot " }{TEXT -1 36 "to find the location of the peaks ( " }{TEXT 419 5 "a.k.a" }{TEXT -1 45 " local 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/ 5)*sin(x)^2*cos(y)^2;" "6#/-%\"fG6$%\"xG%\"yG*(-%$expG6#*&F'\"\"\"\"\" &!\"\"F.*$-%$sinG6#F'\"\"#F.-%$cosG6#F(F5" }{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 = -3 to 3 and y = -2 to 2." }}}{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 147 "Recall that if f is a function of two variables x and y then extr eme values (i.e., local (relative) maxima and minima) occur at points \+ where both " }{XPPEDIT 438 0 "diff(f(x,y),x) = 0;" "6#/-%%diffG6$-%\" fG6$%\"xG%\"yGF*\"\"!" }{TEXT -1 5 " and " }{XPPEDIT 439 0 "diff(f(x,y ),y) = 0;" "6#/-%%diffG6$-%\"fG6$%\"xG%\"yGF+\"\"!" }{TEXT -1 368 ". \+ Recall that at such points one may also have a saddle point. So one ne eds additional evidence to know what happens when both partials are ze ro for a particular point. We will consider such an example now. We \+ could use calculus analogues of the second derivative test, but for si mplicity here we will use the graph to identify the nature of the poin ts in question." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 259 " " 0 "" {TEXT -1 80 "Note that in the example below we define f as an e xpression and not a function.\n" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 31 "f:=exp(x/5)*sin(x)^2*cos(y)^2; " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 38 "plot3d(f,x=-3..3,y=-2..2, axes=boxed);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 335 "We can see two peaks (local maxima) in t he above picture. We also see several valleys and what seems to be som e saddle points. We need to be careful to distinguish the peaks from t he valleys and saddle points. Let's find the THREE coordinates of eac h 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 "fx:=diff(f,x); \nfy:=diff (f,y); " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 50 "s1:=fsolve(\{fx= 0,fy=0\},\{x,y\}, \{x=-3..3,y=-2..2\}); " }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 111 "Note that the above just gives use one solution we canno t be sure if it identifies a peak, pit or pass. Using " }{TEXT 417 11 "contourplot" }{TEXT -1 57 " we can get a better idea of where the \+ peaks are located:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 46 "conto urplot(f,x=-3..3,y=-2..2, filled = true);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 363 "Note that the coordinates of the peak on the right is a bout x = 1.67 and y = 0 which we found above. Note that if you click o n what seems to be the x=y coordinates of the peak on the left you wil l see the coordinates in the upper left corner of the worksheet. It se ems to be at about (-1.47, -0.03). To find the other peak use the inte rval x=-2..-1, y=-1/2..1/2:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 55 "s2:=fsolve(\{fx=0,fy=0\},\{x ,y\}, \{x=-2..-1,y=-1/2..1/2\}); " }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 267 "We can see that s1 gives the x and y coordinates of the peak on t he right and s2 gives the x and y coordinates of the peak on the left . We can obtain the z coordinates of the two peaks by the following su bstitutions. Note that f is an expression and not a function. " }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 10 "s1;\ns2;\nf;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 80 "We can evaluate f at the each of these so lutions by the following substitutions:" }}}{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 418 5 "eval " }{TEXT -1 20 "as in the f ollowing:" }}}{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 105 "We can obtain the coordinates of \+ the two peaks by the following 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 "Alternatively, we can obtain this as follows:" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 49 "Peak1:=eval([x,y,f],s1);\nPe ak2:=eval([x,y,f],s2);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 288 "Note t hat there are other places where both partials are zero. Looking at th e above formulas for the two partials you can see that they are both 0 when sin(x) = 0 or when cos(y) = 0. So there are infinitely many cri tical points. We can find the places of interest by examining the grap h." }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 84 "An alternative way to appro ximate the location of the peaks is to use the following:" }{MPLTEXT 1 0 1 " " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 60 "contourplot3d(f ,x=-3..3,y=-2..2, filled = true, axes=boxed);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 245 "If you rotate this plot you will have essentially the same view as the contour plot above. Also if you turn the plot an tak e a side view you can estimate the heights of the two peaks. This give s some confidence in the coordinates we found above." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 23 "Overview of the various" }{TEXT 362 1 " " }{TEXT -1 16 "solve procedu res" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 285 "Below we will discuss the following Maple procedures to \+ solve different kinds of equations. Note that, as in real life, Maple \+ is often unable to solve a given equation. In that case Maple usually \+ return NULL or nothing. We give first a very brief description of the \+ various commands. " }{TEXT 363 73 "All of these descriptions should h ave the words \"when possible\" appended." }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT 257 5 "solve" }{TEXT -1 17 " is \+ used to give " }{TEXT 264 15 "exact solutions" }{TEXT -1 40 " of an eq uation or system of equation\n \n" }{TEXT 258 6 "fsolve" }{TEXT -1 17 " is used to give " }{TEXT 265 24 "floating point solutions" }{TEXT -1 39 " to equations or systems of equations\n\n" }{TEXT 259 6 "isolve " }{TEXT -1 8 " solves " }{TEXT 266 21 "Diophantine equations" }{TEXT -1 36 ", i.e., equations over the integers." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT 372 6 "msolve" }{TEXT -1 8 " solves " }{TEXT 373 36 "equations over the integers modulo n" }{TEXT -1 1 "." } }{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT 260 6 "rsolve" }{TEXT -1 8 " solves " }{TEXT 267 20 "recurrence equations" }{TEXT -1 7 " (aka, " }{TEXT 268 20 "difference equations" }{TEXT -1 23 "). We w ill see examples" }}{PARA 0 "" 0 "" {TEXT -1 53 "of this below in case you don't know what this means." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }} {PARA 0 "" 0 "" {TEXT 261 6 "dsolve" }{TEXT -1 8 " solves " }{TEXT 269 22 "differential equations" }{TEXT -1 1 "." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT 262 8 "linsolve" }{TEXT -1 8 " s olves " }{TEXT 270 16 "matrix equations" }{TEXT -1 1 "." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT 263 14 "Linsolve mod n" } {TEXT -1 8 " solves " }{TEXT 271 46 "matrix equations over the integer s modulo n.\n\n" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 55 "Below we discu ss each 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 0 " " }{TEXT 273 27 "Using the procedure solve: " }{TEXT 275 1 " " }{TEXT -1 335 "We give some simple examples: Note that for polynomials of deg rees 2,3,and 4 there is always a solution \"by radicals\", but it may \+ be difficult to interpret for degrees 3 and 4. Sometimes polynomials o f degrees > 4 can be solved by radicals but as Galois showed there ar e polynomials of degrees greater than 4 not solvable by radicals." }}} {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 276 10 "solve(p ,x)" }{TEXT -1 5 " and " }{TEXT 277 12 "solve(p=0,x)" }{TEXT -1 68 " h ave the same meaning to Maple.\n\nMaple knows the quadratic formula:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "solve(poly,x);" }{TEXT -1 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 152 "It is a good idea to a lways put braces \{ \} around the variable. This forces Maple to retur n the solutions as sets of equations. Making it easier to use " } {TEXT 440 4 "subs" }{TEXT -1 2 ", " }{TEXT 441 4 "eval" }{TEXT -1 6 " \+ , or " }{TEXT 442 6 "assign" }{TEXT -1 35 " to use the solutions. For \+ example:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 21 "Sol:=solve(poly ,\{x\});" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 9 "Sol[1];\n\n" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 7 "Sol[2];" }}}{EXCHG {PARA 0 " " 0 "" {TEXT -1 53 "We now check the solutions. Note that we need to u se " }{TEXT 284 8 "simplify" }{TEXT -1 34 " to see that we actually ob tain 0." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 18 "eval(poly,Sol[1] );" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "simplify(%);" }}} {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 229 "Maple does know an analogue of the quadr atic formula for 3rd and 4th degree polynomials, but they are so compl icated that they are not very useful for most purposes: To see the 4th degree general case formula use the command\n\n >" }{MPLTEXT 1 0 45 "solve(a*x^4 + b*x^3 + c*x^2 + d*x + e, \{x\});\n" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 153 "We can obtain a \+ formula similar to the quadratic formula for the four roots of this eq uation. But as you can see it is too complicated to be of much use." } }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "allvalues(%);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 195 "Observe \+ that %1, %2, %3, etc are variables that Maple introduces to simplify t he output.\n\nLet's look at the general cubic. Note that in this case \+ Maple give the solutions directly without use of " }{TEXT 364 9 "allva lues" }{TEXT -1 51 " as above. But the answer is still not very useful ." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 36 "solve(a*x^3 + b*x^2 + c*x + d, \{x\});" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 44 "\nTo keep things more manageable let's tr y a " }{TEXT 365 8 "specific" }{TEXT -1 24 " 4th degree polynomial:\n " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 33 "eqn := 4*x^3 + 8*x^2 + \+ 4*x = 4; " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "X:=solve( eqn , x); " }{TEXT -1 54 "Give the sequence of solutions a name, in this \+ case X." }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 17 "Note that X is a " } {TEXT 285 8 "sequence" }{TEXT -1 157 " of solutions since we used x in stead of \{x\} for the second argument to solve. To count the number o f solutions we must turn the sequence 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 solutions in a somewhat nicer form b y removing all the square roots from the denominator via the procedure " }{TEXT 366 11 "rationalize" }{TEXT -1 42 ". Recall that I is the s quare root of -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]:=ratio nalize(X[i]); \nprint(`----------------------------------------------- -------`); \nod;\n\n" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 72 "To see th e approximate numerical values of these solutions we use evalf:" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 52 "for i from 1 to nops([X]) do rr[i]:=evalf(X[i]); od;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 24 "Now l et's try a specific" }{TEXT 367 8 " quintic" }{TEXT -1 2 " (" }{TEXT 279 3 "aka" }{TEXT -1 4 ", a " }{TEXT 280 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 22 "SOL:=solve(p oly2,\{x\});" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 " " {TEXT -1 10 "Note that " }{TEXT 278 9 "allvalues" }{TEXT -1 31 " get s us nothing in this case:\n" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 15 "rhs(SOL[1][1]);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "al lvalues(%);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 242 "This indicates th at there is no formula for getting the roots of this equation. The pro bability that this will be the case for a polynomial of degree >= 5 is very high. To get the approximate roots we can use the following comm and. Note that " }{TEXT 368 3 "map" }{TEXT -1 23 " is not necessary he re:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 11 "evalf(SOL);" }}} {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:=sol ve(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 286 6 " solve" }{TEXT -1 23 " can sometimes solv e a " }{TEXT 282 20 "system of equations," }{TEXT -1 89 " for example \+ here we solve a system of two linear equations in the three unknows 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 f ree variable, that is, it can be any number.\n" }}{PARA 0 "" 0 "" {TEXT -1 10 "These are " }{TEXT 283 16 "linear equations" }{TEXT -1 140 " and therefore Maple can always solve such systems (if not too bi g). The next example is a system of non-linear equations. Note that we use " }{TEXT 443 13 "indets(syst1)" }{TEXT -1 56 " to obtain the vari ables (indeterminates) in the system " }{TEXT 444 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 281 7 "sol1[1]" }{TEXT -1 5 " and " }{TEXT 287 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 clued 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 369 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 272 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 370 1 " " }{TEXT -1 50 "is a solution. Note that Maple uses \+ the variable " }{TEXT 371 2 "_Z" }{TEXT -1 278 " in such cases. In gen eral, when Maple introduces variables they begin with an underscore in order to avoid variables that the user might wish to introduce. This \+ degree 5 polynomial has no solutions by radicals. So it is not possibl e to get precise solutions to this polynomial." }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 1 "\n" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 67 "If you hav e had a little Galois Theory you can see that as follows:" }}}{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 "T his shows that the galois group of x^5 - x -1 is " }{XPPEDIT 18 0 "S[5 ];" "6#&%\"SG6#\"\"&" }{TEXT -1 3 " a " }{TEXT 274 19 "non-solvable gr oup " }{TEXT -1 142 "and hence x^5 - x - 1 cannot be \"solved by radic als\". (You will learn about such things if you take the second semest er of Abstract Algebra.)" }}}}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 30 "so lve for solving inequalities" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }} {EXCHG {PARA 0 "" 0 "" {TEXT 288 13 "Inequalities " }{TEXT -1 9 "may a lso " }{TEXT 290 9 "sometimes" }{TEXT -1 25 " be solved using Maple's \+ " }{TEXT 289 5 "solve" }{TEXT -1 31 " procedure. Here is an example:" }}}{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 that the s olution looks right:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 21 "plo t(poly,x=.5..3.5);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 57 "Here's anot her use of solve with inequalities. Note that " }{XPPEDIT 18 0 "x^2 = \+ 10;" "6#/*$%\"xG\"\"#\"#5" }{TEXT -1 99 " has two roots, one positive \+ 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 "fsolve" } }{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 74 "A s we have see before we can approximate the roots of a polynomial usin g :" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 18 "fsolve(x^5-x-1,x);" }}}{EXCHG {PARA 15 "" 0 "" {TEXT -1 24 "For a general equation, " } {TEXT 349 46 "fsolve attempts to compute a single real root." }{TEXT -1 124 " However, for polynomials it will compute all real (non-comple x) roots, although exceptionally ill-conditioned polynomials " } {TEXT 350 35 "may cause fsolve to miss some roots" }{TEXT -1 2 ". " }} {PARA 15 "" 0 "" {TEXT -1 11 "To compute " }{TEXT 353 25 "all roots of a polynomial" }{TEXT -1 51 " over the field of complex numbers, use t he option " }{TEXT 354 7 "complex" }{TEXT -1 30 " as in the following \+ example: " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 30 "fsolve(x^5 - x - 1,x,complex);" }}}{EXCHG {PARA 0 " " 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT 346 55 "Some solutions ma y be lost when the equation contains " }{TEXT 356 14 "transcendental " }{TEXT 355 1 " " }{TEXT 357 9 "functions" }{TEXT 358 1 " " }{TEXT 359 90 "(sin, cos, exp, ln, etc..). Consider the following example: We want to solve the equation " }{XPPEDIT 18 0 "sin(x) = x^2;" "6#/-%$si nG6#%\"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, thickness = 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 solution. We seek the other solution. The following thre e methods fail to 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 helpful." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 25 "fsolve (sin(x) = x^2,\{x\});" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 33 "fs olve(sin(x) = x^2,\{x\},x=-2..2);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 111 "But we get the other solution by specifying a range where the sec ond root is located 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 of fsolve to solve systems of equations:" }{TEXT 351 1 " " } {TEXT 352 22 "We saw a few examples " }{TEXT 360 146 "of this in the l ast lecture on finding critical points of z = f(x,y) by finding places where both partials are zero. Here are some more examples: " }}} {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 361 6 "indets" }{TEXT -1 70 " is sometimes useful if you don't k now the variables in the equations." }}}{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 solution s are the same. If we plot the equations using " }{TEXT 347 12 "implic itplot" }{TEXT -1 8 " we can " }{TEXT 348 3 "see" }{TEXT -1 114 " the \+ solutions. Note that if the parabola were moved down just a bit there \+ would be 4 instead of just 3 solutions." }}}{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=C ONSTRAINED, 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 291 31 "Solving for integer solutions: " }{TEXT -1 82 " Maple ca n with limited ablility solve some equations for integer solutions usi ng " }{TEXT 292 8 "isolve. " }{TEXT 374 26 "Such equations are called \+ " }{TEXT 376 21 "Diophantine equations" }{TEXT 377 1 "." }{TEXT 375 2 " " }{TEXT 378 432 "The solution of such equations is a difficult are a of number theory. Where or not such an algorithm exists was stated a s Hilbert's 10th Problem. Yuri Matiyasevich proved that there is no a lgorithm that will determine whether or not a polynomial equations has integral solutions. For more details do a web search for Hilbert's 1 0th Problem.\n\nNeverless, a few can be solved. Here's a simple examp le. 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 293 11 "3*x+12*y=7." } {TEXT -1 167 " ( We can see that since if there were integer solutions x and y, 7 would have to be divisible by 3.). So Maple returns nothin g. Here's an equation that has solutions:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 22 "isolve (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 value. We can also \+ specify what we want for the free variable by the following 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 will allow us to \+ generate some of the infinitely many solutions. " }{TEXT 379 62 "After generating each solution we check that it is a solution." }{TEXT -1 1 "\n" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 74 "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 fi nd the obvious solution " }{TEXT 294 9 "x = y = 1" }{TEXT -1 34 ". H ere'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 445 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 "rsol ve" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 256 "" 0 "" {TEXT -1 8 "Solving " }{TEXT 299 20 "recurrence equations" }{TEXT -1 2 " (" }{TEXT 380 4 "aka," }{TEXT -1 1 " " }{TEXT 300 20 "difference equation s" }{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 the Fibonacci numbers:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 10 " " }{TEXT 295 50 "F(n) = \+ F(n-1) + F(n-2) with F(0) = 0 and F(1)=1" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 178 "Note each such \"recurrence eq uation\" usually comes with an equation and one or more initial condit ions. In this case the equations F(0)=0 and F(1) = 1 are the initial c onditions." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 27 "Many such equations can be " }{TEXT 297 6 "solved" } {TEXT -1 16 " by Maple using " }{TEXT 296 6 "rsolve" }{TEXT -1 68 ". H ere are some examples, starting with the Fibonacci recurrence. " } {TEXT 298 28 "By solving such an equation " }{TEXT 301 20 "we mean obt aining a " }{TEXT 446 7 "formula" }{TEXT 447 75 " for the value of F( n)--as opposed to writing a procedure to compute F(n)." }{TEXT -1 66 " \n\nOne can learn more about such matters in a combinatorics course." }}}{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 clo sed form for F(n). We can dress 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:=rationalize(fib);" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 20 "Fib:=unapply(fib,n);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 155 "We need to rationalize a gain after we apply the function Fib(n) in order to obtain an integer \+ as output. Otherwise we get an expression involving radicals." }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 34 "Fibonacci:=n->rationalize(Fib(n));" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 69 "Now we show that this gives the usual sequence of Fibonac ci numbers:\n" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 26 "seq(Fibona cci(n),n=0..20);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 " " 0 "" {TEXT -1 42 "Here's another recurrence 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 sequ ence 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 course, write a recursive procedure to compu te the values of a function given by a recurrence, but one is usually \+ happier to find a formula for the 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 302 7 "msolve " }{TEXT 317 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 303 7 "msolve " }{TEXT -1 22 "to solve the equat ion " }{TEXT 304 17 "x^3 = 2 modulo 5" }{TEXT -1 1 ":" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 21 "a:=msolve(x^3=2, 5); " }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 20 "We check the answer:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 18 "subs( a,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 solutions. One for each integra l value of the variable _Z1. [Note here Maple uses _Z1 since _Z was u sed 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 factor the same polynomia l over the integers modulo 7. Note that for this 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 319 12 "The command " }{TEXT 321 6 "dsolve" }{TEXT 320 56 " is used to solve ODE's (ordinary differ ential equation)" }{TEXT 318 1 "." }{TEXT -1 89 " Maple has many tool for solving differential equations. There is an entire book called " }{TEXT 305 36 "Differential Equations With Maple, " }{TEXT -1 17 "by \+ K. R. Coombes," }{TEXT 306 7 " et al," }{TEXT -1 46 " on this subject. Maple has a packages called " }{TEXT 307 7 "DEtools" }{TEXT -1 5 " an d " }{TEXT 309 8 "PDEtools" }{TEXT -1 39 " which may be loaded with th e commands " }{TEXT 308 13 "with(DEtools)" }{TEXT -1 5 " and " }{TEXT 310 14 "with(PDEtools)" }{TEXT -1 142 ". Here we give just a few examp les that don't require these packages. Some of the DE courses at USF u se Maple to solve differential equations." }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 4 " " }}{PARA 0 "" 0 "" {TEXT -1 53 " Note that Maple uses the partial derivative symbol " }{XPPEDIT 18 0 "Diff(x,t);" "6#-%%Di ffG6$%\"xG%\"tG" }{TEXT -1 22 " instead of the usual " }{XPPEDIT 18 0 "dx/dt" "6#*&%#dxG\"\"\"%#dtG!\"\"" }{TEXT -1 148 " notation even when x is a function of t alone. [In Maple 8 this cosmetic defect will be \+ corrected.] We begin by solving the differential 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 in itial condition x(1) = " }{XPPEDIT 18 0 "1" "6#\"\"\"" }{TEXT -1 81 ". Recall that this means we are seeking a function that satisfies the c onditions " }{XPPEDIT 18 0 "f(1) = 1;" "6#/-%\"fG6#\"\"\"F'" }{TEXT -1 6 " and " }{XPPEDIT 18 0 "t*`f'`(t) = f(t)^2;" "6#/*&%\"tG\"\"\"-% #f'G6#F%F&*$-%\"fG6#F%\"\"#" }{TEXT -1 7 " where " }{XPPEDIT 18 0 "`f' `;" "6#%#f'G" }{TEXT -1 27 " denotes the derivative of " }{XPPEDIT 18 0 "f;" "6#%\"fG" }{TEXT -1 1 "." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "restart:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 28 "eq:=t*di ff(x(t),t) = x(t)^2;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 18 "ini t_cond:=x(1)=1;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 35 "Sol:=dso lve(\{eq,init_cond\},\{x(t)\});" }}}{EXCHG {PARA 0 "" 0 "" {TEXT 448 8 "Warning:" }{TEXT -1 177 " x(t) is of type function, but it is not o f type procedure so cannot be treated as a function in the mathematica l sense. The solution is give as an equation which we have named " } {TEXT 449 3 "Sol" }{TEXT -1 1 "." }}}{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 ev en if we use evalf we cannot substitute values for t in the expression x(t) to check the initial condition.\n" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "evalf(x(1));" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 59 " Let's change this solution , i. e., the right hand side of " }{TEXT 450 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 "\nCheck 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 condi tion:\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 p lot the solution. 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 secon d order equation " }{XPPEDIT 18 0 "diff(y,`$`(x,2)) = 9*y+2*sin(x);" " 6#/-%%diffG6$%\"yG-%\"$G6$%\"xG\"\"#,&*&\"\"*\"\"\"F'F0F0*&F,F0-%$sinG 6#F+F0F0" }{TEXT -1 100 " with initial conditions y(0) = 1 and y'(0)= 0. Note that here we assume that y is a function of 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:=unappl y(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 172 "Note that if we leave out the initial conditions Maple g ives the answer in terms of two constants C1 and C2 in this case. Choi ce of constants determines the initial values." }}}{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 "Indeterminate 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 381 23 "indeterminat e 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 383 8 "function" }{TEXT -1 84 ". But this is NOT the same kind o f function that we obtain with the arrow notation, " }{TEXT 384 7 "una pply" }{TEXT -1 4 " or " }{TEXT 385 4 "proc" }{TEXT -1 56 " ! So you h ave 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 388 22 "indeterminate f unction" }{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 function 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 this notation to do formal calculations with derivati ves. (And that's what DE is all about.) For example, we see that Maple knows various rules 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 w e know they are 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 358 " Note that there is nothing special about z and w. In DE one usually us es x(t) for an indeterminate function of t or, say, y(x) as an indeter minate function of x. In ordinary usage in DE this notation is suppres sed. That is, we write dx/dt instead of d(x(t))/dt.\n\nBut to transla te a differential equation such as dx/dt = 10x + sin(t) into maple wri te\n\n >" }{MPLTEXT 1 0 36 "eq:=diff(x(t),t) = 10*x(t) + sin(t);" }}{PARA 0 "" 0 "" {TEXT -1 302 "\n\nThat is, each occurrence of x shou ld be replaced by x(t). You can tell that t is the independent variabl e since we take derivatives with respect to t. The same would hold if \+ we replace x by y and t by x.\nNote also the output of dsolve will hav e the form\n\n x(t) = some expression containing t\n" }}{PARA 0 "" 0 "" {TEXT -1 83 "One way to convert this to a function is, as w e saw above, to give the output of " }{TEXT 386 6 "dsolve" }{TEXT -1 16 " a name such as " }{TEXT 387 3 "Sol" }{TEXT -1 72 ". Then this can be converted to a function, call it f, by the command:\n\n" }{TEXT 382 2 "> " }{MPLTEXT 1 0 24 "f:=unapply(rhs(Sol),t); " }{TEXT -1 294 " \n\nThen in mathematical notation we say that x = f(t) is a solution t o the differential equation. And you can use the usual means of plotti ng the function f or doing whatever application you have in mind. Afte r 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 8 "linsolve" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "restart:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "with(linalg):" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 " " 0 "" {TEXT 316 14 "The procedure " }{TEXT 323 8 "linsolve" }{TEXT 324 134 " can be used to solve a linear equation Ax = b where A is a k nown matrix, b is a known column vector and x is an unknow column vect or." }{TEXT 322 1 " " }{TEXT -1 23 "An example is given by\n" }}{PARA 0 "" 0 "" {TEXT -1 26 " " }{XPPEDIT 18 0 "mat rix([[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 133 "Note that although Maple write s a vector as a list, it treats it as a single column matrix for some \+ purposes. 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 25 "Note that the 2x2 matrix " }{TEXT 313 1 "A" }{TEXT -1 48 " cannot be multiplied times a 1 x 2 matrix. But " }{TEXT 314 1 "v" }{TEXT -1 7 ", as we" }} {PARA 0 "" 0 "" {TEXT -1 53 "said, is treated for this purpose as a 2 \+ x 1 matrix. " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "multiply(A, v);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 87 "But if we try to plot the \+ line from [0,0] to [1,2] using the following we get an error." }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 27 "plot([[0,0],v],style=line); " }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 49 "If we convert the vector v to a list we are okay:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 41 "plo t([[0,0],convert(v,list)],style=line);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 11 "Now we use " }{TEXT 311 13 "linsolve(A,b)" }{TEXT -1 23 " to solve the equation " }{TEXT 315 7 "Ax = b:" }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 17 "X:=linsolve(A,b);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 167 "Above we get a single solution. More typically one obtai ns infinitely many solutions. Here's an example where there is an affi ne subspace of solutions to the equation " }{TEXT 312 7 "Ax = b." } {TEXT -1 1 "\n" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "restart;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "with(linalg):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 39 "A:=randmatrix(2,4, entries=rand(0.. 5));" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 17 "b:=vector([2,0]);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 17 "X:=linsolve(A,b);" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 220 "Here we get a two dimensional sub space of solution. The variable t[1] and t[2] may take any real values . A particular solution is obtained by setting these variables to 0 (o r any other value): Let's check what type X is:" }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 29 "type(X,list);\ntype(X,vector);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 90 "So even though X looks like a list it is \+ not. However, we can easily convert it to a list:" }}}{EXCHG {PARA 0 " > " 0 "" {MPLTEXT 1 0 19 "Y:=convert(X,list);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 10 "indets(Y);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 28 "f:=unapply(Y,op(indets(Y)));" }}}{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 that w is a so lution to Ax = b, by showing Aw=b." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "multiply(A,w);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 86 "We can find other solutions by putting in other values for _t_1 an d _t_2. For example:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 11 "w2: =f(1,3);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 15 "multiply(A,w2); " }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 98 "Putting in specific values fo r t_1 and t_2 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 11 "LinearSolve" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }} {PARA 0 "" 0 "" {TEXT -1 59 "As mentioned earlier Maple has two linear algebra packages " }{TEXT 451 6 "linalg" }{TEXT -1 5 " and " }{TEXT 452 13 "LinearAlgebra" }{TEXT -1 316 ". The procedures in the two pack ages overlap quite a bit. However the package LinearAlgebra is best fo r large scale numerical calculations. If you have to do a lot of linea r algebra problems you may want to consider the LinearAlgebra package. In case you are interested in obtaining more details execute the com mand" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "restart:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 36 "?LinearAlgebra,General,linalgebragen" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 145 "I will just give a brief introduction to the package her e. One of the main differences is the way matrices and vectors are def ined and displayed." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "with (LinearAlgebra):" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 140 "To define a \+ Matrix (not matrix) in LinearAlgebra (not linalg) one may use one of t he following methods: First construct two column vectors:\n" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 29 "v[1]:=<1,2,3>;\nv[2]:=<4,5,6 >;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 58 "Construct the matrix with t hese column vectors as columns:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 16 "A:= ;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 35 "Const ruct another column vector, b:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 11 "b:=<5,7,9>;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 26 "Solve the \+ matrix equation " }{XPPEDIT 18 0 "A*x = b;" "6#/*&%\"AG\"\"\"%\"xGF&% \"bG" }{TEXT -1 1 "." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "x:= LinearSolve(A,b);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 23 "We check thi s solution:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "Multiply(A,x );" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 52 "Another example with anothe r way to define Matrices." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 33 "C:=Matrix([[1,2,3,4],[5,6,7,8]]);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 19 "b:=Vector([11,12]);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 22 "Sol:=LinearSolve(C,b);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 14 "The variables " }{XPPEDIT 18 0 "_t0[3];" "6#&%$_t0G6#\"\" $" }{TEXT -1 5 " and " }{XPPEDIT 18 0 "_t0[4];" "6#&%$_t0G6#\"\"%" } {TEXT -1 93 " are free variables they may take on any values. One way to get hold of them is as follows. " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 33 "indets(Sol);\nT:=convert(%,list);\n" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 81 "Now we substitute 0 for both variables and chec k whether or not it is a solution." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 29 "X:=eval(Sol,\{T[1]=0,T[2]=0\});" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "Multiply(C,X);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 21 "leastsqrs a nd simplex" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 80 "I just mention a cou ple of other procedures which will \"solve\" certain problems:" }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 9 "The call \+ " }{TEXT 332 15 "leastsqrs(A, b)" }{TEXT -1 40 " returns the vector th at best satisfies " }{TEXT 333 5 "Ax =b" }{TEXT -1 62 " in the least-s quares sense. The result returned is the vector" }{TEXT 334 2 " x" } {TEXT -1 17 " which minimizes " }{TEXT 335 15 "norm(A x - b, 2" } {TEXT -1 33 "). This is a part of the package " }{TEXT 336 8 "linalg. \+ " }{TEXT 343 14 "It can be used" }{TEXT 344 1 " " }{TEXT -1 5 "when " }{TEXT 337 8 "linsolve" }{TEXT -1 26 " finds no solution. Then, " } {TEXT 338 9 "leastsqrs" }{TEXT -1 41 " finds the best solution availab le. See " }{TEXT 339 10 "?leastsqrs" }{TEXT -1 44 " for examples. The re is a similar procedure " }{TEXT 453 12 "LeastSquares" }{TEXT -1 4 " in " }{TEXT 454 13 "LinearAlgebra" }{TEXT -1 7 ".\n\nThe " }{TEXT 340 8 "simplex " }{TEXT -1 70 "package is a collection of routines for linear optimization using the " }{TEXT 341 17 "simplex algorithm" } {TEXT -1 42 ". It is used after executing the command " }{TEXT 342 13 "with(simplex)" }{TEXT -1 5 ".See " }{TEXT 345 8 "?simplex" }{TEXT -1 14 " for examples." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{SECT 1 {PARA 3 "" 0 " " {TEXT -1 36 "Assignment 9, Due Wednesday, April 3" }}{PARA 0 "" 0 " " {TEXT -1 0 "" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 1 " " }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }{TEXT 327 9 "Problem 1" }{TEXT -1 13 ". \n\n(a) Find " }{TEXT 389 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\"\"\"%\"xGF'F'*&\"#LF'%\"yGF'F'*&\"#bF'%\"zGF'F'\")+#H\"G" } {TEXT -1 21 " \n\nusing the command " }{TEXT 330 6 "isolve" }{TEXT -1 55 " and whatever else is required. [Note that after using " }{TEXT 393 6 "isolve" }{TEXT -1 114 " you will have to inspect the solutions \+ given and choose appropriate values for the free variables that will g ive " }{TEXT 390 8 "positive" }{TEXT -1 108 " integer solutions. That \+ is, find x, y and z that satisfy the equation and have: x > 0, y > 0, \+ z > 0.]\n\n(b) " }{TEXT 394 4 "Find" }{TEXT -1 5 " and " }{TEXT 395 5 "check" }{TEXT -1 1 " " }{TEXT 326 21 "10 distinct solutions" }{TEXT -1 23 " to the matrix 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#-%'matrixG6#7$7#\"#57#F(" }{TEXT -1 0 "" }}{PARA 0 "" 0 " " {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 18 "using the command " } {TEXT 331 8 "linsolve" }{TEXT -1 4 " or " }{TEXT 455 11 "LinearSolve" }{TEXT -1 81 " and whatever else is needed. Put the 10 solutions in a \+ set and exhibit the set. " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 " " 0 "" {TEXT 420 10 "Problem 2." }{TEXT -1 2 " " }{TEXT 425 3 "(a)" } {TEXT -1 112 " Plot the graph of the following function. If you choose your ranges appropriately you will see two \"mountains\"." }{TEXT 426 1 " " }}{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+17)*(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 \"#