{VERSION 3 0 "SUN SPARC SOLARIS" "3.0" } {USTYLETAB {CSTYLE "Maple Input" -1 0 "Courier" 0 1 255 0 0 1 0 1 0 0 1 0 0 0 0 }{CSTYLE "2D Math" -1 2 "Times" 0 1 0 0 0 0 0 0 2 0 0 0 0 0 0 }{CSTYLE "2D Comment" 2 18 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 } {CSTYLE "" -1 256 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 257 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 258 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 259 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 } {CSTYLE "" -1 260 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 261 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 262 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 263 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 } {CSTYLE "" -1 265 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 266 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 267 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 268 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 } {CSTYLE "" -1 269 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 270 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 271 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 272 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 } {CSTYLE "" -1 273 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 274 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 275 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 277 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 } {CSTYLE "" -1 279 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 }{PSTYLE "Normal" -1 0 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "" 0 256 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 }3 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }} {SECT 0 {EXCHG {PARA 256 "" 0 "" {TEXT -1 15 "Maple Project 5" }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 841 "Today we will use Maple to explore direction fields, among other things. Reme mber how this goes: we have an equation y' = F(x,y). We may not know \+ how to solve for y, but just by looking at the equation we can see tha t for any (x,y) pair we can plug them into F and get a value for y', w hich is the SLOPE of y. Thus we know what the slope of y is at any po int. So on a graph, at each point (x,y) we can draw a short line segme nt with slope F(x,y). In doing this, we get an idea of how the family of solutions for y actually look; our line segments indicate the dir ection in which a particular solution curve is heading. The graph of \+ all these line segments is called a DIRECTION FIELD. Let's see how w e can do this on Maple; it's actually quite simple. Suppose we wish t o plot the direction field for the differential equation y' = " } {XPPEDIT 18 0 "x^2;" "6#*$%\"xG\"\"#" }{TEXT -1 94 " + y. First we lo ad a special differential equations package that has the command we wa nt. " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "with(DEtools):" } }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 126 "In our equation, we want y as a function of x, and we can denote this as y=y(x). So we can rewrite o ur equation as y'(x) = " }{XPPEDIT 18 0 "x^2;" "6#*$%\"xG\"\"#" } {TEXT -1 390 " + y(x). This is the notation Maple likes to see. The \+ command \"dfieldplot\" will give us the direction field for this equat ion. The first thing we put in the command is the actual equation, wi th \"diff(y(x),x)\", our usual derivative command, representing y'(x). Here y(x) is not actually a function, it's just notation for Maple. \+ The x and y ranges we want in our plot must be specified." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 61 "dfieldplot( diff(y(x),x) = x^2 + y( x),y(x),x=-6..6,y=-20..5);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 154 "Bu t of course, we can do more than this, we can actually find the explic it solutions for y. Let us assign the ENTIRE differential EQUATION to a variable." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 27 "eqn:=diff(y (x),x)=x^2+y(x);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 46 "To solve for \+ y(x), type the following command:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 17 "dsolve(eqn,y(x));" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 263 "We have an entire family of solutions here. The \"_C1\" is Ma ple's notation for the arbitrary constant that occurs in the general s olution of a first order differential equation. So, to write Maple's \+ output in a nicer way, we really have the family of solutions " } {XPPEDIT 18 0 "y(x) = -x^2-2*x-2+C*exp(x);" "6#/-%\"yG6#%\"xG,**$F'\" \"#!\"\"*&\"\"#\"\"\"F'F.F+\"\"#F+*&%\"CGF.-%$expG6#F'F.F." }{TEXT -1 225 " , where C is an arbitrary constant. Suppose we have a further c ondition, that y(-.001) = -2. Using this extra information Maple can \+ determine the value of the arbitrary constant with the following revis ed \"dsolve\" command:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 37 "s oln:=dsolve(\{eqn,y(-.001)=-2\},y(x));" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 121 "If we want, we can plot this solution. In the following plot command, we are just saying that we would like to plot the " } {TEXT 256 1 "R" }{TEXT -1 5 "ight-" }{TEXT 257 1 "H" }{TEXT -1 4 "and- " }{TEXT 258 1 "S" }{TEXT -1 49 "ide of our equation soln, which in th is case is " }{XPPEDIT 18 0 "-x^2-2*x-2+.2001e-2*exp(x);" "6#,**$%\"x G\"\"#!\"\"*&\"\"#\"\"\"F%F*F'\"\"#F'*&$\"%,?!\"'F*-%$expG6#F%F*F*" } {TEXT -1 3 " ." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 24 "plot(rhs (soln),x=-6..6);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 168 "Compare this solution curve with your plot of the direction field. It seems to ma tch up nicely with the solution that passes through the point (-.001,- 2), does it not?" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 146 "Two more things we will need for this lab: partial frac tions and improper integrals. Suppose we wish to find the partial fra ction expansion of " }{XPPEDIT 18 0 "1/((3*x^2+1)*(x+4)^3);" "6#*&\" \"\"\"\"\"*&,&*&\"\"$F%*$%\"xG\"\"#F%F%\"\"\"F%F%*$,&F+F%\"\"%F%\"\"$F %!\"\"" }{TEXT -1 40 " . The following Maple commands do it." }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 25 "f:=1/((3*x^2+1)*(x+4)^3);" } }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 21 "convert(f,parfrac,x);" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 157 "CONVINCE YOURSELF THAT THE EXPANS ION LOOKS LIKE WHAT IT'S SUPPOSED TO. Here is an example of how to fi nd improper integrals on Maple. If we wish to find " }{XPPEDIT 18 0 "int(x*exp(x),x = -infinity .. 0);" "6#-%$intG6$*&%\"xG\"\"\"-%$expG 6#F'F(/F';,$%)infinityG!\"\"\"\"!" }{TEXT -1 19 " , we simply type:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 29 "int(x*exp(x),x=-infinity. .0);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 134 "Simple and sweet; it's w hat we've come to expect from our friend, Maple. In the good times an d the bad times, it'll be there for you." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 9 "Problems:" }}{PARA 0 "" 0 "" {TEXT -1 4 "1) " }{TEXT 262 55 "Using Maple, find the partial fraction deco mposition of" }{TEXT -1 4 " " }{XPPEDIT 18 0 "1/((x-1)^3*(x^2+2)^2* (x+6));" "6#*&\"\"\"\"\"\"*(,&%\"xGF%\"\"\"!\"\"\"\"$,&*$F(\"\"#F%\"\" #F%\"\"#,&F(F%\"\"'F%F%F*" }{TEXT -1 65 " . Again, convince yourself it's in the form it should be in. " }{TEXT 263 18 "Then integrate it ." }{TEXT -1 228 " Notice that not only does Maple not give you the \+ \"+C\" you should really see, but the absolute value signs are missing from inside the natural logarithms. Again, Maple does not give you t he most general antiderivative, just a " }{TEXT 261 10 "particular" } {TEXT -1 17 " antiderivative. " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }} {PARA 0 "" 0 "" {TEXT -1 38 "2) Suppose we would like to see if " } {XPPEDIT 18 0 "int(sin(x)^2/(x^2),x = 1 .. infinity);" "6#-%$intG6$*&- %$sinG6#%\"xG\"\"#*$F*\"\"#!\"\"/F*;\"\"\"%)infinityG" }{TEXT -1 85 " \+ is convergent or divergent. We could first actually compute a coupl e integrals. " }{TEXT 266 11 "Compute the" }{TEXT -1 1 " " }{TEXT 265 72 "following integrals, and use the evalf command to get a numeri cal value " }{TEXT -1 1 " " }{TEXT 277 53 "(just use copy and paste co mmands to speed things up)" }{TEXT -1 4 ": " }{XPPEDIT 18 0 "int(sin (x)^2/(x^2),x = 1 .. 10);" "6#-%$intG6$*&-%$sinG6#%\"xG\"\"#*$F*\"\"#! \"\"/F*;\"\"\"\"#5" }{TEXT -1 5 " , " }{XPPEDIT 18 0 "int(sin(x)^2/( x^2),x = 1 .. 100);" "6#-%$intG6$*&-%$sinG6#%\"xG\"\"#*$F*\"\"#!\"\"/F *;\"\"\"\"$+\"" }{TEXT -1 5 " , " }{XPPEDIT 18 0 "int(sin(x)^2/(x^2) ,x = 1 .. 1000);" "6#-%$intG6$*&-%$sinG6#%\"xG\"\"#*$F*\"\"#!\"\"/F*; \"\"\"\"%+5" }{TEXT -1 5 " , " }{XPPEDIT 18 0 "int(sin(x)^2/(x^2),x \+ = 1 .. 10000);" "6#-%$intG6$*&-%$sinG6#%\"xG\"\"#*$F*\"\"#!\"\"/F*;\" \"\"\"&++\"" }{TEXT -1 88 " . Do you think the improper integral c onverges? To further explore this integral, " }{TEXT 272 5 "graph" } {TEXT -1 6 " y = " }{XPPEDIT 18 0 "sin(x)^2/(x^2)" "6#*&-%$sinG6#%\"x G\"\"#*$F'\"\"#!\"\"" }{TEXT -1 12 " and y = " }{XPPEDIT 18 0 "1/(x ^2);" "6#*&\"\"\"\"\"\"*$%\"xG\"\"#!\"\"" }{TEXT -1 3 " " }{TEXT 274 26 "on the same graph over the" }{TEXT -1 1 " " }{TEXT 273 8 "inte rval" }{TEXT -1 1 " " }{TEXT 275 7 "[10,50]" }{TEXT -1 20 ". Notice h ow y = " }{XPPEDIT 18 0 "sin(x)^2/(x^2)" "6#*&-%$sinG6#%\"xG\"\"#*$F '\"\"#!\"\"" }{TEXT -1 23 " is always below y = " }{XPPEDIT 18 0 "1/ (x^2)" "6#*&\"\"\"\"\"\"*$%\"xG\"\"#!\"\"" }{TEXT -1 15 " . In fact, \+ " }{XPPEDIT 18 0 "sin(x)^2/(x^2)" "6#*&-%$sinG6#%\"xG\"\"#*$F'\"\"#! \"\"" }{TEXT -1 7 " < = " }{XPPEDIT 18 0 "1/(x^2)" "6#*&\"\"\"\"\"\" *$%\"xG\"\"#!\"\"" }{TEXT -1 53 " for any x > = 1 because sin(x) < \+ = 1 for any x. " }{TEXT 271 24 "Now compute the integral" }{TEXT -1 3 " " }{XPPEDIT 18 0 "int(1/(x^2),x = 1 .. infinity);" "6#-%$intG6$* &\"\"\"\"\"\"*$%\"xG\"\"#!\"\"/F*;\"\"\"%)infinityG" }{TEXT -1 60 " \+ . Ah, this converges, and since we have just seen that " }{XPPEDIT 18 0 "sin(x)^2/(x^2)" "6#*&-%$sinG6#%\"xG\"\"#*$F'\"\"#!\"\"" }{TEXT -1 6 " < = " }{XPPEDIT 18 0 "1/(x^2)" "6#*&\"\"\"\"\"\"*$%\"xG\"\"#! \"\"" }{TEXT -1 85 " , our original integral should also converge, by \+ the Comparison Test. So, finally, " }{TEXT 259 43 "compute the numeri cal value of the integral" }{TEXT -1 3 " " }{XPPEDIT 18 0 "int(sin(x )^2/(x^2),x = 1 .. infinity)" "6#-%$intG6$*&-%$sinG6#%\"xG\"\"#*$F*\" \"#!\"\"/F*;\"\"\"%)infinityG" }{TEXT -1 5 " " }{TEXT 270 58 "(use an evalf command to find the actual numerical value)." }{TEXT -1 11 " " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 4 "3) " }{TEXT 268 120 "Graph the direction field (with x range -6 to 6 and y range 0 to 5) for the following differential equation usin g Maple:" }{TEXT -1 20 " y' = y sin(2x) . " }{TEXT 267 79 "Then use \+ Maple to explicitly solve the differential equation with initial value " }{TEXT -1 2 " " }{TEXT 260 6 "y(0)=1" }{TEXT -1 3 ", " }{TEXT 269 133 "and graph your solution. Then, on the direction field graph on y our printout, sketch this particular solution curve as best you can " }{TEXT -1 35 "(it passes through the point (0,1))" }{TEXT 279 1 "." }} }}{MARK "17 7 8" 35 }{VIEWOPTS 1 1 0 1 1 1803 }