{VERSION 5 0 "IBM INTEL NT" "5.0" } {USTYLETAB {CSTYLE "Maple Input" -1 0 "Courier" 0 1 255 0 0 1 0 1 0 0 1 0 0 0 0 1 }{CSTYLE "2D Math" -1 2 "Times" 0 1 0 0 0 0 0 0 2 0 0 0 0 0 0 1 }{CSTYLE "Hyperlink" -1 17 "" 0 1 0 128 128 1 2 0 1 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 "2D Input" 2 19 "" 0 1 255 0 0 1 0 0 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 256 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 1 }{PSTYLE "Normal" -1 0 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 1 1 1 1 }1 1 0 0 0 0 1 0 1 0 2 2 0 1 }{PSTYLE "Heading 1" -1 3 1 {CSTYLE "" -1 -1 "Times " 1 18 0 0 0 1 2 1 2 2 2 2 1 1 1 1 }1 1 0 0 8 4 1 0 1 0 2 2 0 1 } {PSTYLE "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 "Heading 3" -1 5 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 1 1 2 2 2 2 1 1 1 1 }1 1 0 0 0 0 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 "Normal" -1 256 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 1 1 1 1 }3 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 2 2 2 2 2 2 1 1 1 1 }3 1 0 0 0 0 1 0 1 0 2 2 0 1 }{PSTYLE "Normal" -1 258 1 {CSTYLE "" -1 -1 "T imes" 1 12 0 0 0 1 2 2 2 2 2 2 1 1 1 1 }3 1 0 0 0 0 1 0 1 0 2 2 0 1 } } {SECT 0 {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 " " 0 "" {TEXT 256 36 "lab5.mws --- Trigonometric Integrals" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 23 "restart;\nwith( plots ):" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 54 "Auxiliary Plotting Commands -- execute, do not modify!" } }{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 559 "FourierAnim := proc(f,n)\n local a, b, Fcos, Fsin, Pf, Psincos;\n a := (f,n) -> int( f*sin(n*x ), x=-Pi..Pi )/Pi:\n b := (f,n) -> int( f*cos(n*x), x=-Pi..Pi )/Pi:\n Fsin := (f,n) -> add( a(f,m)*sin(m*x), m=1..n ):\n Fcos := (f,n) -> b(f,0)/2 + add( b(f,m)*cos(m*x), m=1..n ):\n Psincos := (f,n) -> plo t( Fsin(f,n)+Fcos(f,n), x=-3*Pi..3*Pi, color=blue ):\n Pf := plot( f, x=-Pi..Pi ):\n return display( [seq(\n display( [ Psincos(f,m),Pf], title=sprintf(\"n=%a\",m) ),\n m= 1..n )],\n insequence=true ):\nend proc:" }{TEXT -1 0 "" }}}}{SECT 0 {PARA 3 "" 0 "" {TEXT -1 12 "Lab Overview" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 65 "This lab is intended to replace a need to lecture on Section 8.2." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 " " 0 "" {TEXT -1 70 "Our first example will be to compute the definite \+ integrals integrals " }{XPPEDIT 18 0 "Int( sin(m*x)*sin(n*x), x=-Pi..P i )" "6#-%$IntG6$*&-%$sinG6#*&%\"mG\"\"\"%\"xGF,F,-F(6#*&%\"nGF,F-F,F, /F-;,$%#PiG!\"\"F5" }{TEXT -1 1 "." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }} {PARA 0 "" 0 "" {TEXT -1 209 "We will conclude the demonstration with \+ the Fourier sine and cosine coefficients of a function. These computat ions will be illustrated with an example based on the \"square wave fu nction\" defined to be -1 on ( " }{XPPEDIT 18 0 "-Pi" "6#,$%#PiG!\"\" " }{TEXT -1 20 ", 0 ) and 1 on ( 0, " }{XPPEDIT 18 0 "Pi" "6#%#PiG" } {TEXT -1 43 " ) and extended periodically with periodic " }{XPPEDIT 18 0 "2*Pi" "6#*&\"\"#\"\"\"%#PiGF%" }{TEXT -1 1 "." }}{PARA 0 "" 0 " " {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 266 "The questions at the e nd of this lab require you to apply the two examples to slightly diffe rent situations. In particular, Questions 4, and 5 refer to the \"sawt ooth function\". This is the function that is defined to be the period ic extension of the linear function " }{XPPEDIT 18 0 "f(x)=x" "6#/-%\" fG6#%\"xGF'" }{TEXT -1 6 " on [ " }{XPPEDIT 18 0 "-Pi" "6#,$%#PiG!\"\" " }{TEXT -1 2 ", " }{XPPEDIT 18 0 "Pi" "6#%#PiG" }{TEXT -1 75 " ]. The topics in this lab are the basis for a later lab on Fourier Series." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 12 "Example 1 - " }{XPPEDIT 18 0 "Int( sin(m*x) * sin(n* x), x=-Pi..Pi )" "6#-%$IntG6$*&-%$sinG6#*&%\"mG\"\"\"%\"xGF,F,-F(6#*&% \"nGF,F-F,F,/F-;,$%#PiG!\"\"F5" }{TEXT -1 1 " " }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 14 "The functions " }{XPPEDIT 18 0 "sin(n*x)" "6#-%$sinG6# *&%\"nG\"\"\"%\"xGF(" }{TEXT -1 8 ", where " }{XPPEDIT 18 0 "n" "6#%\" nG" }{TEXT -1 40 " = 1, 2, 3, ..., have the property that " }{XPPEDIT 18 0 "Int(sin(m*x)*sin(n*x),x = -Pi .. Pi) = PIECEWISE([0, m <> n],[Pi , m = n]);" "6#/-%$IntG6$*&-%$sinG6#*&%\"mG\"\"\"%\"xGF-F--F)6#*&%\"nG F-F.F-F-/F.;,$%#PiG!\"\"F6-%*PIECEWISEG6$7$\"\"!0F,F27$F6/F,F2" } {TEXT -1 44 ". In this example we will verify this claim." }}}{SECT 1 {PARA 4 "" 0 "" {TEXT -1 51 "Step 1: Develop Intuition with Graphical \+ Animations" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 49 "We begin by looking \+ at the graph of the products " }{XPPEDIT 18 0 "sin(m*x)*sin(n*x)" "6#* &-%$sinG6#*&%\"mG\"\"\"%\"xGF)F)-F%6#*&%\"nGF)F*F)F)" }{TEXT -1 24 " f or all combination of " }{XPPEDIT 18 0 "m" "6#%\"mG" }{TEXT -1 19 " = \+ 1, 2, .., 6 and " }{XPPEDIT 18 0 "n" "6#%\"nG" }{TEXT -1 15 " = 1, 2, \+ .., 6." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 31 "sm := sin(m*x);\n sn := sin(n*x);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 243 "N := 6: \nfor m from 1 to N do\n q := [seq(\n plot( sm*sn, x=-Pi..Pi, view=[-Pi..Pi,-1..1],\n title=sprintf(\"Plot of %a*%a\" , sm, sn) ),\n n=1..N )]:\n P||m := display( q, insequence=tru e );\nend do:\nunassign( 'm', 'n' );" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 37 "The above loop creates an animation, " }{TEXT 19 2 "Pn" }{TEXT -1 11 ", for each " }{XPPEDIT 18 0 "n" "6#%\"nG" }{TEXT -1 174 " = 1, \+ 2, .., 6. Now, we display these animations. In each animation, try to \+ determine if the \"area\" under the curve is positive, negative, or ze ro. Hint: Look for symmetries." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 3 "P1;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 3 "P2;" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 3 "P3;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 3 "P4;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 3 " P5;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 3 "P6;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 15 "" 0 "" {TEXT -1 41 " Do you see any patterns to these results?" }}{PARA 15 "" 0 "" {TEXT -1 33 "How are the plots different when " }{XPPEDIT 18 0 "m=n" "6#/%\" mG%\"nG" }{TEXT -1 24 " from what you see when " }{XPPEDIT 18 0 "m<>n " "6#0%\"mG%\"nG" }{TEXT -1 1 "?" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{SECT 1 {PARA 4 "" 0 "" {TEXT -1 38 "Step 2: Ana lytic Evaluation with Maple" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 77 "Nex t, we attempt to evaluate these definite integrals. To get started we \+ use " }{XPPEDIT 18 0 "m" "6#%\"mG" }{TEXT -1 2 ", " }{XPPEDIT 18 0 "n " "6#%\"nG" }{TEXT -1 227 " = 1, 2, 3 (please increase this to 10, and do not be concerned with the display of the 10x10 matrix). This time \+ the results will be displayed in a matrix. To facilitate this, define \+ a Maple function that accepts the values of " }{XPPEDIT 18 0 "m" "6#% \"mG" }{TEXT -1 5 " and " }{XPPEDIT 18 0 "n" "6#%\"nG" }{TEXT -1 35 " \+ and returns the definite integral " }{XPPEDIT 18 0 "Int( sin(m*x)*sin( n*x), x=-Pi..Pi )" "6#-%$IntG6$*&-%$sinG6#*&%\"mG\"\"\"%\"xGF,F,-F(6#* &%\"nGF,F-F,F,/F-;,$%#PiG!\"\"F5" }{TEXT -1 1 "." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 96 "N := 3:\nF := unapply( Int( sm*sn, x=-Pi..Pi \+ ), (m,n) ):\nM := Matrix( N, N, F, shape=symmetric );" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 40 "Then ask Maple to evaluate the integrals " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "M = map( value, M );" } }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{SECT 1 {PARA 4 "" 0 "" {TEXT -1 53 "Step 3: Explicit Evaluation of the Definite Integrals " }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 110 "How did Maple do this? The an swer involves using some trigonometric identities for products of sine functions." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 51 "Smn := sm*sn :\nq1 := combine( Smn, trig ):\nSmn = q1;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 62 "When each side of this equation is integrated with respec t to " }{XPPEDIT 18 0 "x" "6#%\"xG" }{TEXT -1 1 ":" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 94 "q2 := Int( q1, x ):\nq3 := value( q2 ):\nIn t( Smn, x ) = q2;\n` ` = q3;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 51 "Observe that this formula does not make s ense when " }{XPPEDIT 18 0 "m=n" "6#/%\"mG%\"nG" }{TEXT -1 5 " (or " } {XPPEDIT 18 0 "m=-n" "6#/%\"mG,$%\"nG!\"\"" }{TEXT -1 109 ", but that \+ is not an issue at this time). Because the sine function has value 0 f or all integer multiples of " }{XPPEDIT 18 0 "Pi" "6#%#PiG" }{TEXT -1 14 " (and because " }{XPPEDIT 18 0 "m-n" "6#,&%\"mG\"\"\"%\"nG!\"\"" } {TEXT -1 5 " and " }{XPPEDIT 18 0 "m+n" "6#,&%\"mG\"\"\"%\"nGF%" } {TEXT -1 19 " are integers when " }{XPPEDIT 18 0 "m" "6#%\"mG" }{TEXT -1 5 " and " }{XPPEDIT 18 0 "n" "6#%\"nG" }{TEXT -1 75 " are integers) , it is pretty clear that the value of the antiderivative at " } {XPPEDIT 18 0 "Pi" "6#%#PiG" }{TEXT -1 23 " is 0 and the value at " } {XPPEDIT 18 0 "-Pi" "6#,$%#PiG!\"\"" }{TEXT -1 6 " is 0:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 34 "eval( q3, x=Pi ) assuming integer; " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 35 "eval( q3, x=-Pi ) assum ing integer;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 7 "Hence, " } {XPPEDIT 18 0 "Int( sin(m*x)*sin(n*x), x=-Pi..Pi )=0" "6#/-%$IntG6$*&- %$sinG6#*&%\"mG\"\"\"%\"xGF-F--F)6#*&%\"nGF-F.F-F-/F.;,$%#PiG!\"\"F6\" \"!" }{TEXT -1 10 " whenever " }{XPPEDIT 18 0 "m" "6#%\"mG" }{TEXT -1 5 " and " }{XPPEDIT 18 0 "n" "6#%\"nG" }{TEXT -1 19 " are integers wit h " }{XPPEDIT 18 0 "m<>n" "6#0%\"mG%\"nG" }{TEXT -1 1 "." }}{PARA 0 " " 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 23 "To study the case \+ when " }{XPPEDIT 18 0 "m=n" "6#/%\"mG%\"nG" }{TEXT -1 64 " note that t he product of sine functions simplifies to a square:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 24 "Smm := eval( Smn, n=m );" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 46 "Here the appropriate trigonometric identi ty is" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 37 "q4 := combine( Smm , trig ):\nSmm = q4;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 65 "Once agai n, this expression is easily integrated with respect to " }{XPPEDIT 18 0 "x" "6#%\"xG" }{TEXT -1 1 ":" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 92 "q5 := Int( q4, x ):\nq6 := value( q5 ):\nInt( Smm, x \+ ) = q5;\n` ` = q6 + C;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 41 "When this antiderivative is evaluated at " }{XPPEDIT 18 0 "Pi" "6#%#PiG" }{TEXT -1 5 " and " }{XPPEDIT 18 0 "-Pi" "6#,$%#PiG! \"\"" }{TEXT -1 17 ", the results are" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 44 "q7 := eval( q6, x=Pi ) assuming integer:\nq7;" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 3 "and" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 45 "q8 := eval( q6, x=-Pi ) assuming integer:\nq8;" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 24 "respectively, Therefore," }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 32 "Int( Smm, x=-Pi..Pi ) = q7 - q8;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 104 "This verifies the result obtained automatically by Maple in the previous section and the gener al result:" }}{PARA 256 "" 0 "" {TEXT -1 1 " " }{XPPEDIT 18 0 "Int(sin (m*x)*sin(n*x),x = -Pi .. Pi) = PIECEWISE([0, m <> n],[Pi, m = n]);" " 6#/-%$IntG6$*&-%$sinG6#*&%\"mG\"\"\"%\"xGF-F--F)6#*&%\"nGF-F.F-F-/F.;, $%#PiG!\"\"F6-%*PIECEWISEG6$7$\"\"!0F,F27$F6/F,F2" }{TEXT -1 1 " " }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}}{SECT 1 {PARA 3 "" 0 " " {TEXT -1 70 "Example 2 - Fourier sine and cosine coefficients for th e sign function" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 46 "Let f be a func tion defined on the interval ( " }{XPPEDIT 18 0 "-Pi" "6#,$%#PiG!\"\" " }{TEXT -1 2 ", " }{XPPEDIT 18 0 "Pi" "6#%#PiG" }{TEXT -1 67 " ). The Fourier sine and cosine coefficients of f are defined to be" }}{PARA 256 "" 0 "" {TEXT -1 1 " " }{XPPEDIT 18 0 "a[n] = 1/Pi;" "6#/&%\"aG6#% \"nG*&\"\"\"F)%#PiG!\"\"" }{TEXT -1 1 " " }{XPPEDIT 18 0 "Int(f(x)*sin (n*x),x = -Pi .. Pi);" "6#-%$IntG6$*&-%\"fG6#%\"xG\"\"\"-%$sinG6#*&%\" nGF+F*F+F+/F*;,$%#PiG!\"\"F4" }{TEXT -1 6 ", for " }{XPPEDIT 18 0 "n" "6#%\"nG" }{TEXT -1 17 " = 1, 2, 3, .... " }}{PARA 256 "" 0 "" {TEXT -1 1 " " }{XPPEDIT 18 0 "b[n] = 1/Pi;" "6#/&%\"bG6#%\"nG*&\"\"\"F)%#Pi G!\"\"" }{TEXT -1 1 " " }{XPPEDIT 18 0 "Int(f(x)*cos(n*x),x = -Pi .. P i)" "6#-%$IntG6$*&-%\"fG6#%\"xG\"\"\"-%$cosG6#*&%\"nGF+F*F+F+/F*;,$%#P iG!\"\"F4" }{TEXT -1 6 ", for " }{XPPEDIT 18 0 "n" "6#%\"nG" }{TEXT -1 17 " = 0, 1, 2, .... " }}{PARA 0 "" 0 "" {TEXT -1 62 "To illustrate this definition, let f be the ``sign function'':" }}{PARA 256 "" 0 " " {TEXT -1 1 " " }{XPPEDIT 18 0 "f(x) = PIECEWISE( [ 1, x>0 ], [0,x=0] , [ -1, x<0 ] )" "6#/-%\"fG6#%\"xG-%*PIECEWISEG6%7$\"\"\"2\"\"!F'7$F./ F'F.7$,$F,!\"\"2F'F." }{TEXT -1 2 " ." }}{PARA 0 "" 0 "" {TEXT -1 48 " In Maple, this function is implemented with the " }{HYPERLNK 17 "signu m" 2 "signum" "" }{TEXT -1 9 " command." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 70 "plot( signum(x), x=-Pi..Pi, discont=true, title=\"The sign function\" );" }}}{EXCHG {PARA 15 "" 0 "" {TEXT -1 62 "Do you se e the isolated point at the origin in the above plot?" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 93 "The Fourier sine coefficients for this function are defined in \+ terms of the definite integral" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 57 "q1 := Int( signum(x)*sin(n*x), x=-Pi..Pi )/Pi:\na[n] = q1;" }} }{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{SECT 1 {PARA 4 "" 0 " " {TEXT -1 51 "Step 1: Develop Intuition with Graphical Animations" }} {SECT 1 {PARA 5 "" 0 "" {TEXT -1 17 "Sine Coefficients" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 44 "First, we look at the graph of the produc ts " }{XPPEDIT 18 0 "signum(x)*sin(n*x);" "6#*&-%'signumG6#%\"xG\"\"\" -%$sinG6#*&%\"nGF(F'F(F(" }{TEXT -1 5 " for " }{XPPEDIT 18 0 "n" "6#% \"nG" }{TEXT -1 16 " = 1, 2, .., 10." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 15 "sn := sin(n*x);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 189 "N := 10:\nq := [seq(\n plot( signum(x)*sn, x= -Pi..Pi, view=[-Pi..Pi,-1..1],\n title=sprintf(\"Plot of \+ %a\", signum(x)*sn) ),\n n=1..N )]:\ndisplay( q, insequence=tru e );" }}}{EXCHG {PARA 15 "" 0 "" {TEXT -1 59 "Do you see a pattern to \+ the area between the curve and the " }{XPPEDIT 18 0 "x" "6#%\"xG" } {TEXT -1 24 "-axis in these pictures?" }}{PARA 15 "" 0 "" {TEXT -1 29 "What can you say by symmetry?" }}{PARA 15 "" 0 "" {TEXT -1 53 "What i s different about the symmetry for frames with " }{XPPEDIT 18 0 "n" "6 #%\"nG" }{TEXT -1 10 " even and " }{XPPEDIT 18 0 "n" "6#%\"nG" }{TEXT -1 5 " odd?" }}{PARA 15 "" 0 "" {TEXT -1 97 "Are these functions even \+ or odd (or neither)? (How does that help you to evaluate the integrals ?)" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{SECT 1 {PARA 5 "" 0 "" {TEXT -1 19 "Cosine Coefficients" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 52 "Repeating this step for the cosine coefficients for " } {XPPEDIT 18 0 "n" "6#%\"nG" }{TEXT -1 19 " = 0, 1, 2, .., 10:" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 15 "cn := cos(n*x);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 203 "N := 10:\nq := [seq(\n plot ( signum(x)*cn, x=-Pi..Pi, view=[-Pi..Pi,-1..1], discont=true,\n \+ title=sprintf(\"Plot of %a\", signum(x)*cn) ),\n n=0..N )]:\ndisplay( q, insequence=true );" }}}{EXCHG {PARA 15 "" 0 "" {TEXT -1 59 "Do you see a pattern to the area between the curve and th e " }{XPPEDIT 18 0 "x" "6#%\"xG" }{TEXT -1 24 "-axis in these pictures ?" }}{PARA 15 "" 0 "" {TEXT -1 29 "What can you say by symmetry?" }} {PARA 15 "" 0 "" {TEXT -1 53 "What is different about the symmetry for frames with " }{XPPEDIT 18 0 "n" "6#%\"nG" }{TEXT -1 10 " even and " }{XPPEDIT 18 0 "n" "6#%\"nG" }{TEXT -1 5 " odd?" }}{PARA 15 "" 0 "" {TEXT -1 45 "Are these functions even or odd (or neither)?" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}}{SECT 1 {PARA 4 "" 0 "" {TEXT -1 38 "Step 2: Analytic Evaluation with Maple" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 89 "Next, we attempt to evaluate the definite integra ls for the sine and cosine coefficients." }}}{SECT 1 {PARA 5 "" 0 "" {TEXT -1 17 "Sine Coefficients" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 23 " To get started we use " }{XPPEDIT 18 0 "n" "6#%\"nG" }{TEXT -1 146 " \+ = 1, 2, .., 10. This time the results will be displayed in a column ve ctor. To facilitate this, define a Maple function that accepts a value for " }{XPPEDIT 18 0 "n" "6#%\"nG" }{TEXT -1 35 " and returns the def inite integral " }{XPPEDIT 18 0 "1/Pi" "6#*&\"\"\"F$%#PiG!\"\"" } {TEXT -1 1 " " }{XPPEDIT 18 0 "Int(signum(x)*sin(n*x),x = -Pi .. Pi); " "6#-%$IntG6$*&-%'signumG6#%\"xG\"\"\"-%$sinG6#*&%\"nGF+F*F+F+/F*;,$% #PiG!\"\"F4" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 86 "N := 10:\nA \+ := unapply( Int( signum(x)*sn, x=-Pi..Pi )/Pi, n ):\nM := Matrix( N, 1 , A );" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 27 "To evaluate these integ rals" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "M = map( value, M ) ;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{SECT 1 {PARA 5 " " 0 "" {TEXT -1 19 "Cosine Coefficients" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 50 "Repeating these steps for the cosine coefficients:" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 86 "N := 10:\nB := unapply( Int( signum(x)*cn, x=-Pi..Pi )/Pi, n ):\nM := Matrix( N, 1, B );" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 27 "To evaluate these integrals" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "M = map( value, M );" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 35 "Here the pattern is pretty obvious !" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 30 "But, we still have to compute " }{XPPEDIT 18 0 "b[0]" "6#&%\"bG6#\"\"!" } {TEXT -1 85 ". Replace the %? in the following command to create a val id Maple command to compute " }{XPPEDIT 18 0 "b[0]" "6#&%\"bG6#\"\"!" }{TEXT -1 63 ". Then, execute both commands (in order) and find the va lue of " }{XPPEDIT 18 0 "b[0]" "6#&%\"bG6#\"\"!" }{TEXT -1 1 "." }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 10 "B0 := %? ;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "value( B0 );" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 0 "" }}}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 36 "To conclud e, we have discovered that" }}{PARA 256 "" 0 "" {TEXT -1 1 " " } {XPPEDIT 18 0 "a[n] = PIECEWISE( [4/Pi/n, `n odd` ], [0, `n even`] )" "6#/&%\"aG6#%\"nG-%*PIECEWISEG6$7$*(\"\"%\"\"\"%#PiG!\"\"F'F0%&n~oddG7 $\"\"!%'n~evenG" }{TEXT -1 18 ", for all " }{XPPEDIT 18 0 "n" "6#%\"nG" }{TEXT -1 17 " = 1, 2, 3, .... " }}{PARA 256 "" 0 "" {TEXT -1 1 " " }{XPPEDIT 18 0 "b[n] = 0" "6#/&%\"bG6#%\"nG\"\"!" }{TEXT -1 44 ", for all " }{XPPEDIT 18 0 "n" " 6#%\"nG" }{TEXT -1 17 " = 0, 1, 2, .... " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{SECT 1 {PARA 4 "" 0 "" {TEXT -1 53 "Step 3: Exp licit Evaluation of the Definite Integrals" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 68 "To evaluate these integrals by hand, we would divide the \+ interval ( " }{XPPEDIT 18 0 "-Pi" "6#,$%#PiG!\"\"" }{TEXT -1 2 ", " } {XPPEDIT 18 0 "Pi" "6#%#PiG" }{TEXT -1 21 " ) into two pieces ( " } {XPPEDIT 18 0 "-Pi" "6#,$%#PiG!\"\"" }{TEXT -1 15 ", 0 ) and ( 0, " } {XPPEDIT 18 0 "Pi" "6#%#PiG" }{TEXT -1 3 " )." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{SECT 1 {PARA 5 "" 0 "" {TEXT -1 17 "Sine Co efficients" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 90 "q2 := Int( sig num(x)*sin(n*x), x=-Pi..Pi )/Pi:\nA(n) = q2;\n` ` = valu e( q2 );" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 84 "When we tell Maple th at n (and any other variables in this expression) are integers:" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 29 "value( q2 ) assuming integer ;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 81 "To reduce this even further, look at the cases when n is odd and even separately:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 25 "value( q2 ) assuming odd;" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 26 "value( q2 ) assuming even;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 59 "This is consistent with the res ults found in Steps 1 and 2." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{SECT 1 {PARA 5 "" 0 "" {TEXT -1 19 "Cosine Coefficients" } }{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 75 "q3 := Int( signum(x)*cos(n* x), x=-Pi..Pi )/Pi:\nB(n) = q3;\n`` = value( q3 );" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 65 "This, too, is consistent with the results found i n Steps 1 and 2." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}} {SECT 1 {PARA 4 "" 0 "" {TEXT -1 10 "Discussion" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 160 "Why do we care about Fourier sine and cosine coeffi cients. While this will be studied in greater detail in a later lab, h ere is a preview. Define the functions" }}{PARA 257 "" 0 "" {TEXT -1 1 " " }{XPPEDIT 18 0 "F[n](x) = Sum(a[m]*sin(m*x),m = 1 .. n)+b[0]/2+S um(b[m]*cos(m*x),m = 1 .. n)" "6#/-&%\"FG6#%\"nG6#%\"xG,(-%$SumG6$*&&% \"aG6#%\"mG\"\"\"-%$sinG6#*&F3F4F*F4F4/F3;F4F(F4*&&%\"bG6#\"\"!F4\"\"# !\"\"F4-F-6$*&&F=6#F3F4-%$cosG6#*&F3F4F*F4F4/F3;F4F(F4" }{TEXT -1 5 " \+ for " }{XPPEDIT 18 0 "n" "6#%\"nG" }{TEXT -1 13 " = 1, 2, ...." }} {PARA 0 "" 0 "" {TEXT -1 49 "Note that more and more coefficients are \+ used in " }{XPPEDIT 18 0 "F[n]" "6#&%\"FG6#%\"nG" }{TEXT -1 31 " as n \+ increases. The following " }{TEXT 19 11 "FourierAnim" }{TEXT -1 95 " c ommand creates a 12-frame animation in which each frame consists of th e signum function on [ " }{XPPEDIT 18 0 "-Pi" "6#,$%#PiG!\"\"" }{TEXT -1 2 ", " }{XPPEDIT 18 0 "Pi" "6#%#PiG" }{TEXT -1 7 " ] and " } {XPPEDIT 18 0 "F[n]" "6#&%\"FG6#%\"nG" }{TEXT -1 6 " on [ " }{XPPEDIT 18 0 "-3*Pi" "6#,$*&\"\"$\"\"\"%#PiGF&!\"\"" }{TEXT -1 2 ", " } {XPPEDIT 18 0 "3*Pi" "6#*&\"\"$\"\"\"%#PiGF%" }{TEXT -1 4 " ]. " }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 29 "FourierAnim( signum(x), 12 ) ;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 25 "Notice how the graphs of " } {XPPEDIT 18 0 "y=F[n](x)" "6#/%\"yG-&%\"FG6#%\"nG6#%\"xG" }{TEXT -1 13 " have period " }{XPPEDIT 18 0 "2*Pi" "6#*&\"\"#\"\"\"%#PiGF%" } {TEXT -1 9 " for all " }{XPPEDIT 18 0 "n" "6#%\"nG" }{TEXT -1 15 ". Mo reover, as " }{XPPEDIT 18 0 "n" "6#%\"nG" }{TEXT -1 26 " increases, th e graphs of " }{XPPEDIT 18 0 "y=F[n](x)" "6#/%\"yG-&%\"FG6#%\"nG6#%\"x G" }{TEXT -1 70 " provide better and better approximations to the sign um function on [ " }{XPPEDIT 18 0 "-Pi" "6#,$%#PiG!\"\"" }{TEXT -1 2 " , " }{XPPEDIT 18 0 "Pi" "6#%#PiG" }{TEXT -1 3 " ]." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}}{SECT 0 {PARA 3 "" 0 "" {TEXT -1 13 " Lab Questions" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 12 "1. Consider " } {XPPEDIT 18 0 "sin(m*x)*cos(n*x)" "6#*&-%$sinG6#*&%\"mG\"\"\"%\"xGF)F) -%$cosG6#*&%\"nGF)F*F)F)" }{TEXT -1 14 " for integers " }{XPPEDIT 18 0 "m" "6#%\"mG" }{TEXT -1 5 " and " }{XPPEDIT 18 0 "n" "6#%\"nG" } {TEXT -1 23 ". What is the value of " }{XPPEDIT 18 0 "Int(sin(m*x)*cos (n*x),x = -Pi .. Pi);" "6#-%$IntG6$*&-%$sinG6#*&%\"mG\"\"\"%\"xGF,F,-% $cosG6#*&%\"nGF,F-F,F,/F-;,$%#PiG!\"\"F6" }{TEXT -1 2 " ?" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 12 "2. Consider " }{XPPEDIT 18 0 "cos(m*x)*co s(n*x)" "6#*&-%$cosG6#*&%\"mG\"\"\"%\"xGF)F)-F%6#*&%\"nGF)F*F)F)" } {TEXT -1 14 " for integers " }{XPPEDIT 18 0 "m" "6#%\"mG" }{TEXT -1 5 " and " }{XPPEDIT 18 0 "n" "6#%\"nG" }{TEXT -1 24 ". What is the value of " }{XPPEDIT 18 0 "Int( cos(m*x) * cos(n*x), x=-Pi..Pi )" "6#-%$In tG6$*&-%$cosG6#*&%\"mG\"\"\"%\"xGF,F,-F(6#*&%\"nGF,F-F,F,/F-;,$%#PiG! \"\"F5" }{TEXT -1 2 " ?" }}}{SECT 1 {PARA 4 "" 0 "" {TEXT -1 27 "Hint: Lab Questions 1 and 2" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 31 "cm := cos(m*x);\ncn := cos(n*x);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 109 "Copy the Example 1 section (or selected Steps) here twice - once \+ for Question 1 and once for Question 2. Use " }{TEXT 19 2 "cm" }{TEXT -1 5 " and " }{TEXT 19 2 "cn" }{TEXT -1 52 " defined above to replace \+ appropriate occurrence of " }{TEXT 19 2 "sm" }{TEXT -1 5 " and " } {TEXT 19 2 "sn" }{TEXT -1 51 " in Example 1 and execute the appropriat e commands." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 24 "3. For the square wave, " }{XPPEDIT 18 0 "F[3](x)= 4/Pi * sin(x) + 4/(3*Pi) * sin( 3*x)" "6#/-&%\"FG6#\"\"$6#% \"xG,&*(\"\"%\"\"\"%#PiG!\"\"-%$sinG6#F*F.F.*(F-F.*&F(F.F/F.F0-F26#*&F (F.F*F.F.F." }{TEXT -1 9 ". Why is " }{XPPEDIT 18 0 "F[4](x) = F[3](x) " "6#/-&%\"FG6#\"\"%6#%\"xG-&F&6#\"\"$6#F*" }{TEXT -1 1 "?" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 32 "4. The ``sawtooth function'' is " } {XPPEDIT 18 0 "f(x) = x" "6#/-%\"fG6#%\"xGF'" }{TEXT -1 6 ", for " } {XPPEDIT 18 0 "-Pi" "6#,$%#PiG!\"\"" }{TEXT -1 4 " <= " }{XPPEDIT 18 0 "x" "6#%\"xG" }{TEXT -1 4 " <= " }{XPPEDIT 18 0 "Pi" "6#%#PiG" } {TEXT -1 33 ", and f is periodic with period " }{XPPEDIT 18 0 "2*Pi" "6#*&\"\"#\"\"\"%#PiGF%" }{TEXT -1 8 ", i.e., " }{XPPEDIT 18 0 "f(x+2* n*Pi) = f(x)" "6#/-%\"fG6#,&%\"xG\"\"\"*(\"\"#F)%\"nGF)%#PiGF)F)-F%6#F (" }{TEXT -1 5 " for " }{XPPEDIT 18 0 "-Pi" "6#,$%#PiG!\"\"" }{TEXT -1 4 " <= " }{XPPEDIT 18 0 "x" "6#%\"xG" }{TEXT -1 4 " <= " }{XPPEDIT 18 0 "Pi" "6#%#PiG" }{TEXT -1 5 " and " }{XPPEDIT 18 0 "n" "6#%\"nG" } {TEXT -1 12 " an integer." }}{PARA 0 "" 0 "" {TEXT -1 144 " Find th e Fourier sine coefficient for the sawtooth function. Report both the \+ general formula and the first five Fourier sine coefficients., " } {XPPEDIT 18 0 "a[n];" "6#&%\"aG6#%\"nG" }{TEXT -1 2 ", " }{XPPEDIT 18 0 "n" "6#%\"nG" }{TEXT -1 15 " = 1, 2, .., 5." }}}{SECT 1 {PARA 4 "" 0 "" {TEXT -1 20 "Hint: Lab Question 4" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 66 "To implement the sawtooth function in Maple, you may writ e either " }{TEXT 19 1 "f" }{TEXT -1 85 " (after executing the followi ng command) or, since all integration will be done on ( " }{XPPEDIT 18 0 "-Pi" "6#,$%#PiG!\"\"" }{TEXT -1 2 ", " }{XPPEDIT 18 0 "Pi" "6#%# PiG" }{TEXT -1 16 " ), simply type " }{TEXT 19 1 "x" }{TEXT -1 47 " wh enever you need to reference the function f." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 7 "f := x;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 156 " I recommend copying the Example 2 section (or selected Steps from Exa mple 1) and pasting it following this hint. Make the changes in the co py of Example 2." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 11 "5. Use the " }{TEXT 19 11 "Fourier Anim" }{TEXT -1 59 " command to create an animation showing that the g raphs of " }{XPPEDIT 18 0 "y=F[n](x)" "6#/%\"yG-&%\"FG6#%\"nG6#%\"xG" }{TEXT -1 66 " converge to the sawtooth function. What is the smallest value of " }{XPPEDIT 18 0 "n" "6#%\"nG" }{TEXT -1 24 " for which the \+ graph of " }{XPPEDIT 18 0 "y=F[n](x)" "6#/%\"yG-&%\"FG6#%\"nG6#%\"xG" }{TEXT -1 33 " has a maximum value larger than " }{XPPEDIT 18 0 "Pi" " 6#%#PiG" }{TEXT -1 22 "? Write this function " }{XPPEDIT 18 0 "F[n](x) " "6#-&%\"FG6#%\"nG6#%\"xG" }{TEXT -1 1 "." }}}{SECT 1 {PARA 4 "" 0 " " {TEXT -1 20 "Hint: Lab Question 5" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 12 "Replace the " }{TEXT 19 2 "%?" }{TEXT -1 88 " with an integer a nd look at the individual frames to answer this question. Do not make \+ " }{XPPEDIT 18 0 "n" "6#%\"nG" }{TEXT -1 24 " too small or too large. " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 21 "FourierAnim( x, %? );" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 24 "6. [Essay Question] Let " }{XPPEDIT 18 0 "f(x) = Sum(a [n]*sin(n*x),n = 0 .. 3);" "6#/-%\"fG6#%\"xG-%$SumG6$*&&%\"aG6#%\"nG\" \"\"-%$sinG6#*&F/F0F'F0F0/F/;\"\"!\"\"$" }{TEXT -1 3 " = " }{XPPEDIT 18 0 "a[1]*sin(x)+a[2]*sin(2*x)+a[3]*sin(3*x);" "6#,(*&&%\"aG6#\"\"\"F (-%$sinG6#%\"xGF(F(*&&F&6#\"\"#F(-F*6#*&F0F(F,F(F(F(*&&F&6#\"\"$F(-F*6 #*&F7F(F,F(F(F(" }{TEXT -1 13 ". Explain why" }}{PARA 258 "" 0 "" {TEXT -1 1 " " }{XPPEDIT 18 0 "Int(f(x)^2,x = -Pi .. Pi) = Pi*Sum(a[n] ^2,n = 1 .. 3);" "6#/-%$IntG6$*$-%\"fG6#%\"xG\"\"#/F+;,$%#PiG!\"\"F0*& F0\"\"\"-%$SumG6$*$&%\"aG6#%\"nGF,/F;;F3\"\"$F3" }{TEXT -1 3 " = " } {XPPEDIT 18 0 "Pi*(a[1]^2+a[2]^2+a[3]^2);" "6#*&%#PiG\"\"\",(*$&%\"aG6 #F%\"\"#F%*$&F)6#F+F+F%*$&F)6#\"\"$F+F%F%" }{TEXT -1 2 ". " }}{PARA 0 "" 0 "" {TEXT -1 118 "Note that all integrals that arise in this probl em have been evaluated earlier in this lab. You can use the fact that \+ " }{XPPEDIT 18 0 "Int(sin(m*x)*sin(n*x),x = -Pi .. Pi) = PIECEWISE([0, m <> n],[Pi, m = n])" "6#/-%$IntG6$*&-%$sinG6#*&%\"mG\"\"\"%\"xGF-F-- F)6#*&%\"nGF-F.F-F-/F.;,$%#PiG!\"\"F6-%*PIECEWISEG6$7$\"\"!0F,F27$F6/F ,F2" }{TEXT -1 21 " without explanation." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}} {MARK "0 0 0" 0 }{VIEWOPTS 1 1 0 1 1 1803 1 1 1 1 }{PAGENUMBERS 0 1 2 33 1 1 }