{VERSION 4 0 "IBM INTEL NT" "4.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 "" 0 1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 0 1 0 2 2 0 1 }{PSTYLE "Heading 2" -1 4 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 8 2 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 }} {SECT 0 {EXCHG {PARA 18 "" 0 "" {TEXT 256 9 "Lecture 9" }}}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 23 "Overview of the various" }{TEXT 363 1 " \+ " }{TEXT -1 16 "solve procedures" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 298 "In this lecture we will dis cuss the following methods to solve different kinds of equations using Maple. Note that, as in real life, Maple is often unable to solve a g iven equation. In that case Maple usually return NULL or nothing. We g ive first a very brief description of the various commands. " }{TEXT 364 73 "All of these descriptions should have the words \"when possibl e\" 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 equation 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 syste ms of equations\n\n" }{TEXT 259 6 "isolve" }{TEXT -1 8 " solves " } {TEXT 266 21 "Diophantine equations" }{TEXT -1 36 ", i.e., equations o ver the integers." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT 373 6 "msolve" }{TEXT -1 8 " solves " }{TEXT 374 36 "equations o ver the integers modulo m" }{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 will 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 equa tions" }{TEXT -1 1 "." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT 262 8 "linsolve" }{TEXT -1 8 " solves " }{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 integers modulo n.\n\n" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 53 "Now we discuss 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 proc edure solve: " }{TEXT 275 1 " " }{TEXT -1 335 "We give some simple exa mples: Note that for polynomials of degrees 2,3,and 4 there is always \+ a solution \"by radicals\", but it may be difficult to interpret for d egrees 3 and 4. Sometimes polynomials of degrees > 4 can be solved by \+ radicals but as Galois showed there are polynomials of degrees greate r 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 " have the same meaning to Ma ple.\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 202 "It is a good idea to always put braces \{ \} arou nd the variable. This forces Maple to return the solutions as sets of \+ equations. Making it easier to use substitution to verify the solution s. For example:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 21 "Sol:=sol ve(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 use " }{TEXT 284 8 "simplify" }{TEXT -1 34 " to see that we ac tually obtain 0." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 18 "eval(po ly,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 105 "Let's lo ok at the general cubic. Note that in this case Maple give the solutio ns directly without use of " }{TEXT 365 9 "allvalues" }{TEXT -1 51 " a s 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 "\n To keep things more manageable let's try a " }{TEXT 366 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 38 "Give th e sequence of solutions a name." }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 17 "Note that X is a " }{TEXT 285 8 "sequence" }{TEXT -1 157 " of solu tions since we used x instead of \{x\} for the second argument to solv e. To count the number of solutions we must turn the sequence into a l ist 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 by removing all the square roots from the denomi nator via the procedure " }{TEXT 367 11 "rationalize" }{TEXT -1 42 ". \+ Recall that I is the square root of -1." }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 120 "for i from 1 to 3 do \nprint(rationalize(X[i])); \nprint(`---------------------- --------------------------------`); \nod;\n\n" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 72 "To see the approximate numerical values of these solut ions we use evalf:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 52 "for i from 1 to nops([X]) do print(evalf(X[i])); od;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 24 "Now let's try a specific" }{TEXT 368 8 " quintic" } {TEXT -1 2 " (" }{TEXT 279 3 "aka" }{TEXT -1 4 ", a " }{TEXT 280 21 "5 th 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(poly2,\{x\});" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 10 "Note that " }{TEXT 278 9 "allvalues" }{TEXT -1 31 " gets 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 "allvalues(%);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 242 "This indicates that there is no formula for getting the \+ roots of this equation. The probability that this will be the case for a polynomial of degree >= 5 is very high. To get the approximate root s we can use the following command. Note that " }{TEXT 369 3 "map" } {TEXT -1 23 " is not necessary here:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 11 "evalf(SOL);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 51 "B ut 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 286 6 " solv e" }{TEXT -1 23 " can sometimes solve a " }{TEXT 282 20 "system of equ ations," }{TEXT -1 13 " for example:" }}}{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 x = x means that the variable x is a free variable, that is, it can be any number.\n" }}{PARA 0 "" 0 "" {TEXT -1 10 "These are " }{TEXT 283 16 " linear equations" }{TEXT -1 122 " and therefore Maple can always solve such systems (if not too big). The next example is a system of non-li near equations:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 53 "syst1:=\{x^2 + y^2 = 1, y = 3*x\};\nvars:=inde ts(syst1);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 24 "sol1:=solve(s yst1,vars);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 22 "sol1:=allval ues(sol1);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 25 "This gives two solu tions " }{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 36 "Let's look at an other example where " }{TEXT 370 6 "RootOf" }{TEXT -1 34 " is given as part of the solution." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 69 "r estart:\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 clear, 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 a ny one of the five roots of " }{XPPEDIT 18 0 "_Z^5-_Z-1" "6#,(*$%#_ZG \"\"&\"\"\"F%!\"\"F'F(" }{TEXT 371 1 " " }{TEXT -1 50 "is a solution. \+ Note that Maple uses the variable " }{TEXT 372 2 "_Z" }{TEXT -1 278 " in such cases. In general, when Maple introduces variables they begin with an underscore in order to avoid variables that the user might wi sh to introduce. This degree 5 polynomial has no solutions by radicals . So it is not possible to get precise solutions to this polynomial." }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 1 "\n" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 67 "If you have had a little Galois Theory you can see that a s 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 "This 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 group " }{TEXT -1 152 "and hence x^5 - x - 1 cann ot be \"solved by radicals\". (You will learn about such things if you take the second semester of our Abstract Algebra course.)" }}}}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 30 "solve for solving inequalities" }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "" 0 "" {TEXT 288 13 "I nequalities " }{TEXT -1 9 "may also " }{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 "solv e(poly > 0 , x);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 61 "Ploting the e xpression, we see that 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 positive and one negative. We can have Maple selec t 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(%,radi cal);" }}}{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 "As we have see before we can appro ximate the roots of a polynomial using :" }}}{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 350 46 "fsolve attempts to com pute a single real root." }{TEXT -1 124 " However, for polynomials it \+ will compute all real (non-complex) roots, although exceptionally ill -conditioned polynomials " }{TEXT 351 35 "may cause fsolve to miss som e roots" }{TEXT -1 2 ". " }}{PARA 15 "" 0 "" {TEXT -1 11 "To compute \+ " }{TEXT 354 25 "all roots of a polynomial" }{TEXT -1 51 " over the fi eld of complex numbers, use the option " }{TEXT 355 7 "complex" } {TEXT -1 13 " as follows: " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 33 "fsolve(_Z^5 - _Z - 1,_Z,complex);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT 347 55 "Some solutions may be lost whe n the equation contains " }{TEXT 357 14 "transcendental" }{TEXT 356 1 " " }{TEXT 358 9 "functions" }{TEXT 359 1 " " }{TEXT 360 89 "(sin,co s, exp, ln, etc..). Consider the following example: We want to solve t he 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 39 "plot(\{sin(x),x^2\},x=-2..2,color=BLACK);" } }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 182 "We can see that there are two s olutions for x between 0 and 1. Clearly x = 0 is one solution. We seek the other solution. The following three methods fail to find the othe r 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 "fsolve(sin(x) = x^2,\{x\},x= -2..2);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 85 "But we get the other s olution by specifying a range where the second root is located:" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 33 "fsolve(sin(x) = x^2,\{x\},x= .5..1);" }}}{EXCHG {PARA 258 "" 0 "" {TEXT -1 44 "Use of fsolve to sol ve systems of equations:" }{TEXT 352 1 " " }{TEXT 353 22 "We saw a few examples " }{TEXT 361 141 "of this in the last lecture on finding cri tical points of z = f(x,y) by finding places where both partials are z ero. Here are some 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 "va rs:=indets(syst); " }{TEXT 362 6 "indets" }{TEXT -1 70 " is sometimes \+ useful if you don't know the variables in the equations." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 17 "solve(syst,vars);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 83 "Note that there appears to be four solutions, b ut two solutions are the same. If we" }}{PARA 0 "" 0 "" {TEXT -1 25 "p lot the equations using " }{TEXT 348 12 "implicitplot" }{TEXT -1 8 " w e can " }{TEXT 349 3 "see" }{TEXT -1 15 " the solutions." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "with(plots):" }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 75 "implicitplot(syst,x=-10..10,y=-10..10,numpoint s=1000,\nscaling=CONSTRAINED);" }}}{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 can with limited ablility solve some equations for integ er solutions using " }{TEXT 292 8 "isolve. " }{TEXT 375 26 "Such equat ions are called " }{TEXT 377 21 "Diophantine equations" }{TEXT 378 1 " ." }{TEXT 376 2 " " }{TEXT 379 95 "The solution of such equations is \+ a difficult area of number theory. Here's a simple example:\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 nothing. 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 203 "Note that _Z1 is a free variable generated by Maple. It can be any value. We can also specify what we want for the free varia ble 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+1 2*y=15,\{t\});\n" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 89 "The following technique will allow us to generate some of the infinitely many solut ions. " }{TEXT 380 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 "Consi der 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 solution " }{TEXT 294 9 "x = y = 1" }{TEXT -1 278 " since it has no general technique for finding \+ integer solutions to cubic polynomial equations. Generally solving pol ynomial equations for integer solutions is hard. It has been proved th at there is no algorithm that will work for all polynomials. Here's on e 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 12 "Compare with" }}}{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 "S olving " }{TEXT 299 20 "recurrence equations" }{TEXT -1 2 " (" }{TEXT 381 4 "aka," }{TEXT -1 1 " " }{TEXT 300 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 eq uation 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 equat ion\" usually comes with an equation and one or more initial condition s. In this case the equations F(0)=0 and F(1) = 1 are the initial cond itions." }}{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 -1 83 "formula for the value of F(n)--as opposed to writing a procedure to compute F(n).\n" }}}{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 "" {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 recurrence Maple can solve:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 66 "fun:=r solve( \{f(n)=2*f(n-1) + 3*f(n-2) + n, f(0)=0,f(1)=1\}, f(n));" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "Fun:=unapply(fun,n);" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "seq(Fun(i),i=0..15);" }}} {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 equati ons 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 equation " }{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 193 "Here there are infinitely many so lutions. One for each integral value of the variable _Z1. [Note here M aple uses _Z1 since _Z has already been used.\n\nThe next example give s 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 238 "We n ext factor the same polynomial over the integers modulo 7. Note that f or this factorization we see that -1 is a root. Note that -1 is the sa me as 6 modulo 7. Also since the other factor is irreducible, 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 differential equation)" }{TEXT 318 1 "." }{TEXT -1 88 " 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 "DEto ols" }{TEXT -1 5 " and " }{TEXT 309 8 "PDEtools" }{TEXT -1 39 " which \+ may be loaded with the commands " }{TEXT 308 13 "with(DEtools)" } {TEXT -1 5 " and " }{TEXT 310 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 4 " " }}{PARA 0 "" 0 "" {TEXT -1 40 "Here we solve 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 initial condition x(1) = \+ " }{XPPEDIT 18 0 "1" "6#\"\"\"" }{TEXT -1 54 ". Note that Maple uses t he partial derivative symbol " }{XPPEDIT 18 0 "Diff(x,t);" "6#-%%Diff G6$%\"xG%\"tG" }{TEXT -1 22 " instead of the usual " }{XPPEDIT 18 0 "d x/dt" "6#*&%#dxG\"\"\"%#dtG!\"\"" }{TEXT -1 48 " notation even when x \+ is a function of t alone. " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "restart:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 30 "eq:=diff(x(t ),t) = t^2*sin(t);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 18 "init_ cond:=x(1)=1;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 35 "Sol:=dsolv e(\{eq,init_cond\},\{x(t)\});" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 127 "Warning x(t) is of type function, but it is not of type procedure so \+ cannot be treated as a function in the mathematical sense." }}}{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 initial condition.\n" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "evalf(x(1));" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 45 "Let's change this solution 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 28 "diff (f(t),t) = t^2*sin(t); \n" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 30 "Chec k 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 26 "You can plot the solution:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 15 "plot(f, 1..10);" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 40 "Next we solve the second order equ ation " }{XPPEDIT 18 0 "diff(y,`$`(x,2)) = 9*y+2*x;" "6#/-%%diffG6$%\" yG-%\"$G6$%\"xG\"\"#,&*&\"\"*\"\"\"F'F0F0*&F,F0F+F0F0" }{TEXT -1 100 " with initial conditions y(0) = 1 and y'(0)=0. Note that here we assu me 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 31 "eq2:=diff(y(x),x$2)=9*y(x)+2*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,initi al_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 57 "plot(Y,0..(.2),xtickmarks=[0,.2],ytickmarks=[0 ,1,Y(.2)]);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 172 "Note that if we l eave out the initial conditions Maple gives the answer in terms of two constants C1 and C2 in this case. Choice of constants determines the \+ initial values." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 17 "dsolve(e q2,y(x));" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{SECT 0 {PARA 4 "" 0 "" {TEXT -1 23 "Indeterminate Functions" }}{PARA 0 "" 0 " " {TEXT -1 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{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 " " {TEXT -1 70 "Expressions of the form x(t), g(t), y(x), etc.. are som etimes called " }{TEXT 382 23 "indeterminate functions" }{TEXT -1 43 " in Maple. As we saw previously if you ask " }{MPLTEXT 1 0 16 "whatty pe(x(t)); " }{TEXT -1 13 "you will get " }{TEXT 384 8 "function" } {TEXT -1 84 ". But this is NOT the same kind of function that we obtai n with the arrow notation, " }{TEXT 385 7 "unapply" }{TEXT -1 4 " or \+ " }{TEXT 386 4 "proc" }{TEXT -1 56 " ! So you have to be a little care fully dealing with it." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 15 "w hattype(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 389 22 "indeterminate function" }{TEXT -1 279 " 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 reduced to 0. But it also doesn't recognize it as a function of x so it gives the deriv ative with respect to x as 0. On the other hand, we have:\n\n" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 15 "diff(z(w,x),x);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 116 "You can use this notation to do formal c alculations with derivatives.(And that's what DE is all about.) For ex ample:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 18 "diff(z(w)*r(w),w) ;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 125 "But they are NOT really fun ctions in the mathematical sense; that's why they are called indetermi nate functions. For example," }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 10 "z(w):=2*w;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 5 "z(4);" } }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "diff(z(w),w);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 358 "Note that 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 this notation is suppressed. That is, we write 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) = 10*x(t) + sin(t);" }}{PARA 0 "" 0 "" {TEXT -1 302 "\n\nThat is ,each occurrence of x should be replaced by x(t). You can tell tha t 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.\nNote also the output of dsolve will have the form\n\n x(t) = some expre ssion containing t\n" }}{PARA 0 "" 0 "" {TEXT -1 83 "One way to conver t this to a function is, as we saw above, to give the output of " } {TEXT 387 6 "dsolve" }{TEXT -1 16 " a name such as " }{TEXT 388 3 "Sol " }{TEXT -1 72 ". Then this can be converted to a function, call it f, by the command:\n\n" }{TEXT 383 2 "> " }{MPLTEXT 1 0 24 "f:=unapply(r hs(Sol),t); " }{TEXT -1 294 "\n\nThen in mathematical notation we say \+ that x = f(t) is a solution to the differential equation. And you can \+ use the usual means of plotting the function f or doing whatever appli cation you have in mind. After all the purpose of solving a DE is to f ind a function that has some use (hopefully)." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 8 "linsolv e" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "with(linalg):" }}} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "" 0 "" {TEXT 316 14 "T he procedure " }{TEXT 323 8 "linsolve" }{TEXT 324 134 " can be used to solve a linear equation Ax = b where A is a known matrix, b is a know n column vector and x is an unknow column vector." }{TEXT 322 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 133 "Note that although Maple writes a vector as a list, it treats it as a single column matrix for some purposes. Consider the f ollowing:" }}}{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. Bu t " }{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 "plot([[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 obtains infinitely many solutions . Here's an example where there is an affine 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 subspace of solution. The variable t[1] and t[2] may take any real values. A particular sol ution 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 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 e asily 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 solution 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 put ting in other values for _t_1 and _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 for t_1 and t_2 we can obtain as many s olutions to Ax = b as we desire." }}}{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 10 "The call \+ l" }{TEXT 333 14 "eastsqrs(A, b)" }{TEXT -1 40 " returns the vector th at best satisfies " }{TEXT 334 5 "Ax =b" }{TEXT -1 62 " in the least-s quares sense. The result returned is the vector" }{TEXT 335 2 " x" } {TEXT -1 17 " which minimizes " }{TEXT 336 15 "norm(A x - b, 2" } {TEXT -1 33 "). This is a part of the package " }{TEXT 337 8 "linalg. \+ " }{TEXT 344 14 "It can be used" }{TEXT 345 1 " " }{TEXT -1 5 "when " }{TEXT 338 8 "linsolve" }{TEXT -1 26 " finds no solution. Then, " } {TEXT 339 9 "leastsqrs" }{TEXT -1 41 " finds the best solution availab le. See " }{TEXT 340 10 "?leastsqrs" }{TEXT -1 20 " for examples.\n\n The " }{TEXT 341 8 "simplex " }{TEXT -1 70 "package is a collection of routines for linear optimization using the " }{TEXT 342 17 "simplex a lgorithm" }{TEXT -1 42 ". It is used after executing the command " } {TEXT 343 13 "with(simplex)" }{TEXT -1 5 ".See " }{TEXT 346 8 "?simple x" }{TEXT -1 14 " for examples." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 3 " \n\n\n" }}}}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 28 "Assignment 9 Due Next Monday" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "" 0 "" {TEXT 327 9 "Problem 1" }{TEXT -1 26 ". Consider the polynomial " }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 4 "p = " } {XPPEDIT 18 0 "x^3+.9999998*x^2-.9999999*x-.99999970000002;" "6#,**$% \"xG\"\"$\"\"\"*&$\"()******!\"(F'*$F%\"\"#F'F'*&$\"(*******F+F'F%F'! \"\"$\"/-++q******!#9F1" }{TEXT -1 3 ". " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 31 "If you try to solve this using " } {TEXT 391 6 "fsolve" }{TEXT -1 296 " you will find that it takes a lon g time. If you care to try, go ahead, but be prepared to wait for abou t half an hour. Or, if you tire of waiting, you may stop the computati on by clicking on the stop sign on the menu bar. Instead use the foll owing method to find the zeros of p:\n\n(a) First use " }{TEXT 393 12 "Digits := 50" }{TEXT -1 72 " to set the digits used in the computatio n to 50. \n\n(b) Use the command " }{TEXT 390 19 "convert(p,fraction) " }{TEXT -1 122 " to convert the coefficients of p to rational numbers . Note that we are now not dealing with floating point coefficients. \+ " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 8 "(c) Us e " }{TEXT 392 5 "solve" }{TEXT -1 26 " to find the three roots. " }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 130 "(d) Find each of the (three) roots to 50 decimal digits. \n\n(e) Substitute th e roots so obtained back into p and see if you get 0. " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 83 "(f) Plot the graph o f p. Can you see from the graph how many roots you should get? " }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 65 "(g) Find \+ the distance between the two roots that are near x = -1?" }}{PARA 0 " " 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT 405 7 "Remark:" }{TEXT -1 37 " This polynomial has what are called " }{TEXT 404 15 "ill-condi tioned" }{TEXT -1 65 " zeros. A brief pdf document discussing these ma tters is found at" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 86 "http://www-tacc.cc.utexas.edu/Information/Manuals/NAGdoc/ fl/pdf/C02/c02_intro_fl19.pdf" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 " " }}{PARA 0 "" 0 "" {TEXT 328 9 "Problem 2" }{TEXT -1 13 ". \n\n(a) Fi nd " }{TEXT 394 17 "positive integers" }{TEXT -1 22 " x, y, z such tha t \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 331 6 "isolve" }{TEXT -1 55 " and what ever else is required. [Note that after using " }{TEXT 406 6 "isolve" }{TEXT -1 114 " you will have to inspect the solutions given and choos e appropriate values for the free variables that will give " }{TEXT 395 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 407 4 "Find" }{TEXT -1 5 " and " }{TEXT 408 5 "check" } {TEXT -1 1 " " }{TEXT 326 21 "10 distinct solutions" }{TEXT -1 24 " to the matrix equation\n" }}{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 332 8 " linsolve" }{TEXT -1 29 " and whatever else is needed." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT 329 9 "Problem 3" } {TEXT -1 53 ". (a) Find a closed form solution to the recurrence: " }} {PARA 0 "" 0 "" {TEXT -1 7 "\n " }{XPPEDIT 18 0 "f(n) = f(n-1)+4* f(n-2)-4*f(n-3)+1+n+2^n;" "6#/-%\"fG6#%\"nG,.-F%6#,&F'\"\"\"F,!\"\"F,* &\"\"%F,-F%6#,&F'F,\"\"#F-F,F,*&F/F,-F%6#,&F'F,\"\"$F-F,F-F,F,F'F,)F3F 'F," }{TEXT -1 3 ", " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 54 "with initial conditions: f(0) = 1, f(1) = 1, f(2) = 0. " }}{PARA 0 "" 0 "" {TEXT -1 1 "\n" }}{PARA 0 "" 0 "" {TEXT -1 51 "Use this to find the smallest value of n such that " }{XPPEDIT 18 0 "10^1 000 < f(n);" "6#2*$\"#5\"%+5-%\"fG6#%\"nG" }{TEXT -1 9 ". \n\n(b). " } {TEXT 409 4 "Find" }{TEXT -1 5 " and " }{TEXT 410 5 "graph" }{TEXT -1 43 " the solution to the differential equation\n" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 4 " " }{XPPEDIT 18 0 "dx/d t = 10^(-5)*exp(t)*sin(t);" "6#/*&%#dxG\"\"\"%#dtG!\"\"*()\"#5,$\"\"&F (F&-%$expG6#%\"tGF&-%$sinG6#F1F&" }{TEXT -1 37 " with initial cond ition x(1) = 1." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 41 "Plot the solution in the interval [1,10]." }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT 330 9 "Problem 4" }{TEXT -1 2 ". " }{TEXT 325 1 "\n" } {TEXT 396 40 "Solve the following system of equations:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 3 " " }{XPPEDIT 18 0 " \{x^2-y^2-z^2-1 = 0, z^2-x-y = 0, x+y+z-3 = 0\};" "6#<%/,**$%\"xG\"\"# \"\"\"*$%\"yGF(!\"\"*$%\"zGF(F,F)F,\"\"!/,(*$F.F(F)F'F,F+F,F//,*F'F)F+ F)F.F)\"\"$F,F/" }}{PARA 0 "" 0 "" {TEXT 397 1 " " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 10 "There are " }{TEXT 402 3 "two" }{TEXT -1 55 " solutions [x,y,z] to this system. Find both solut ions." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 13 " (a) exactly ," }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 4 "and " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 40 "(b) approximately to 10 decimal places. " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 5 "Also:" }}{PARA 0 "" 0 " " {TEXT -1 21 "\n(c) check that your " }{TEXT 403 15 "exact solutions " }{TEXT -1 44 " satisfy all three equations in the system. " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT 401 4 "Hint" }{TEXT -1 40 ": Some of the commands you may need are " }{TEXT 398 5 "solve" }{TEXT -1 2 ", " }{TEXT 399 9 "allvalues" }{TEXT -1 2 ", " }{TEXT 400 31 "evalf, subs, simplify, expand, " }{TEXT -1 32 "and possibly others . [Note that " }{TEXT 411 6 "fsolve" }{TEXT -1 44 " will not be very h elpful for this problem.]" }}}}}{MARK "12" 0 }{VIEWOPTS 0 0 0 1 1 1803 1 1 1 1 }{PAGENUMBERS 1 1 2 33 1 0 }