{VERSION 2 3 "IBM INTEL NT" "2.3" } {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 "2D Output" 2 20 "" 0 1 0 0 255 1 0 0 0 0 0 0 0 0 0 }{CSTYLE " " -1 256 "" 1 24 73 136 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 257 "" 1 14 78 101 119 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 258 "" 1 10 60 136 17 0 0 0 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 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 262 "" 0 1 59 136 176 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 "Maple Output" 0 11 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 }3 3 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "" 0 256 1 {CSTYLE "" -1 -1 "" 0 1 240 63 16 0 0 0 0 0 0 0 0 0 0 }3 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "" 0 257 1 {CSTYLE "" -1 -1 "" 0 1 58 136 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 }{PSTYLE "" 0 258 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 256 "" 0 "" {TEXT 256 13 "Curve Fitting" }}{PARA 256 "" 0 "" {TEXT -1 27 "(Prelude to Simpson's Rule)" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 257 "" 0 "" {TEXT 257 12 "by Greg Crow" }}{PARA 258 "" 0 "" {TEXT 258 22 "(please report errors)" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 328 "You are all aware that y ou can find a line that goes through two points. The goal of this lab oratory is to try and extend this idea to fit a quadratic through thre e points, and a cubic through four points. In so doing, we will be ab le to approximate continuous functions with polynomials. We begin wit h two points and a line." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 " " 0 "" {TEXT 261 9 "Example 1" }{TEXT -1 57 ": Find the equation of t he line through (1,4) and (2,7)." }}{PARA 0 "" 0 "" {TEXT 262 10 "Solu tion 1" }{TEXT -1 1 ":" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 47 "Store the coordinates of the points as follows:" }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 16 "x:=array([1,2]);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%\"xG-%'VECTO RG6#7$\"\"\"\"\"#" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 16 "y:=arr ay([4,7]);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%\"yG-%'VECTORG6#7$\"\" %\"\"(" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 38 "The points can be displayed by typing " }{MPLTEXT 1 0 12 "[x[1],y[ 1]];" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 25 "[x[1],y[1]];\n[x[2], y[2]];" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#7$\"\"\"\"\"%" }}{PARA 11 " " 1 "" {XPPMATH 20 "6#7$\"\"#\"\"(" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" } }{PARA 0 "" 0 "" {TEXT -1 30 "The generic form of a line is " } {XPPEDIT 18 0 "y=mx+b" "/%\"yG,&%#mxG\"\"\"%\"bGF&" }{TEXT -1 32 ", so let's call such a function " }{XPPEDIT 18 0 "f" "I\"fG6\"" }{TEXT -1 1 "." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "f:=x->a*x+b;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%\"f G:6#%\"xG6\"6$%)operatorG%&arrowGF(,&*&%\"aG\"\"\"9$F/F/%\"bGF/F(F(" } }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 78 "We will attempt to find values for a and b that satisfy the requirements that " }{XPPEDIT 18 0 "f(1)=4" "/-%\"fG6#\"\"\"\"\"%" }{TEXT -1 5 " and " }{XPPEDIT 18 0 "f(2)=7" "/-%\"fG6#\"\"#\"\"(" }{TEXT -1 1 "." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "f( x[1])=y[1];" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#/,&%\"aG\"\"\"%\"bGF&\" \"%" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "f(x[2])=y[2];" }} {PARA 11 "" 1 "" {XPPMATH 20 "6#/,&%\"aG\"\"#%\"bG\"\"\"\"\"(" }}} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 61 "Maple wil l happily find the solution if one exists using the " }{MPLTEXT 1 0 5 "solve" }{TEXT -1 9 " command." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 43 "solve(\{f(x[1])=y[1], f(x[2] )=y[2]\}, \{a,b\});" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#<$/%\"bG\"\"\"/ %\"aG\"\"$" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 111 "If on your second or third try this gives an error, re-execute the definition of f(x) above and then try again." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "subs(\",f(x) );" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#,&%\"xG\"\"$\"\"\"F&" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 50 "The following c ommand makes a function out of the " }{XPPEDIT 18 0 "3x+1" ",&*&\"\"$ \"\"\"%\"xGF%F%F%F%" }{TEXT -1 1 "." }}{PARA 0 "" 0 "" {TEXT -1 0 "" } }{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 18 "f := unapply(\",x);" }} {PARA 11 "" 1 "" {XPPMATH 20 "6#>%\"fG:6#%\"xG6\"6$%)operatorG%&arrowG F(,&9$\"\"$\"\"\"F/F(F(" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 " " 0 "" {TEXT -1 46 "Check to see if the result is what you wanted." }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 15 "[x[1],f(x[1])];" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#7$\"\"\"\"\"%" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 15 "[x[2],f(x[2])];" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#7$\"\"#\"\"(" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 51 "Plot the graph of f(x) and verify th at all is well." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT 259 9 "Example 2" }{TEXT -1 68 ": Find the equation of the parab ola through (1,4), (2,7), and (3,6)." }}{PARA 0 "" 0 "" {TEXT 260 10 " Solution 2" }{TEXT -1 1 ":" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 18 "x:=array([1,2,3]):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 18 "y:=array([4,7,6]):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 18 "f:=x->a*x^2+b*x+c;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%\"fG:6#%\"xG6\"6$%)operatorG%&arrowGF(,(*&%\"aG \"\"\"9$\"\"#F/*&%\"bGF/F0F/F/%\"cGF/F(F(" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 59 "solve(\{f(x[1])=y[1], f(x[2])=y[2], f(x[3])=y[3]\}, \{a,b,c\});" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#<%/%\"cG!\"$/%\"bG\"\" */%\"aG!\"#" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "subs(\",f(x) );" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#,(*$%\"xG\"\"#!\"#F%\"\"*!\"$\" \"\"" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 18 "f := unapply(\",x); " }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%\"fG:6#%\"xG6\"6$%)operatorG%&ar rowGF(,(*$9$\"\"#!\"#F.\"\"*!\"$\"\"\"F(F(" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 61 "Plot the graph of f(x) and veri fy that it is what was needed." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 67 "Question 1: Fi nd the equation of the line that approximately fits " }{XPPEDIT 18 0 " f(x) = sin(x)" "/-%\"fG6#%\"xG-%$sinG6#F&" }{TEXT -1 61 " at the origi n by using the example above with the points at " }{XPPEDIT 18 0 "x=0 " "/%\"xG\"\"!" }{TEXT -1 6 ", and " }{XPPEDIT 18 0 "x=Pi/6" "/%\"xG*& %#PiG\"\"\"\"\"'!\"\"" }{TEXT -1 1 "." }}{PARA 0 "" 0 "" {TEXT -1 0 " " }}{PARA 0 "" 0 "" {TEXT -1 82 "Question 2: Plot the line you genera ted in question 1 and the graph of sin(x) on " }{XPPEDIT 18 0 "[-Pi..P i]" "7#;,$%#PiG!\"\"F%" }{TEXT -1 1 "." }}{PARA 0 "" 0 "" {TEXT -1 0 " " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 69 "Quest ion 3: Find the equation of a parabola that approximately fits " } {XPPEDIT 18 0 "f(x)=cos(x)" "/-%\"fG6#%\"xG-%$cosG6#F&" }{TEXT -1 63 " at the origin by using the example above with the points at x=" } {XPPEDIT 18 0 "-Pi/4" ",$*&%#PiG\"\"\"\"\"%!\"\"F'" }{TEXT -1 2 ", " } {XPPEDIT 18 0 "x=0" "/%\"xG\"\"!" }{TEXT -1 6 ", and " }{XPPEDIT 18 0 "x=Pi/4" "/%\"xG*&%#PiG\"\"\"\"\"%!\"\"" }{TEXT -1 1 "." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 65 "Question 4: Find the equation of the cubic polynomial that fits " }{XPPEDIT 18 0 "f(x)=si n(x)" "/-%\"fG6#%\"xG-%$sinG6#F&" }{TEXT -1 54 " at the origin.by usi ng the points in question 3 and " }{XPPEDIT 18 0 "x=Pi/2" "/%\"xG*&%#P iG\"\"\"\"\"#!\"\"" }{TEXT -1 1 "." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }} {PARA 0 "" 0 "" {TEXT -1 88 "Question 5: Will this work for higher ord er polynomials? Take a stab at it with sin(x)." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{MARK "61 0" 0 }{VIEWOPTS 1 1 0 1 1 1803 }