{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 "Hyperlink" -1 17 "" 0 1 0 128 128 1 0 0 1 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 "2 D Output" 2 20 "" 0 1 0 0 255 1 0 0 0 0 0 0 0 0 0 }{CSTYLE "" 0 21 "" 0 1 0 0 0 1 0 0 0 0 2 0 0 0 0 }{CSTYLE "Help Heading" -1 26 "" 1 14 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 "Text Output" -1 2 1 {CSTYLE "" -1 -1 "Courier" 1 10 0 0 255 1 0 0 0 0 0 1 3 0 0 }1 0 0 -1 -1 -1 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 "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 }} {SECT 0 {PARA 0 "" 0 "" {TEXT -1 0 "" }}{SECT 0 {PARA 0 "" 0 "" {TEXT 26 7 "Advice:" }{TEXT -1 50 " Solving equations involving numerical in tegration" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 59 "Suppose you want to solve an equation involving a function " } {XPPEDIT 18 0 "F(x)" "-%\"FG6#%\"xG" }{TEXT -1 123 ", defined as a def inite integral which Maple must evaluate numerically. For example, yo u might want to solve the equation " }{XPPEDIT 18 0 "Int(1/(t + exp(t) ), t = 0 .. x) = 1-x" "/-%$IntG6$*&\"\"\"\"\"\",&%\"tGF(-%$expG6#F*F( !\"\"/F*;\"\"!%\"xG,&\"\"\"F(F2F." }{TEXT -1 83 ". Using calculus, it is not hard to prove that this has exactly one solution with " } {XPPEDIT 18 0 "0 < x" "2\"\"!%\"xG" }{TEXT -1 1 " " }{XPPEDIT 18 0 "`` < 1" "2%!G\"\"\"" }{TEXT -1 45 ". It is convenient to write the equa tion as " }{XPPEDIT 18 0 "F(x) = 1" "/-%\"FG6#%\"xG\"\"\"" }{TEXT -1 1 ":" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 41 "F:= x -> Int(1/(t + \+ exp(t)), t=0..x) + x;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%\"FG:6#%\"x G6\"6$%)operatorG%&arrowGF(,&-%$IntG6$*$,&%\"tG\"\"\"-%$expG6#F2F3!\" \"/F2;\"\"!9$F3F;F3F(F(" }}}{PARA 0 "" 0 "" {TEXT -1 22 "We use the in ert form " }{MPLTEXT 0 21 3 "Int" }{TEXT -1 13 " rather than " } {MPLTEXT 0 21 3 "int" }{TEXT -1 10 ", because " }{MPLTEXT 0 21 25 "int (1/(t+exp(t)), t=0..x)" }{TEXT -1 55 " returns unevaluated. Now the f ollowing does not work:" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 27 "f solve(F(x)=1, x = 0 .. 1);" }}{PARA 8 "" 1 "" {TEXT -1 60 "Error, (in \+ fsolve) should use exactly all the indeterminates" }}}{PARA 0 "" 0 "" {TEXT -1 65 "That is because of \"premature evaluation\": Maple first \+ evaluates " }{MPLTEXT 0 21 4 "F(x)" }{TEXT -1 53 ", obtaining an expre ssion that includes the variable " }{MPLTEXT 0 21 1 "t" }{TEXT -1 6 ", and " }{MPLTEXT 0 21 6 "fsolve" }{TEXT -1 95 " objects to this. The \+ usual cure for premature evaluation is to delay evaluation using quote s:" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 29 "fsolve('F(x)'=1, x = 0 .. 1);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#$\"+dcbAh!#5" }}}{PARA 0 " " 0 "" {TEXT -1 82 "This takes a rather long time to solve, since it r equires evaluating the function " }{XPPEDIT 18 0 "F(x)" "-%\"FG6#%\"xG " }{TEXT -1 162 " at many points, and each such evaluation requires an other numerical integration. But another approach, based on different ial equations, can be used. Note that " }{XPPEDIT 18 0 "dF/dx = 1/(x \+ + exp(x)) + 1" "/*&%#dFG\"\"\"%#dxG!\"\",&*&\"\"\"F%,&%\"xGF%-%$expG6# F,F%F'F%\"\"\"F%" }{TEXT -1 7 ", with " }{XPPEDIT 18 0 "F(0) = 0" "/-% \"FG6#\"\"!F&" }{TEXT -1 13 ". Now since " }{XPPEDIT 18 0 "F" "I\"FG6 \"" }{TEXT -1 29 " is a one-to-one function of " }{XPPEDIT 18 0 "x" "I \"xG6\"" }{TEXT -1 31 ", we can just as well consider " }{XPPEDIT 18 0 "x" "I\"xG6\"" }{TEXT -1 18 " as a function of " }{XPPEDIT 18 0 "F" "I\"FG6\"" }{TEXT -1 45 ". It will satisfy the differential equation \+ " }{XPPEDIT 18 0 "dx/dF = 1/(1/(x + exp(x))+1)" "/*&%#dxG\"\"\"%#dFG! \"\"*&\"\"\"F%,&*&\"\"\"F%,&%\"xGF%-%$expG6#F.F%F'F%\"\"\"F%F'" } {TEXT -1 25 " with initial condition " }{XPPEDIT 18 0 "x(0) = 0" "/-% \"xG6#\"\"!F&" }{TEXT -1 22 ", and what we want is " }{XPPEDIT 18 0 "x (1)" "-%\"xG6#\"\"\"" }{TEXT -1 1 "." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 45 "de:= diff(x(F),F) = 1/(1/(x(F)+exp(x(F)))+1);" }} {PARA 11 "" 1 "" {XPPMATH 20 "6#>%#deG/-%%diffG6$-%\"xG6#%\"FGF,*$,&*$ ,&F)\"\"\"-%$expG6#F)F1!\"\"F1F1F1F5" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 43 "soln:= dsolve(\{de, x(0)=0\},x(F), numeric); " }} {PARA 11 "" 1 "" {XPPMATH 20 "6#>%%solnG:6#%(rkf45_xG6'%\"iG%(rkf45_sG %)outpointG%#r1G%#r2G6#%aoCopyright~(c)~1993~by~the~University~of~Wate rloo.~All~rights~reserved.G6\"C&>8&-%&evalfG6#9$@$52-%$absG6#,$F3!\"\" -F<6#,&&%,loc_controlG6#\"\"#\"\"\"F3F?4-%'memberG6$&FD6#\"\"'<*$FG\" \"!F?FG!\"#FF$FFFQ$FRFQ$F?FQC%>FD-%%copyG6#=F06#;FG\"#EE\\[l;\"#7FQ\"# >FQ\"#?FQ\"#@FQ\"#:FQ\"#8FQFFFQ\"#AFQ\"\"&$FG!\")\"#5FQ\"#6FQ\"#=FQFGF G\"\"($FG!\"*\"\")\"&++$\"#;FQFhnFQ\"#CFQ\"#BFQFNFG\"#9FQ\"\"$FQ\"\"* \"%+5\"\"%Fbo\"#DFQ\"#%'loc_y0G-FY6#=F06#;FGFGE\\[l\"FGFQ>%'loc_y1 G-FY6#=F0F[qE\\[l!@$0F;FQC$>&FD6#F`pF3@%1%'DigitsG-%'evalhfG6#F\\rC$>8 %-%*traperrorG6#-F^r6#-%=dsolve/numeric_solnall_rkf45G6,%&loc_FG-%$var G6#FD-F]s6#Fgp-F]s6#F_q-F]s6#%'loc_F1G-F]s6#%'loc_F2G-F]s6#%'loc_F3G-F ]s6#%'loc_F4G-F]s6#%'loc_F5G-F]s6#%)loc_workG@$/Fbr%*lasterrorGC%>8'-% +searchtextG6$.F^r-%(convertG6$-%#opG6$FG7#Fbr%%nameG>8(-F\\u6$.%)hard wareGF_u@%50FjtFQ0FhuFQ-Fir6,F[sFDFgpF_qFesFhsF[tF^tFatFdt-%&ERRORG6#F brFav7$/%\"FGF7-%$seqG6$/&%$ordG6#,&8$FGFGFG&Fgp6#Faw/FawF\\qF06%FDFgp F_q" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "soln(1);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#7$/%\"FG\"\"\"/-%\"xG6#F%$\"1'Q>IibD7'!#;" }}} {PARA 0 "" 0 "" {TEXT -1 169 "This approach would not work in more gen eral cases, e.g. an integral depending on a parameter whose value must be found. In those cases the solution must be found with " } {MPLTEXT 0 21 6 "fsolve" }{TEXT -1 1 "." }}}{SECT 0 {PARA 0 "" 0 "" {TEXT 26 9 "See also:" }{TEXT -1 1 " " }{HYPERLNK 17 "fsolve" 2 "fsolv e" "" }{TEXT -1 2 ", " }{HYPERLNK 17 "dsolve/numeric" 2 "dsolve,numeri c" "" }}}{SECT 0 {PARA 0 "" 0 "" {TEXT 26 24 "Maple Advisor Database, \+ " }{TEXT -1 15 " R. Israel 1997" }}}}{MARK "3 0 0" 0 }{VIEWOPTS 1 1 0 1 1 1803 }