{VERSION 3 0 "IBM INTEL NT" "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 "Highlight" -1 256 "" 0 0 0 255 0 1 0 1 0 0 0 0 0 0 0 } {CSTYLE "" -1 257 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 258 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 259 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 260 "" 0 1 0 0 0 0 1 0 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 "Heading 1" 0 3 1 {CSTYLE "" -1 -1 "" 1 18 0 0 0 0 0 1 0 0 0 0 0 0 0 }3 0 0 0 8 4 0 0 0 0 0 0 -1 0 }{PSTYLE "Heading 2" 3 4 1 {CSTYLE "" -1 -1 "" 1 14 0 0 0 0 0 0 0 0 0 0 0 0 0 }1 0 0 -1 8 2 0 0 0 0 0 0 -1 0 }} {SECT 0 {PARA 3 "" 0 "" {TEXT -1 41 "Basics on Functions and Plotting \+ in Maple" }{MPLTEXT 1 0 0 "" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "restart;" }}}{SECT 1 {PARA 4 "" 0 "" {TEXT -1 12 "Introduction" }} {PARA 0 "" 0 "" {TEXT -1 220 "In this worksheet we will take a look at functions: see how a shift in the dependent or independent variable a ffects the graph, and caution about using such sophisticated plotting \+ tools as Maple (or graphing calculators)" }}}{SECT 1 {PARA 4 "" 0 "" {TEXT -1 18 "Defining Functions" }}{PARA 0 "" 0 "" {TEXT -1 99 "In Map le a function is defined analogously to the definition given in class, i.e., a function is a " }{TEXT 256 4 "rule" }{TEXT -1 47 " (or mappin g) which assigns a specified value (" }{XPPEDIT 18 0 "f(x)" "6#-%\"fG6 #%\"xG" }{TEXT -1 31 ") to the independent variable (" }{XPPEDIT 18 0 "x" "6#%\"xG" }{TEXT -1 47 "). Maple's notation for defining the funct ion " }}{PARA 0 "" 0 "" {TEXT -1 20 " " }{XPPEDIT 18 0 "f(x) = sin(x)/x-sqrt(x)/(x^2+1);" "6#/-%\"fG6#%\"xG,&*&-%$sinG6# F'\"\"\"F'!\"\"F-*&-%%sqrtG6#F'F-,&*$)F'\"\"#F-F-\"\"\"F-F.F." }{TEXT -1 1 " " }}{PARA 0 "" 0 "" {TEXT -1 2 "is" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 36 "f:= x -> sin(x)/x - sqrt(x)/(x^2+1);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 27 "We can now try to evaluate " }{XPPEDIT 18 0 "f" "6#%\"fG" }{TEXT -1 22 " at any point we wish:" }}{PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 39 "f(1); f(2); f(3.5); f(Pi); f(0); f(-1);" }}} {PARA 0 "" 0 "" {TEXT -1 41 "We see that Maple attempts to give us an \+ " }{TEXT 256 12 "exact answer" }{TEXT -1 20 " whenever possible. " }} {PARA 0 "" 0 "" {TEXT -1 9 "Clearly, " }{XPPEDIT 18 0 "f(0)" "6#-%\"fG 6#\"\"!" }{TEXT -1 36 " is not defined, and in the case of " } {XPPEDIT 18 0 "f(-1)" "6#-%\"fG6#,$\"\"\"!\"\"" }{TEXT -1 121 " Maple \+ treats the function as a complex-valued function, i.e., Maple views th e square root of -1 as the imaginary number " }{XPPEDIT 18 0 "i" "6#% \"iG" }{TEXT -1 2 ". " }}{PARA 0 "" 0 "" {TEXT -1 179 "With some more \+ sophisticated programming (which we will not worry about) we could mak e sure that Maple only returns real solutions, and complains if the fu nction value is complex." }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 30 "We can also plot the graph of " }{XPPEDIT 18 0 "f" "6#%\"fG" }{TEXT -1 6 ", \+ e.g." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 15 "plot(f, 0..10);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 62 "or, if we pick a different range for the \+ independent variable," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 21 "plot(f, 0. .infinity);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 11 "The command" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "plot(f(x), x=0..10);" }}}{PARA 0 " " 0 "" {TEXT -1 74 "does the same as the first plot command used - but since Maple knows that " }{XPPEDIT 18 0 "f" "6#%\"fG" }{TEXT -1 90 " \+ is a function, it is not really necessary to specify the independent v ariable explicitly." }}}{SECT 1 {PARA 4 "" 0 "" {TEXT -1 15 "Shifting \+ Graphs" }}{PARA 0 "" 0 "" {TEXT -1 109 "We can nicely visualize how a \+ shift in the dependent or independent variable affects the graph of a \+ function." }}{PARA 0 "" 0 "" {TEXT -1 48 "To this end we define a coup le of new functions:" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 37 "h := x -> f(x+a);\nv := x -> f(x) + a;" }}}{PARA 0 "" 0 "" {TEXT -1 33 "As you will remember from class, " }{XPPEDIT 18 0 "h" "6#%\"hG" }{TEXT -1 18 " should result in " }{TEXT 256 10 "horizontal" }{TEXT -1 12 " s hifts and " }{XPPEDIT 18 0 "v" "6#%\"vG" }{TEXT -1 4 " in " }{TEXT 256 9 "vertical " }{TEXT 18 5 "ones." }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 43 "To illustrate the effects of the parameter " }{XPPEDIT 18 0 "a " "6#%\"aG" }{TEXT -1 13 " we create a " }{TEXT 256 8 "sequence" } {TEXT -1 46 " of functions. This is done in Maple with the " }{TEXT 256 3 "seq" }{TEXT -1 9 " command." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 24 "H := seq(h(x), a=-3..3);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 154 " Now we can graph all of these functions together in one plot. In order to do this the sequence has to be enclosed in curly brackets to turn \+ it into a set." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 19 "plot(\{H\}, x=0.. 10);" }}}}{SECT 1 {PARA 4 "" 0 "" {TEXT -1 25 "A Tough Function to Gra ph" }}{PARA 0 "" 0 "" {TEXT -1 227 "The following is an example of a p roblem where a straightforward use of Maple as a plotting tool is not \+ very helpful. In order to get a meaningful graph some Calculus knowled ge (our luck and a lot of trial and error) is needed." }}{PARA 0 "" 0 "" {TEXT -1 264 "The hydrogen atom is composed of one proton in the nu cleus and one electron, which moves about the nucleus. In the quantum \+ theory of atomic structures, it is assumed that the electron does not \+ move in a well-defined orbit. Instead, it occupies a state known as an " }{TEXT 257 7 "orbital" }{TEXT -1 125 ", which may be thought of as \+ a \"cloud\" of negative charge surrounding the nucleus. At the state o f lowest energy, called the " }{TEXT 258 12 "ground state" }{TEXT -1 6 ", or 1" }{TEXT 260 9 "s-orbital" }{TEXT -1 182 ", the shape of this cloud is assumed to be a sphere centered at the nucleus. This sphere \+ is described in terms of the probability density function \n \+ " }{XPPEDIT 18 0 "p(r) = 4/a[0]^3" "6#/-%\"pG6 #%\"rG*&\"\"%\"\"\"*$&%\"aG6#\"\"!\"\"$!\"\"" }{TEXT -1 2 " " } {XPPEDIT 18 0 " r^2*exp(-2*r/a[0]))" "6#*&%\"rG\"\"#-%$expG6#,$*(\"\"# \"\"\"F$F,&%\"aG6#\"\"!!\"\"F1F," }{TEXT -1 6 ", " }{XPPEDIT 18 0 "r>=0" "6#1\"\"!%\"rG" }{TEXT -1 8 ",\nwhere " }{XPPEDIT 18 0 "a[0]" " 6#&%\"aG6#\"\"!" }{TEXT -1 15 " is called the " }{TEXT 259 17 "first B ohr radius" }{TEXT -1 2 " (" }{XPPEDIT 18 0 "a[0] =5.29*10^(-11)" "6#/ &%\"aG6#\"\"!*&$\"$H&!\"#\"\"\")\"#5,$\"#6!\"\"F," }{TEXT -1 74 " m). \+ \nTry to create a meaningful plot of the probability density function \+ " }{XPPEDIT 18 0 "p" "6#%\"pG" }{TEXT -1 48 " which shows its local ma ximum and behavior for " }{XPPEDIT 18 0 "r" "6#%\"rG" }{TEXT -1 19 " a pproaching 0 and " }{XPPEDIT 18 0 "r" "6#%\"rG" }{TEXT -1 23 " approac hing infinity.\n" }}{PARA 0 "" 0 "" {TEXT -1 31 "Here is how you would define p:" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 63 "a[0] := 5.29*1 0^(-11);\np := r -> (4/a[0]^3)*r^2*exp(-2*r/a[0]);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 74 "The following command is a valid Maple command - \+ but it doesn't work here." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 26 "plot(p (r), r=0..infinity);" }}}}{SECT 1 {PARA 4 "" 0 "" {TEXT -1 19 "Suggest ed Exercises" }}{SECT 1 {PARA 4 "" 0 "" {TEXT -1 5 "Ex.1:" }}{PARA 0 " " 0 "" {TEXT -1 29 "a) What does the behavior of " }{XPPEDIT 18 0 "f" "6#%\"fG" }{TEXT -1 15 " seem to be as " }{XPPEDIT 18 0 "x" "6#%\"xG" }{TEXT -1 23 " tends toward infinity?" }}{PARA 0 "" 0 "" {TEXT -1 41 " b) Try to create a graph of the function " }{XPPEDIT 18 0 "f" "6#%\"fG " }{TEXT -1 35 " which illustrates the behavior of " }{XPPEDIT 18 0 "f " "6#%\"fG" }{TEXT -1 4 " as " }{XPPEDIT 18 0 "x" "6#%\"xG" }{TEXT -1 22 " tends to zero better." }}}{SECT 1 {PARA 4 "" 0 "" {TEXT -1 5 "Ex. 2:" }}{PARA 0 "" 0 "" {TEXT -1 15 "In the plot of " }{XPPEDIT 18 0 "H " "6#%\"HG" }{TEXT -1 29 ", which curve corresponds to " }{XPPEDIT 18 0 "a=0" "6#/%\"aG\"\"!" }{TEXT -1 44 ", i.e., the unshifted version, w hich one to " }{XPPEDIT 18 0 "a=3" "6#/%\"aG\"\"$" }{TEXT -1 19 ", and which one to " }{XPPEDIT 18 0 "a=-3" "6#/%\"aG,$\"\"$!\"\"" }{TEXT -1 1 "?" }}}{SECT 1 {PARA 4 "" 0 "" {TEXT -1 5 "Ex.3:" }}{PARA 0 "" 0 "" {TEXT -1 65 "Repeat the visualization of the shifted graphs with th e function " }{XPPEDIT 18 0 "v" "6#%\"vG" }{TEXT -1 1 "." }}}{SECT 1 {PARA 4 "" 0 "" {TEXT -1 5 "Ex.4:" }}{PARA 0 "" 0 "" {TEXT -1 32 "Crea te the \"meaningful plot\" of " }{XPPEDIT 18 0 "p" "6#%\"pG" }{TEXT -1 17 " mentioned above." }}}}}{MARK "0 0" 0 }{VIEWOPTS 1 1 0 1 1 1803 }