{VERSION 4 0 "IBM INTEL NT" "4.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 0 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 Output" 2 20 "" 0 1 0 0 255 1 0 0 0 0 0 0 0 0 0 1 } {CSTYLE "" 0 21 "" 0 1 0 0 0 1 0 0 0 0 2 0 0 0 0 1 }{CSTYLE "Help Head ing" -1 26 "" 1 14 0 0 0 0 0 1 0 0 0 0 0 0 0 1 }{PSTYLE "Normal" -1 0 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 }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 1 }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)" "6#-%\"FG6#%\"xG" }{TEXT -1 123 ", defined as a d efinite integral which Maple must evaluate numerically. For example, \+ you might want to solve the equation " }{XPPEDIT 18 0 "Int(1/(t + exp( t)), t = 0 .. x) = 1-x" "6#/-%$IntG6$*&\"\"\"F(,&%\"tGF(-%$expG6#F*F( !\"\"/F*;\"\"!%\"xG,&F(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" "6#2\"\"!%\"xG" }{TEXT -1 1 " " }{XPPEDIT 18 0 "`` < 1" " 6#2%!G\"\"\"" }{TEXT -1 45 ". It is convenient to write the equation \+ as " }{XPPEDIT 18 0 "F(x) = 1;" "6#/-%\"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#>%\"FGR6#%\"xG6 \"6$%)operatorG%&arrowGF(,&-%$IntG6$*&\"\"\"F1,&%\"tGF1-%$expG6#F3F1! \"\"/F3;\"\"!9$F1F;F1F(F(F(" }}}{PARA 0 "" 0 "" {TEXT -1 22 "We use th e inert 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 65 " returns unevaluated. Now we ca n solve the equation numerically:" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 27 "fsolve(F(x)=1, x = 0 .. 1);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#$\"+dcbAh!#5" }}}{PARA 0 "" 0 "" {TEXT -1 82 "This take s a rather long time to solve, since it requires evaluating the functi on " }{XPPEDIT 18 0 "F(x)" "6#-%\"FG6#%\"xG" }{TEXT -1 162 " at many p oints, and each such evaluation requires another numerical integration . But another approach, based on differential equations, can be used. Note that " }{XPPEDIT 18 0 "dF/dx = 1/(x + exp(x)) + 1" "6#/*&%#dFG \"\"\"%#dxG!\"\",&*&F&F&,&%\"xGF&-%$expG6#F,F&F(F&F&F&" }{TEXT -1 7 ", with " }{XPPEDIT 18 0 "F(0) = 0" "6#/-%\"FG6#\"\"!F'" }{TEXT -1 13 ". Now since " }{XPPEDIT 18 0 "F" "6#%\"FG" }{TEXT -1 29 " is a one-to- one function of " }{XPPEDIT 18 0 "x" "6#%\"xG" }{TEXT -1 31 ", we can \+ just as well consider " }{XPPEDIT 18 0 "x" "6#%\"xG" }{TEXT -1 18 " as a function of " }{XPPEDIT 18 0 "F" "6#%\"FG" }{TEXT -1 45 ". It will satisfy the differential equation " }{XPPEDIT 18 0 "dx/dF = 1/(1/(x + exp(x))+1)" "6#/*&%#dxG\"\"\"%#dFG!\"\"*&F&F&,&*&F&F&,&%\"xGF&-%$expG 6#F-F&F(F&F&F&F(" }{TEXT -1 25 " with initial condition " }{XPPEDIT 18 0 "x(0) = 0" "6#/-%\"xG6#\"\"!F'" }{TEXT -1 22 ", and what we want \+ is " }{XPPEDIT 18 0 "x(1)" "6#-%\"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.,&*&F.F.,&F)F.-%$expG6#F)F.!\"\"F.F.F.F5" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 43 "soln:= dsolve(\{de, x(0)=0\} ,x(F), numeric); " }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%%solnGR6#%(rkf4 5_xG6'%\"iG%(rkf45_sG%)outpointG%#r1G%#r2G6#%aoCopyright~(c)~1993~by~t he~University~of~Waterloo.~All~rights~reserved.G6\"C&>8&-%&evalfG6#9$@ $52-%$absG6#,$F3!\"\"-F<6#,&&%,loc_controlG6#\"\"#\"\"\"F3F?4-%'member G6$&FD6#\"\"'<*F?FG!\"#FF$F?\"\"!$FGFR$FFFR$FPFRC%>FD-%%copyG6#=F06#;F G\"#EE\\[l;FGFGFFFR\"\"$FR\"\"%$FG!\")\"\"&F\\oFNFG\"\"($FG!\"*\"\")\" &++$\"\"*\"%+5\"#5FR\"#6FR\"#7FR\"#8FR\"#9FR\"#:FR\"#;FR\"#FR\"#?FR\"#@FR\"#AFR\"#BFR\"#CFR\"#DFRFhnFR>%'loc_y0G-FY6#=F06#;FGFG E\\[l\"FGFR>%'loc_y1G-FY6#=F0F[qE\\[l!@$0F;FRC$>&FD6#FjnF3@%1%'DigitsG -%'evalhfG6#F\\rC$>8%-%*traperrorG6#-F^r6#-%=dsolve/numeric_solnall_rk f45G6,%&loc_FG-%$varG6#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@$/Fb r%*lasterrorGC%>8'-%+searchtextG6$.F^r-%(convertG6$-%#opG6$FG7#Fbr%%na meG>8(-F\\u6$.%)hardwareGF_u@%50FjtFR0FhuFR-Fir6,F[sFDFgpF_qFesFhsF[tF ^tFatFdt-%&ERRORG6#FbrFav7$/%\"FGF7-%$seqG6$/&%$ordG6#,&8$FGFGFG&Fgp6# Faw/FawF\\qF06%FDFgpF_qF0" }}}{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 general cases, e.g. an integral depending on a param eter whose value must be found. In those cases the solution must be f ound 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 "fsolve" "" }{TEXT -1 2 ", " }{HYPERLNK 17 "dsolve/numeric" 2 "dsolve,numeric" "" }}}{SECT 0 {PARA 0 "" 0 "" {TEXT 26 24 "Maple Ad visor Database, " }{TEXT -1 15 " R. Israel 1997" }}}}{MARK "1 3 0 0" 41 }{VIEWOPTS 1 1 0 1 1 1803 1 1 1 1 }{PAGENUMBERS 0 1 2 33 1 1 }