{VERSION 3 0 "APPLE_PPC_MAC" "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 259 "" 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 }{CSTYLE "" -1 260 "" 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 }{CSTYLE "" -1 261 "" 0 1 0 0 0 0 0 0 1 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 "Text \+ Output" -1 2 1 {CSTYLE "" -1 -1 "Courier" 1 10 0 0 255 1 0 0 0 0 0 1 3 0 3 }1 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 }1 0 0 0 6 6 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 }0 0 0 -1 4 4 0 0 0 0 0 0 -1 0 }{PSTYLE "Warning" 2 7 1 {CSTYLE "" -1 -1 "" 0 1 0 0 255 1 0 0 0 0 0 0 1 0 0 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "Error" 7 8 1 {CSTYLE "" -1 -1 "" 0 1 255 0 255 1 0 0 0 0 0 0 0 0 0 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 } {PSTYLE "Title" 0 18 1 {CSTYLE "" -1 -1 "" 1 18 0 0 0 0 0 1 1 0 0 0 0 0 0 }3 0 0 -1 12 12 0 0 0 0 0 0 19 0 }{PSTYLE "" 4 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 {PARA 18 "" 0 "" {TEXT -1 37 "Linear Methods of Applied Mathem atics" }}{PARA 256 "" 0 "" {TEXT -1 44 "Examples of Calculations with \+ Fourier Series" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{SECT 0 {PARA 3 "" 0 "" {TEXT -1 85 "Copyright 1998, 2000 by Evans M. Harrell II and Jame s V. Herod. All rights reserved." }}}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 35 "The formulae for the Fourier series" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 47 "Here is the sine series on the interval [0 ,L]:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 35 " The sine Fou rier approximation: " }{XPPEDIT 18 0 "sum(b[n]*sin(n*pi*x/L),n = 1 .. \+ N);" "6#-%$sumG6$*&&%\"bG6#%\"nG\"\"\"-%$sinG6#**F*F+%#piGF+%\"xGF+%\" LG!\"\"F+/F*;\"\"\"%\"NG" }{TEXT -1 1 " " }}{PARA 0 "" 0 "" {TEXT -1 11 " where " }{XPPEDIT 18 0 "b[n];" "6#&%\"bG6#%\"nG" }{TEXT -1 3 " = " }{XPPEDIT 18 0 "2*int(f(x)*sin(n*Pi*x/L),x = 0 .. L)/L;" "6#*(\" \"#\"\"\"-%$intG6$*&-%\"fG6#%\"xGF%-%$sinG6#**%\"nGF%%#PiGF%F-F%%\"LG! \"\"F%/F-;\"\"!F4F%F4F5" }{TEXT -1 8 " , for " }{XPPEDIT 18 0 "1 <= n ;" "6#1\"\"\"%\"nG" }{TEXT -1 2 " ." }}{PARA 0 "" 0 "" {TEXT -1 0 "" } }{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 49 "Here is \+ the cosine series on the interval [0 ,L]:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 34 "The cosine Fourier approximation: \+ " }{XPPEDIT 18 0 "sum(a[n]*cos(n*pi*x/L),n = 0 .. N);" "6#-%$sumG6$*&& %\"aG6#%\"nG\"\"\"-%$cosG6#**F*F+%#piGF+%\"xGF+%\"LG!\"\"F+/F*;\"\"!% \"NG" }{TEXT -1 1 " " }}{PARA 0 "" 0 "" {TEXT -1 11 " where " } {XPPEDIT 18 0 "a[n];" "6#&%\"aG6#%\"nG" }{TEXT -1 3 " = " }{XPPEDIT 18 0 "2*int(f(x)*cos(n*Pi*x/L),x = 0 .. L)/L;" "6#*(\"\"#\"\"\"-%$intG 6$*&-%\"fG6#%\"xGF%-%$cosG6#**%\"nGF%%#PiGF%F-F%%\"LG!\"\"F%/F-;\"\"!F 4F%F4F5" }{TEXT -1 8 " , for " }{XPPEDIT 18 0 "1 <= n;" "6#1\"\"\"%\" nG" }{TEXT -1 6 " and " }{XPPEDIT 18 0 "a[0];" "6#&%\"aG6#\"\"!" } {TEXT -1 3 " = " }{XPPEDIT 18 0 "1*int(f(x),x = 0 .. L)/L;" "6#*(\"\" \"\"\"\"-%$intG6$-%\"fG6#%\"xG/F,;\"\"!%\"LGF%F0!\"\"" }{TEXT -1 2 " . " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 108 "We i llustrate these expansions with several functions in the following sec tions. Here we give two examples:" }}{PARA 0 "" 0 "" {TEXT -1 9 "f(x) = x:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "restart;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "L:=1;\nN:=3;\nf:=x->x;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 48 " b:=n->evalf(2/L*int(sin(n*Pi*x/L)*f(x),x=0..L));" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 45 "approxs:=x->sum('b(n)*sin(n*Pi*x/L)',n=1..N); " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 96 "a:=n->if n = 0 then evalf(1/L*int(f(x),x=0..L) )\nelse evalf(2/L*int(cos(n*Pi*x)*f(x),x=0..L))\nfi;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 48 "approxc:=x->sum('a(n)*cos(n*Pi*x/L)','n'= 0..10);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 98 "plot([[x,f(x),x= 0..L],[x,approxs(x),x=-L..L],[x,approxc(x),x=-L..L]],\n color=[BLACK ,RED,GREEN]);" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 28 "For f(x) = Heaviside(x-1/2):" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 49 "L:=1;\nN:=3;\nf:=x->p iecewise(0<=x and x<=L/2,0,1);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 46 "b:=n->evalf(2/L*int(sin(n*Pi*x)*f(x),x=0..L));" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 45 "approxs:=x->sum('b(n)*sin(n*Pi*x/L) ',n=1..N);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 96 "a:=n->if n = 0 then evalf(1/L*int(f (x),x=0..L))\nelse evalf(2/L*int(cos(n*Pi*x)*f(x),x=0..L))\nfi;" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 47 "approxc:=x->sum('a(n)*cos(n* Pi*x/L)','n'=0..N);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 98 "plot ([[x,f(x),x=0..L],[x,approxs(x),x=-L..L],[x,approxc(x),x=-L..L]],\n \+ color=[BLACK,RED,GREEN]);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 36 "convert(Heaviside(x-1/2),piecewise);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 52 "Here is the Fourier trigonometric series on [-L, L]:" }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 8 " with " }{XPPEDIT 18 0 "a[n];" "6#&%\"aG6#%\"nG" }{TEXT -1 3 " = " }{XPPEDIT 18 0 "int(f(x)*cos(n*Pi*x/L),x = -L .. L)/L;" "6#*&-%$intG6$*&-%\"fG6# %\"xG\"\"\"-%$cosG6#**%\"nGF,%#PiGF,F+F,%\"LG!\"\"F,/F+;,$F3F4F3F,F3F4 " }{TEXT -1 8 " , for " }{XPPEDIT 18 0 "1 <= n;" "6#1\"\"\"%\"nG" } {TEXT -1 6 " and " }{XPPEDIT 18 0 "a[0];" "6#&%\"aG6#\"\"!" }{TEXT -1 3 " = " }{XPPEDIT 18 0 "int(f(x),x = 0 .. L)/(2*L);" "6#*&-%$intG6$ -%\"fG6#%\"xG/F*;\"\"!%\"LG\"\"\"*&\"\"#F/F.F/!\"\"" }{TEXT -1 1 " " } }{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 9 " and \+ " }{XPPEDIT 18 0 "b[n];" "6#&%\"bG6#%\"nG" }{TEXT -1 3 " = " } {XPPEDIT 18 0 "int(f(x)*sin(n*Pi*x/L),x = 0 .. L)/L;" "6#*&-%$intG6$*& -%\"fG6#%\"xG\"\"\"-%$sinG6#**%\"nGF,%#PiGF,F+F,%\"LG!\"\"F,/F+;\"\"!F 3F,F3F4" }{TEXT -1 8 " , for " }{XPPEDIT 18 0 "1 <= n;" "6#1\"\"\"%\" nG" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 52 "We \+ illustrate this expansion with several functions." }}}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 9 "Examples." }}{PARA 0 "" 0 "" {TEXT -1 15 "For f(x) = |x|." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 26 "L:=1;\nN:=10;\nf:=x->abs(x);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 102 "a:=n->if n = 0 then evalf(1/(2*L)*int(f(x),x=-L ..L))\nelse evalf(1/L*int(cos(n*Pi*x)*f(x),x=-L..L))\nfi;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 47 "b:=n->evalf(1/L*int(sin(n*Pi*x)*f(x ),x=-L..L));" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 83 "approx:=x-> sum('a(n)*cos(n*Pi*x/L)','n'=0..N) + sum('b(n)*sin(n*Pi*x/L)','n'=1..N );" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 55 "plot([[x,f(x),x=-L..L ],[x,approx(x),x=-3*L/2..3*L/2]]);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 22 "For f(x) = | sin(x) |:" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 34 "L:=1;\nN:=10;\nf:=x->abs(sin(Pi*x));" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 102 "a:=n->if n = 0 then evalf(1/(2*L)* int(f(x),x=-L..L))\nelse evalf(1/L*int(cos(n*Pi*x)*f(x),x=-L..L))\nfi; " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 47 "b:=n->evalf(1/L*int(sin (n*Pi*x)*f(x),x=-L..L));" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 83 "approx:=x->sum('a(n)*cos(n*Pi*x/L)','n'=0..N) + sum('b(n)*sin(n*Pi*x/ L)','n'=1..N);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 55 "plot([[x, f(x),x=-L..L],[x,approx(x),x=-3*L/2..3*L/2]]);" }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 " " }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 28 "For \+ f(x) = 2*Heaviside(x)-1:" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 39 " L:=1;\nN:=3;\nf:=x->piecewise(x<=0,-1,1);" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 102 "a:=n->if n = 0 then evalf(1/(2*L)*int(f(x),x=-L..L ))\nelse evalf(1/L*int(cos(n*Pi*x)*f(x),x=-L..L))\nfi;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 47 "b:=n->evalf(1/L*int(sin(n*Pi*x)*f(x ),x=-L..L));" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 83 "approx:=x-> sum('a(n)*cos(n*Pi*x/L)','n'=0..N) + sum('b(n)*sin(n*Pi*x/L)','n'=1..N );" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 55 "plot([[x,f(x),x=-L..L ],[x,approx(x),x=-3*L/2..3*L/2]]);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 28 "For f(x) as indicated below." } }{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 73 "L:=1;\nN:=3;\nf:=x->piecewi se(x<=-1/2,2*(x+1),-1/2 " 0 "" {MPLTEXT 1 0 102 "a:=n->if n = 0 then evalf(1/(2*L)*int(f(x),x =-L..L))\nelse evalf(1/L*int(cos(n*Pi*x)*f(x),x=-L..L))\nfi;" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 47 "b:=n->evalf(1/L*int(sin(n*Pi *x)*f(x),x=-L..L));" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 83 "appr ox:=x->sum('a(n)*cos(n*Pi*x/L)','n'=0..N) + sum('b(n)*sin(n*Pi*x/L)',' n'=1..N);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 55 "plot([[x,f(x), x=-L..L],[x,approx(x),x=-3*L/2..3*L/2]]);" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 0 "" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 " " {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 34 "For f(x) = 4 Heaviside( x) x (1-x):" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 46 "L:=1;\nN:=3; \nf:=x->piecewise(x<=0,0,4*x*(1-x));" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 102 "a:=n->if n = 0 then evalf(1/(2*L)*int(f(x),x=-L..L)) \nelse evalf(1/L*int(cos(n*Pi*x)*f(x),x=-L..L))\nfi;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 47 "b:=n->evalf(1/L*int(sin(n*Pi*x)*f(x),x=-L ..L));" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 83 "approx:=x->sum('a (n)*cos(n*Pi*x/L)','n'=0..N) + sum('b(n)*sin(n*Pi*x/L)','n'=1..N);" }} }{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 55 "plot([[x,f(x),x=-L..L],[x,a pprox(x),x=-3*L/2..3*L/2]]);" }}{PARA 8 "" 1 "" {TEXT -1 59 "Error, (i n plot) parameter range must evaluate to a numeric" }}}{PARA 0 "" 0 " " {TEXT -1 184 "Here are two more examples. The function f is defined piecewise as a step function on an interval [0,L] and the function g \+ is simply the identity function restricted to that interval." }} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 36 "f:=x->piecewise(xx;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 48 "plot([subs(L= 3,f(x)),g(x)],x=0..3,discont=true);" }}}{PARA 0 "" 0 "" {TEXT -1 47 "W e want to approximate these functions as a sum" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 11 " " }{XPPEDIT 18 0 "a[0]+sum(a[m]*cos(2*Pi*m*x/L),m=1..N)+sum(b[m]*sin(2*Pi*m*x/L),m =1..N)" "6#,(&%\"aG6#\"\"!\"\"\"-%$sumG6$*&&F%6#%\"mGF(-%$cosG6#*,\"\" #F(%#PiGF(F/F(%\"xGF(%\"LG!\"\"F(/F/;\"\"\"%\"NGF(-F*6$*&&%\"bG6#F/F(- %$sinG6#*,\"\"#F(F5F(F/F(F6F(F7F8F(/F/;\"\"\"F 0." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 38 "assume(L>0):\n a.0:=int(f(x),x=0..L)/L;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 72 "a:=(m,L)->2*int(cos(2*m*Pi*x/L)*f(x ),x=0..L)/L;\nseq(a[p]=a(p,L),p=1..5);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 72 "b:=(m,L)->2*int(sin(2*m*Pi*x/L)*f(x),x=0..L)/L;\nseq( b[p]=b(p,L),p=1..5);" }}}{PARA 0 "" 0 "" {TEXT -1 73 "It is of value t o understand why we should not be surprised that all the " }{XPPEDIT 18 0 "a[m]" "6#&%\"aG6#%\"mG" }{TEXT -1 52 " terms are zero. We have a lso listed the first five " }{XPPEDIT 18 0 "b[m]" "6#&%\"bG6#%\"mG" } {TEXT -1 146 "'s with L = Pi. We can write the approximating series f or the discontinuous function f. We plot f and approximations with 2 a nd with three terms." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 117 "App rox:=(x,N,L)->a.0+sum(a(p,Pi)*cos(2*Pi*p*x/Pi),p=1..N)\n \+ + sum(b(p,Pi)*sin(2*Pi*p*x/Pi),p=1..N);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 55 "L:=Pi;plot([f(x),Approx(x,4,L),Approx(x,2,L)],x= 0..Pi);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "Approx(x,2);" }} }{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 11 "evalf(a.2);" }}}}{PARA 0 " " 0 "" {TEXT -1 0 "" }}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 30 "Section 2: Resonance in sound." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 " " {TEXT -1 497 " Using a synthesizer, a sound engineer wishes to m ake the sound of a square wave. The synthesizer can produce middle C a t 256 vibrations/sec, high C at 512 vibrations per second, G above hig h C at about 768 vibrations per second, C above high C at about 1024 v ibrations per second, E at about 1280 vibrations per second, G at abou t 1536 vibrations per second, and A at about 1792 vibrations per secon d. The question is, what should the intensity for each tone be to ach ieve the \"square wave?\"" }}{PARA 0 "" 0 "" {TEXT -1 300 " We dec ide that the square wave will vibrate at a rate of 256 vibrations per \+ second. The goal is to \"hear\" the difference in the square wave and \+ middle C. Here is a comparison of the two graphs over two periods. Fo r the purposes of calculations, we take one unit of time to be 1/256 o f a second." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 43 "s:=x->piecewise(x<1/2,1,x<1,-1,x<3/2,1,-1);" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 45 "plot([s(x),sin(2*Pi*x)],x=0. .2,discont=true);" }}}{PARA 0 "" 0 "" {TEXT -1 109 "The intensity, or \+ loudness, knob for middle c is adjusted to the level determined by the Fourier coefficient." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 38 "lou dC:=2*int(sin(2*Pi*x)*s(x),x=0..1);" }}}{PARA 0 "" 0 "" {TEXT -1 99 " \+ Here is a graph of the desired square wave and the pitch C at the \+ properly adjusted intensity." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 51 "plot([s(x),loudC*sin(2*Pi*x)],x=0..2,discont=true);" }}}{PARA 0 " " 0 "" {TEXT -1 159 " The intensity, or loudness, knob for high C \+ and G are adjusted to the level determined by the Fourier coefficient \+ and combined with the sound of middle C." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 77 "highC:=2*int(sin(4*Pi *x)*s(x),x=0..1);\nhighG:=2*int(sin(6*Pi*x)*s(x),x=0..1);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 69 "plot([s(x),loudC*sin(2*Pi*x)+highG* sin(6*Pi*x)],x=0..2,discont=true);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 122 "highC2:=2*int(sin(8*Pi*x)*s(x),x=0..1);\nhighE2:=2*i nt(sin(10*Pi*x)*s(x),x=0..1);\nhighG2:=2*int(sin(12*Pi*x)*s(x),x=0..1) ;\n" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 102 "plot([s(x),loudC*si n(2*Pi*x)+highG*sin(6*Pi*x)+highE2*sin(10*Pi*x)],\n x=0..2, discont=true);" }}}{PARA 0 "" 0 "" {TEXT -1 135 " The next knob is to adjust the intensity of A above C above high C. The intensity for \+ the knob is caclulated as with the previous." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 41 "highA2:=2*int(sin( 114*Pi*x)*s(x),x=0..1);" }}}{PARA 0 "" 0 "" {TEXT -1 50 " Any of t he following three things can happen." }}{PARA 0 "" 0 "" {TEXT -1 81 " (1) The intensity is so small, that some human ears cannot hear the ne w sound, or" }}{PARA 0 "" 0 "" {TEXT -1 210 "(2) The pitch is so high, that some human ears cannot hear the new sound.\n (For these two groups, the square wave sounds the same as the combination of the pre vious tones.)\nA third possibility could occur." }}{PARA 0 "" 0 "" {TEXT -1 40 "(3) Nearby crystal goblets will shatter!" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 266 " Experiments by K . Battle at the Wiener Staatsoper in Austria [Ref] indicated that a pa rticular crystal goblet will shatter if the intensity of the tone at f requency about 1760 hertz exceeds 0.01 units. We compute the intensi ty of this last addition of a tone." }}{PARA 0 "" 0 "" {TEXT -1 0 "" } }{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "evalf(highA2);" }}}{PARA 0 "" 0 "" {TEXT -1 34 " Nevermind! We make the pitch!" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 115 "plot([s(x),loudC*sin(2*Pi*x)+highG *sin(6*Pi*x)+highE2*sin(10*Pi*x)\n + highA2*sin(14*Pi*x)],x=0..2,di scont=true);" }}}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 48 "Section 3: Calculations for a sawtooth function." }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 191 " To see another example of this process, we create the Fourier series of \+ a periodic extension of f(x) = x, 0 < x < L. Thus, we examine what is \+ the fractional part of x when x is positive" }}{PARA 0 "" 0 "" {TEXT -1 1 " " }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 34 "plot(frac(x),x=0. .3,discont=true);" }}}{PARA 0 "" 0 "" {TEXT -1 44 " The coefficient s are computed as before." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 " f:=x->x;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 33 "L:=1;\na.0:=eva l(int(x,x=0..L)/L);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 63 "a:=m ->2*int(x*cos(2*m*Pi*x/L),x=0..L)/L;\nseq(a[p]=a(p),p=1..5);" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 63 "b:=m->2*int(x*sin(2*m*Pi*x/L ),x=0..L)/L;\nseq(b[p]=b(p),p=1..5);" }}}{PARA 0 "" 0 "" {TEXT -1 73 " It is of value to understand why we should not be surprised that all t he " }{XPPEDIT 18 0 "a[m]" "6#&%\"aG6#%\"mG" }{TEXT -1 52 " terms are \+ zero. We have also listed the first five " }{XPPEDIT 18 0 "b[m]" "6#&% \"bG6#%\"mG" }{TEXT -1 146 "'s with L = Pi. We can write the approxim ating series for the discontinuous function f. We plot f and approxima tions with 2 and with three terms." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 107 "Approx:=(x,N)->a.0+sum(a(p)*cos(2*p*Pi*x/L),p=1..N) \n + sum(b(p)*sin(2*p*Pi*x/L),p=1..N);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 60 "plot([frac(x),Approx(x,4),Approx(x, 2)],x=0..3,discont=true);" }}}}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 23 "Ex tensions of functions" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 261 " Supp ose a function is defined on an interval [0, L]. In this module, we di scuss how to extend the definition of the function so that it is defin ed on a larger interval. We discuss even, odd, and periodic extensions . We examine even and odd extensions first." }}{PARA 0 "" 0 "" {TEXT -1 127 " Here is the graph of f(x) = 4 x (1-x) on the interval [0, 1]. On this graph there is also the even and the odd extension. " }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 103 "a:=1;\nf:=x->4*x*(1-x);\nfe :=proc(x) if x<0 then f(-x)\n else f(x) \n fi \n end;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 145 "fe:=proc(x) if x<0 then f(-x)\n else f(x) \n fi\n end; \nfo:=proc(x) if x<0 then -f(-x)\n else f(x) fi\n end; " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 92 "plot([[x,f(x),x=0..1],[ x,'fe(x)',x=-1..1],[x,'fo(x)',x=-1..1]],\n color=[BLACK,RED,GREEN]); " }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 1 " " } {TEXT 259 27 "Definition of Even Function" }{TEXT -1 78 ": f is even o n the interval [-a, a] if f(x) = f(-x) for all x in the interval." }} {PARA 0 "" 0 "" {TEXT -1 1 " " }{TEXT 260 27 "Definition of Odd Functi on:" }{TEXT -1 77 " f is odd on the interval [-a, a] if f(x) = -f(-x) \+ for all x in the interval." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 230 " These definitions are algebraic. There is a geometric interpretation. A function is even if its graph is symmetri c about the Y axis. A function is odd if its graph is symmetric about \+ the origin. Look at the last graphs drawn." }}{PARA 0 "" 0 "" {TEXT -1 84 " There are functions that are neither even nor odd. You kno w many; here is one: " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 22 "plot(x^3+x^2,x=-1..1);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{PARA 0 "" 0 "" {TEXT -1 1 " " }} {PARA 0 "" 0 "" {TEXT -1 196 "An important idea, however is that every function defined on an interval symmetric about the origin can be wri tten as the sum of an even and an odd function. Here's an example for \+ how to do that: " }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "f:=x->x^ 3+x^2;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 45 "fe:=x->(f(x)+f(-x ))/2;\nfo:=x->(f(x)-f(-x))/2;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "fe(x)+fo(x);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 93 "plot( [[x,f(x),x=-1..1],[x,'fe(x)',x=-1..1],[x,'fo(x)',x=-1..1]],\n color= [BLACK,RED,GREEN]);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 8 "Remarks." }}{PARA 0 "" 0 "" {TEXT -1 46 "(1) Sup pose that f is even on the interval [- " }{XPPEDIT 18 0 "pi;" "6#%#piG " }{TEXT -1 3 ", " }{XPPEDIT 18 0 "pi;" "6#%#piG" }{TEXT -1 8 "]. The n " }{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 5 " = 0." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 45 "(2) Suppose that f is odd on the interval [- " }{XPPEDIT 18 0 " pi;" "6#%#piG" }{TEXT -1 3 ", " }{XPPEDIT 18 0 "pi;" "6#%#piG" } {TEXT -1 8 "]. Then " }{XPPEDIT 18 0 "int(f(x)*cos(n*x),x = -Pi .. Pi) ;" "6#-%$intG6$*&-%\"fG6#%\"xG\"\"\"-%$cosG6#*&%\"nGF+F*F+F+/F*;,$%#Pi G!\"\"F4" }{TEXT -1 5 " = 0." }}{PARA 0 "" 0 "" {TEXT -1 56 "(3) From \+ either of the above two remarks if follows that" }}{PARA 0 "" 0 "" {TEXT -1 26 " " }{XPPEDIT 18 0 "int(sin(n*x)* cos(m*x),x = -Pi .. Pi);" "6#-%$intG6$*&-%$sinG6#*&%\"nG\"\"\"%\"xGF,F ,-%$cosG6#*&%\"mGF,F-F,F,/F-;,$%#PiG!\"\"F6" }{TEXT -1 5 " = 0." }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 152 "Definiti on: The function is periodic if there is a number P such that f(x+P) = f(x) for all x. The smallest such positive number P is called the per iod." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 52 "E xamples: The sine and cosine functions have period " }{XPPEDIT 18 0 "2 *Pi;" "6#*&\"\"#\"\"\"%#PiGF%" }{TEXT -1 1 "." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 448 "It is clear, is it not, \+ that if a function is specified on some interval, then one could ask f or a periodic extension. If the function were defined on an interval [ 0, L], one could ask for an even periodic extension or an odd, periodi c extension. In this case, one would first make and even (or odd) exte nsion, and then make a 2 L periodic extension. We illustrate with grap hs. These notes begin with a particular function. You can modify the c ode." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 62 "H ere is an even 2 a extension of a function defined on [0, a]." }} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 16 "a:=2;\n f:=x->x;" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 95 "ff:= proc(x)\n\011\011if 0 < = x and x < a then f(x)\n\011\011elif a <= x and x <= 2*a then f(2*a-x )\n\011\011fi end;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 16 "plot( ff,0..2*a);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 35 "fe:= x->ff(f rac(abs(x)/(2*a))*2*a);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 19 " plot(fe,-3*a..3*a);" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }} {PARA 0 "" 0 "" {TEXT -1 61 "Here is an odd 2 a extension of a functio n defined on [0, a]." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 18 "a:=1 ;\n f:=x->x^2;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 96 "ff:= pro c(x)\n\011\011if 0 <= x and x < a then f(x)\n\011\011elif a <= x and x <= 2*a then -f(2*a-x)\n\011\011fi end;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 16 "plot(ff,0..2*a);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 43 "fo:= x->sign(x)*ff(frac(abs(x)/(2*a))*2*a);" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 19 "plot(fo,-3*a..3*a);" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 3 "" 0 "" {TEXT -1 44 "Generating periodic extensions \+ of functions." }}{PARA 0 "" 0 "" {TEXT -1 201 "Suppose that f is defin ed on the interval [a,b], in MapleTech Vol. 3, NO.3, Monagan and Lopez provided the following method to output a function which extends the \+ definition of f to the real line using" }}{PARA 0 "" 0 "" {TEXT -1 23 " f(a + k (b-a) + " }{XPPEDIT 18 0 "delta" "6#%&deltaG" }{TEXT -1 10 ") = f(a + " }{XPPEDIT 18 0 "delta" "6#%&deltaG" }{TEXT -1 1 ") " }}{PARA 0 "" 0 "" {TEXT -1 14 "for integer k." }}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 165 "PeriodicExtender:=proc(f,d::range)\nsubs( \{' F' = f, 'L'=lhs(d),\n 'D'=rhs(d)-lhs(d)\},\nproc(x::algebraic) \+ local y;\n y:=floor((x-L)/D);\n F(x-y*D);\nend)\nend;" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 35 "sw:=PeriodicExtender(signum, -1..1);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 24 "plot('sw(x)','x' =-4..4);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 26 "g:=x->piecewise (x<0,-x,x);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 30 "st:=Periodic Extender(g,-1..1);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 24 "plot( 'st(x)','x'=-3..3);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 32 "1. Here are four possibilities ." }}{PARA 0 "" 0 "" {TEXT -1 28 "a. f is even and has period " } {XPPEDIT 18 0 "2*pi;" "6#*&\"\"#\"\"\"%#piGF%" }{TEXT -1 2 ". " }} {PARA 0 "" 0 "" {TEXT -1 27 "b. f is odd and has period " }{XPPEDIT 18 0 "2*pi;" "6#*&\"\"#\"\"\"%#piGF%" }{TEXT -1 2 ". " }}{PARA 0 "" 0 "" {TEXT -1 16 "c. f has period " }{XPPEDIT 18 0 "pi;" "6#%#piG" } {TEXT -1 1 "." }}{PARA 0 "" 0 "" {TEXT -1 16 "d. f has period " } {XPPEDIT 18 0 "2*pi;" "6#*&\"\"#\"\"\"%#piGF%" }{TEXT -1 54 " and alte rnates on each half period, in the sense that" }}{PARA 0 "" 0 "" {TEXT -1 9 " f(x+" }{XPPEDIT 18 0 "pi;" "6#%#piG" }{TEXT -1 11 ") \+ = - f(x)." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 70 "2. Match these possibilities with the following Fourier Series fo r f:" }}{PARA 0 "" 0 "" {TEXT -1 39 "a. The series contains only sine \+ terms." }}{PARA 0 "" 0 "" {TEXT -1 41 "b. The series contains only cos ine terms." }}{PARA 0 "" 0 "" {TEXT -1 79 "c. The series contains sin( nx) and cos(nx) terms, but only for odd values of n." }}{PARA 0 "" 0 " " {TEXT -1 80 "d. The series contains sin(nx) and cos(nx) terms, but o nly for even values of n." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 " " 0 "" {TEXT -1 55 "We make examples for each of the above 2 a through 2 c." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 161 "fa:=x->sum(sin(n*x )/n,n=1..4);\nfb:=x->sum(cos(n*x)/n,n=1..4);\nfc:=x->sum(sin((2*n+1)*x )/n+cos((2*n+1)*x)/n,n=1..4);\nfd:=x->sum(sin(2*n*x)/n+cos(2*n*x)/n,n= 1..4);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 24 "plot(fa(x),x=-Pi. .3*Pi);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 24 "plot(fb(x),x=-Pi ..3*Pi);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 24 "plot(fc(x),x=-P i..3*Pi);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 24 "plot(fd(x),x=- Pi..3*Pi);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{PARA 0 " " 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT 261 11 "Assignment:" } {TEXT -1 109 " Draw the graph of | x - 1 |, together with the graphs \+ of even and odd functions whose sum is this function." }}}}{MARK "10" 0 }{VIEWOPTS 1 1 0 1 1 1803 }