Here are some problems that Maple and Mathematica cannot solve, but SymbMath can do. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SymbMath 1.3B can solve the following problems #0 to #5, but cannot solve #6 (not output). ------------------------------------------------------------- Article 1261 of sci.math.symbolic: >From: FC03@NS.CC.LEHIGH.EDU (Frederick W. Chapman) Newsgroups: sci.math.symbolic Subject: Yes, but why can't Maple do THIS stuff??? Date: 28 Jun 91 03:06:32 GMT [If you suspect that any post which has an ABSTRACT is going to be a long one, you're absolutely right! I hope this post proves worthy of the "bandwidth" it has consumed.] ********** ABSTRACT ********** Maple V still has some serious problems in regard to how it evaluates (or fails to evaluate) integrals, limits, etc. of expressions involving a symbolic parameter. Half a dozen concrete examples are included to support this claim. ********** INTRODUCTION ********** Using Maple V for 386 DOS PCs, I have been able to confirm that the signum(a) := 1; trick (which declares 'a' to be non-negative) does allow Maple to complete the evaluation of some integrals which would otherwise (correctly) remain unevaluated. For example, the following has been discussed recently on sci.math.symbolic: EXAMPLE #0: Integral previously discussed on USENET. # Unevaluated integral: > int(exp(-a * x^2), x=0..infinity); infinity / | 2 | exp(- a x ) dx | / 0 # Declare 'a' non-negative: > signum(a) := 1; signum(a) := 1 # The same integral is now evaluated fully: > int(exp(-a * x^2), x=0..infinity); 1/2 Pi 1/2 ----- 1/2 a Although this trick works fine with *this* example, I have found a disturbingly large number of even simpler examples in which Maple handles the symbolic parameter *incorrectly*, even when the parameter is declared non-negative via the 'signum' function. A list of these examples follows. Please post any comments, explanations, work-arounds, or new features planned in future releases of the software, as pertains to these examples. ********** EXAMPLE #1: Unevaluated proper definite integral. ********** # Despite the fact that 'n' is declared non-negative... > signum(n) := 1; signum(n) := 1 # ...this simple proper definite integral (that any freshman calculus student # can evaluate!) is left unevaluated: > int(x^n, x=0..1); 1 / | n | x dx | / 0 For shame! The hypothesis n >= 0 is even stronger than it really needs to be, since the improper integral resulting when n < 0 converges as long as n > -1. The fact that the integrand is not well-defined at x = 0 in the case n = 0 does not present a problem since the integrand *is* well-defined on the rest of the interval. The integrand agrees with a function which is continuous on the entire interval (the constant function 1) except at one point (x=0), and is thus Riemann integrable. Note that this problem does not occur when different limits of integration are used with the same integrand: # Different, but constant limits of integration: > int(x^n, x=-1..1); (n + 1) 1 (-1) ----- - ----------- n + 1 n + 1 # Symbolic limits of integration: > int(x^n, x=a..b); (n + 1) (n + 1) b a -------- - -------- n + 1 n + 1 That this integral was evaluated -- but the original integral was not -- is in a way surprising. This integral can be reduced to the original integral by setting 'a' to 0 and 'b' to 1. If there was something "wrong" with the original, more specialized integral, then the same thing is "wrong" with this, more generalized integral. ********** EXAMPLE #2: Unevaluated one-sided limit. ********** The problem in the previous example appears to have something to do with the fact that one of the limits of integration is 0. Let us try to circumvent the problem by replacing 0 with a parameter 'eps', and then taking the limit as 'eps' goes to 0 from above. # Now the integral is evaluated... > int(x^n, x=eps..1); (n + 1) 1 eps ----- - ---------- n + 1 n + 1 # ...but the one-sided limit... > limit(", eps=0, right); (n + 1) 1 eps limit ----- - ---------- eps -> 0+ n + 1 n + 1 # ...remains unevaluated... > simplify("); (n + 1) - 1 + eps limit - ---------------- eps -> 0+ n + 1 # ...no matter what we do! > eval("); (n + 1) - 1 + eps limit - ---------------- eps -> 0+ n + 1 Double shame on you, Maple! (I'm starting to talk to the software -- maybe I've been doing this for a living a little too long?) By taking the limit from the right side, we impose the restriction that 'eps' is strictly positive, which guarantees that the expression 'eps^(n+1)' is defined for all values of 'eps' and 'n' under consideration. Since 'n' is greater than or equal to 0, 'n + 1' is strictly positive, which guarantees that the limit as 'eps' goes to 0 from above of 'eps^(n+1)' exists, and has a value which is independent of 'n' -- the limit equals 0 for all non-negative 'n'. Unlike EXAMPLE #1, there is not even a hint of any 0^0 difficulties to be resolved in this example. There is no reason to leave this limit unevaluated. ********** EXAMPLE #3: Cavalier evaluation of 0^n. ********** Although Maple refrains from attempting to evaluate certain integrals until it knows the signs of parameters that determine convergence (and sometimes refrains from evaluation even when the signs are known and there are no problems with convergence), Maple does *not* hesitate to evaluate certain expressions that contain symbolic parameters in circumstances when it *should* refrain from performing said evaluation. # 'n' has been declared non-negative, but could still assume the value 0 # without contradicting this declaration of sign. (signum(0) = 1, by # definition in Maple V; see online help on 'signum'.) Nevertheless, Maple # evaluates the following expression without considering this possibility: > 0^n; 0 # Maple flags the error only when 'n' is replaced by the constant 0: > 0^0; Error, 0^0 is undefined # Similarly, Maple evaluates the following expression without considering # that the exponent could be negative, which would render the expression # undefined: > 0^(n-1); 0 # Maple flags the error only when a constant, negative exponent is given: > 0^(-1); Error, division by zero I realize that I am putting it bluntly, but here goes anyway: If no high school student should be allowed to make these kinds of mistakes (and they do qualify as "mistakes"), then Maple ought not to make them either. ********* EXAMPLE #4: Cavalier evaluation of indefinite integral. ********* # The sign of 'k' has not been declared; hence, the possiblity that 'k' could # assume the value -1 cannot be ruled out in this indefinite integral: > int(x^k, x); (k + 1) x -------- k + 1 This expression for the antiderivative of 'x^k' is correct *only* if 'k' is not equal to -1; this cannot be taken for granted, since no information has been provided concerning the sign of 'k', or the range of values which 'k' may assume. This answer is totally incorrect when 'k' equals -1. This also qualifies as a "mistake", and should be corrected. Let us hold Maple to at least the same standard that we expect every Freshman Calculus student to uphold. ********** EXAMPLE #5: Insufficient knowledge of growth rates. ********** Every student of elementary calculus eventually learns that "the exponential function 'exp(x)' increases to infinity faster than any power of 'x', as 'x' goes to infinity." More precisely, the limit as 'x' goes to infinity of 'x^k/exp(x)' is 0 for *all* values of 'k' (positive, zero, or negative); or, in "little o" notation, 'x^k = o(exp(x))' as 'x' goes to infinity, regardless of the value of 'k'. Maple certainly ought to know this important elementary result, but does not. # The following limit is left unevaluated: > limit(x^k/exp(x), x=infinity); k x limit ------ x -> infinity exp(x) We might ask if Maple knows this result for specific (constant) values of the symbolic parameter 'k'. The answer is a QUALIFIED "yes". # Maple knows the result for 'k' equal to 10^8... > limit(x^(10^8)/exp(x), x=infinity); 0 # ...and Maple knows the result for 'k' equal to 10^9... > limit(x^(10^9)/exp(x), x=infinity); 0 # ...BUT, Maple seems to FORGET the result when 'k' equals 10^10... > limit(x^(10^10)/exp(x), x=infinity); 10000000000 Maple: "Duh, I x really have no limit ------------ idea. Thanks for x -> infinity exp(x) asking." :-) Let's revise all the calculus textbooks so that they read "the limit is 0 for exponents 'k' less than 10^10; beyond that, no one really knows!" Just kidding!!! I am a kidder!!! ********** EXAMPLE #6: Maple's child-like obstinacy. ********** # Recall that 'a' and 'n' were declared non-negative earlier in the Maple # session (in EXAMPLES #0 and #1). The following improper integral (the # Laplace transform of 'x^n') converges, and is fully evaluated by Maple: > int(x^n * exp (-a * x), x=0..infinity); GAMMA(n) n ---------- n a a # Suppose that we now attempt to compute a similar integral, but forget to # first declare the signs of the symbolic parameters: > int(x^m * exp (-b * x), x=0..infinity); infinity / | m | x exp(- b x) dx | / 0 # As expected, the integral remains unevaluated. Now declare the signs of # the symbolic parameters: > signum(b) := 1; signum(b) := 1 > signum(m) := 1; signum(m) := 1 # Upon attempting to compute the integral a second time... > int(x^m * exp (-b * x), x=0..infinity); infinity Maple: "I WON'T / do it, and YOU | m CAN'T MAKE ME! | x exp(- b x) dx NYAH, NYAH, | NYAH!!" / 0 (Sure told us :-) # ...THE INTEGRAL CONTINUES TO REMAIN UNEVALUATED, despite the fact that # the signs of the parameters 'b' and 'm' were declared PRIOR to the second # attempt at computation. Apparently, Maple is unwilling to forgive us for asking it to solve an ill-posed problem a few moments ago. Quite typical behavior for a 10 year old! However, if we ask it nicely, Maple will do another computation of the same integral for us. # Declare the signs of the symbolic parameters BEFORE EVER ASKING Maple to # compute the specified integral: > signum(p) := 1; signum(p) := 1 > signum(q) := 1; signum(q) := 1 # Now ask his/her spoiled bratness to furnish us with the desired answer: > int(x^p * exp (-q * x), x=0..infinity); GAMMA(p) p ---------- p q q All it took was a little diplomacy! ********** CONCLUSIONS ********** Although Maple is the symbolic computation package that I most prefer to use (over Mathematica, MACSYMA, Reduce, etc.), I am very distressed at Maple's tendency to compute when it ought *not* to compute, and to *not* compute when it *ought* to compute in these examples that involve a symbolic parameter. Clearly, the 'signum() := 1;' technique for declaring non-negative variables has *not* been implemented in a complete and comprehensive manner. These deficiencies must be addressed. I know that I, for one, intend to use these examples as a personal benchmark to measure the progress made by future releases of Maple. I would encourage the reader to do likewise, and to complain to the Maple developers if progress is not made. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Frederick W. Chapman (N3IJC) Campus Phone: (215) 758-3218 User Services Group Network Server UserID: FC03 Computing Center Internet: FC03@NS.CC.LEHIGH.EDU Lehigh University Bitnet: FC03@LEHIGH ---------------------------------------------------------------- On the following, "->" is the SymbMath prompt for input, sgn(a^0.5)=1 means a^0.5 > 0, "last" means the last output. ************* Example #0 ****************** ->inte(exp(-a*x^2), (x from 0 to inf)) 0.5*a^(-0.5)*pi^0.5*erf(sgn(sgn(a^0.5))*inf) ->subs(sgn(a^0.5)=1 to last) 0.5*a^(-0.5)*pi^0.5 ->sgn(a^0.5)=1 sgn(a^0.5) = 1 ->inte(exp(-a*x^2), (x from 0 to inf)) 0.5*a^(-0.5)*pi^0.5 *********** Example #1 ********************* ->sgn(1+n)=1 sgn(1 + n) = 1 ->inte(x^n, (x from 0 to 1)) 1/(1 + n) *********** Example #2 ********************** ->inte(x^n, (x from eps to 1)) 1/(1 + n) - eps^(1 + n)/(1 + n) ->subs(eps=0 to last) 1/(1 + n) *********** Example #3 ********************** ->sgn(n)=1 sgn(n) = 1 ->0^n 0 ->0^-n undefined: 1/0 ->0^0 undefined: 0^0 ********* Example #4 ********************** ->inte(x^k*d(x)) Constant + x^(1 + k)/(1 + k) ->subs(k=-1 to last) Constant + undefined: 1/0 *********** Example #5 ********************** ->lim(x=inf, x^k/exp(x)) 0 ->lim(x=inf, x^(10^10)/exp(x)) 0 ->lim(x=inf, x^(10^10000)/exp(x)) 0 ************ Example #6 ********************* ->inte(x^n*exp(-a*x), (x from 0 to inf)) %%%%%%%%%%%%%%%%%%%% In version 1.3 of SymbMath, SymbMath can do discontinuous integration (i.e. Cauchy Integration) to solve the following problems. ------------------------------------------------------------- In article <1991Jul8.211111.3068@colorado.edu>, sherod@vieta.Colorado.EDU (Scott Herod) writes: > MATHEMATICA happily computes the integral of 1/x from -1 to 1. > > Mathematica (sun3.fpa) 1.2 (November 6, 1989) [With pre-loaded data] > by S. Wolfram, D. Grayson, R. Maeder, H. Cejtin, > S. Omohundro, D. Ballman and J. Keiper > with I. Rivin and D. Withoff > Copyright 1988,1989 Wolfram Research Inc. > -- Terminal graphics initialized -- > > In[1]:= Integrate[1/x,{x,-1,1}] > > Out[1]= -Log[-1] > > I certainly hope they have this problem fixed in version 2.0. > > > Scott Herod > sherod@newton.colorado.edu ------------------------------------------------------------------------ >From: abbasi@smaug.enet.dec.com (Nasser ABBASI) >Date: 8 Jul 91 08:06:02 GMT > > > I'd like to be able to do integation on improper integrals (integrals > that do not exist using normal mathematical normal integration) by > using cauchy's defintion of integration. > >example, I'd like to say somthing like > >int_cauchy(1/x,x=-1..1); > and get 0. > >this should be nice to have. > >anyone knowes if any symbolic math package can do cauchy integration? >thank you, >/Nasser ---------------------------------------------------------------- Article 1298 of sci.math.symbolic: >From: FC03@NS.CC.LEHIGH.EDU (Frederick W. Chapman) Newsgroups: sci.math.symbolic Subject: RE: MAPLE: will it support Cauchy principle value integrals? Date: 9 Jul 91 20:06:51 GMT Until such a time as Maple has a built-in facility for computing Principal Value (P.V.) integrals, you might try defining a Maple procedure which will compute P.V. integrals directly from the definition. Here is an example of such a procedure: ------------------------- Sample Maple Procedure ------------------------- # Procedure: 'pvint' (version 1.0) for Maple V5.0. # Released: July 9, 1991. # Author: Frederick W. Chapman (FC03@NS.CC.LEHIGH.EDU). pvint := proc(f, x, a, b, s) local i1, i2, eps; # Declare local variable 'eps' to be non-negative, which helps with the # simplification of some P.V. integrals. signum(eps) := 1; # Now compute the Principal Value integral of 'f' with respect to 'x' from # 'a' to 'b', with a singularity at 's'. i1 := int(f, x = a .. (s-eps)); i2 := int(f, x = (s+eps) .. b); simplify(i1 + i2); limit (", eps=0, right); end; ------------------------- End of Maple Procedure ------------------------- If you create a file called `pvint.txt` which contains the above (comments lines, which begin with a "#", are not essential), then you can load the above procedure whenever you want to by entering read `pvint.txt`; at the Maple prompt. (Note the use of *backwards* single quotes to delimit the filename!) I do not claim that this procedure works flawlessly, or make any guarantees whatsoever as to the correctness of the results that it will furnish. (Translated: "Use at your own risk.") However, it does work reasonably well on the examples given below; exceptions are noted. I would recommend that you exercise some caution, for as you will see, Maple has a strange way of handling the natural logarithm function, especially in the context of finding an antiderivative for 1/x. (This is not *my* fault, though!) If anyone gives this procedure a try, I would be interested in knowing (via e-mail) how well it works for you, if you make any improvements, etc. Here is a Maple session illustrating the use of the procedure 'pvint'. --------------- Session Using Maple/386 V5.0 for DOS Machines --------------- # Load the procedure into Maple: > read `pvint.txt`; pvint := proc(f,x,a,b,s) local i1,i2,eps; signum(eps) := 1; i1 := int(f,x = a .. s-eps); i2 := int(f,x = s+eps .. b); simplify(i1+i2); limit(",eps = 0,right) end # Compute the Principal Value integral of '1/x' w.r.t. 'x', from -1 to 1, # cutting out the singularity at 0: > pvint(1/x, x, -1, 1, 0); 0 # Now declare 'a' and 'b' to be non-negative: > signum(a) := 1; signum(a) := 1 > signum(b) := 1; signum(b) := 1 # Compute the same P.V. integral, but from '-a' to 'b' (i.e., over a not # necessarily symmetric interval): > pvint(1/x, x, -a, b, 0); - ln(a) + ln(b) # Looks fine. Now declare 'aa' to be negative. > signum (aa) := -1; signum(aa) := -1 # Compute the P.V. integral again, but from 'aa' to 'b': > pvint(1/x, x, aa, b, 0); Pi I - ln(aa) + ln(b) YUCK!!! Maple apparently extends the definition of the usual (real) natural logarithm, ln(x) for x > 0, to a logarithm defined on the punctured complex plane, ln(z) for z = r*exp(I*t), r > 0, and t in the half-closed interval (-Pi, Pi]; Maple's complex logarithm defines ln(z) to be ln(r) + I*t. Thus, in the example where we integrated from '-a' to 'b', Maple simplified the ln(-a), with a >= 0, to ln(a) + Pi*I; the two Pi*I's canceled, which is why we never saw them in that example. We can "reenact" these steps explicitly with the following commands: > subs(aa=-a, "); Pi I - ln(- a) + ln(b) > simplify("); - ln(a) + ln(b) Although invoking this complex logarithm in this way gives answers which simplify to the correct answers, I feel extremely uncomfortable with this use of this particular complex logarithm, for the following reasons: (1) The complex logarithm defined by Maple is not continuous (in the topology of the usual norm on the complex plane) along the negative real axis, and is certainly not an antiderivative of 1/z on the punctured complex plane. There is no antiderivative of 1/z which is defined for every non-zero complex 'z'! Yet Maple is using this particular complex logarithm as an antiderivative for 1/x. (2) It would be better -- and much simpler -- if Maple were to use the real-valued real-variable function, ln(abs(x)), rather than a complex logarithm as an antiderivative of 1/x; ln(abs(x)) is an antiderivative for 1/x for all non-zero real 'x'. # Compute the P.V. integrals of some other functions: > pvint(1/x^2, x, -1, 1, 0); infinity # i.e., the P.V. integral above diverges. This one converges: > pvint(tan(x), x, 0, Pi, Pi/2); 0 # Maple refuses to evaluate this P.V. integral: > pvint(signum(x), x, -1, 1, 0); - eps 1 / / | | limit | signum(x) dx + | signum(x) dx eps -> 0+ | | / / -1 eps > simplify("); - eps 1 / / | | limit | signum(x) dx + | signum(x) dx eps -> 0+ | | / / -1 eps > eval("); - eps 1 / / | | limit | signum(x) dx + | signum(x) dx eps -> 0+ | | / / -1 eps # However, Maple will compute the P.V. integral if we specify the function # signum(x) in the essentially equivalent form abs(x)/x: > pvint(abs(x)/x, x, -1, 1, 0); 0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Frederick W. Chapman (N3IJC) Campus Phone: (215) 758-3218 User Services Group Network Server UserID: FC03 Computing Center Internet: FC03@NS.CC.LEHIGH.EDU Lehigh University Bitnet: FC03@LEHIGH ----------------------------------------------------------------------------- The symbol "->" in the following examples is the SymbMath prompt. ->inte(1/x, (x from -1 to 1)) 0 ->inte(1/x, (x from -1 to 2)) ln(2) ->inte(1/x, (x from -2 to 2)) 0 ->inte(sgn(x), (x from -2 to 2)) 0 ->inte(sgn(x), (x from -1 to 2)) 1 ->inte(tan(x), (x from 0 to pi)) 0 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SymbMath 1.3B can solve the following problems in the textbook, Problems 3, 11, 12, 15, 29, and 30, but cannot solve Problems 16 and 22 (not output), 23. ------------------------------------------------------------ Article 1294 of sci.math.symbolic: >From: alex@IASTATE.EDU (Roger Alexander) Newsgroups: sci.math.symbolic Subject: Re: MAPLE: will it support Cauchy principle value integration? Date: 8 Jul 91 22:53:13 GMT Here at ISU, we have been using Mma in elementary Calculus for a couple of years now, and have accumulated a folder full of such anomalies. A few weeks ago I mailed the whole batch to bugs@wri.com. You can understand the strange values returned by Integrate[f,{x,a,b}] as follows: there exist (1) a contour connecting a and b in the complex x-plane, and (2) a function F analytic in a neighborhood of that contour satisfying F'[x] = f[x] there, such that the result delivered by Mma is F[b] - F[a]. The anomalies in Integrate[] are a result of the unpredictable choice of contour and analytic branch F. WRI refer to this as the "integration branch cut problem." >From my correspondence with them, I believe that they regard it as a serious and annoying problem for users, and find it a difficult one for developers to solve in a satisfactory way. It is under active study. I have received no indication that anything will change with Mma 2.0. Attached here is part of what I sent to WRI. The sessions ran on a DEC 5000, but the anomalies were all noticed first on MAC LE/30's or IIcx's -- all Mma 1.2. The transcript includes some output from Macsyma for comparison. The version of Macsyma referred to runs on a Sun 3/60; it displays: This is Sun UNIX MACSYMA Release 309.6. I would like to note that we no longer use the Swokowski textbook mentioned in the report. o / --------Cut Here------X---------snip-snip------------------------- o \ Mathematica (DEC RISC) 1.2 (September 10, 1990) [With pre-loaded data] by S. Wolfram, D. Grayson, R. Maeder, H. Cejtin, S. Omohundro, D. Ballman and J. Keiper with I. Rivin and D. Withoff Copyright 1988,1989,1990 Wolfram Research Inc. -- X11 windows graphics initialized -- In[1]:= Integrate[x^(-1/3)/(1+x),{x,0,Infinity}] 1 Out[1]= -(Sqrt[3] ArcTan[-(-------)]) + Sqrt[3] ArcTan[ComplexInfinity] Sqrt[3] (* Mathematica must be told how to simplify this. However: This is Sun UNIX MACSYMA Release 309.6. (c1) integrate(x^(-1/3)/(1+x),x,0,inf); 2 %pi (d1) ------- sqrt(3) *) In[2]:= Integrate[1/(1+x^6),{x,0,Infinity}] Pi ArcTan[-Sqrt[3]] ArcTan[Sqrt[3]] Out[2]= -- - ---------------- - --------------- + Sqrt[3] (-Infinity) + 3 6 6 > Sqrt[3] (Infinity) (* Pi/3 appears to be a principal value, but the integral converges: (c2) integrate(1/(1+x^6),x,0,inf); %pi (d2) --- 3 *) (* The following problems are taken from Swokowski's Calculus book. They cause Mathematica to fail because of a singularity in the interior of the interval of integration: Section 10.4 Problems 3, 11, 12, 15, 16, 22, 23, 27, 29. The comments "INTEGRAL IS DIVERGENT" and "Principal Value" come from Macsyma. Mma gives no indication that anything is amiss. *) In[4]:= Integrate[1/x^2,{x,-3,1}] 4 Out[4]= -(-) (* INTEGRAL IS DIVERGENT *) 3 In[5]:= Integrate[1/(x+1)^3,{x,-2,2}] 4 Out[5]= - (* Principal Value *) 9 In[6]:= Integrate[x^(-4/3),{x,-1,1}] Out[6]= -6 (* INTEGRAL IS DIVERGENT *) In[7]:= Integrate[1/x,{x,-1,2}] Out[7]= -Log[-1] + Log[2] (* (c7) integrate(1/x,x,-1,2); Principal Value (d7) log(2) *) In[8]:= Integrate[1/(x^2-x-2),{x,0,4}] -Log[-2] Log[2] Log[5] Out[8]= -------- + ------ - ------ 3 3 3 (* (c8) integrate(1/(x^2-x-2),x,0,4); Principal Value log(5) (d8) - ------ 3 *) In[9]:= Integrate[1/(x Log[x]^2),{x,1/E,E}] Out[9]= -2 (* INTEGRAL IS DIVERGENT *) In[10]:= Integrate[(1/x^2)Cos[1/x],{x,-1,2}] 1 Out[10]= Sin[-1] - Sin[-] (* INTEGRAL IS DIVERGENT *) 2 In[12]:= Integrate[1/(x-4)^2,{x,0,Infinity}] 1 Out[12]= -(-) (* INTEGRAL IS DIVERGENT *) 4 In[13]:= Integrate[1/(x+2),{x,-Infinity,0}] Out[13]= -Infinity (* INTEGRAL IS DIVERGENT *) (* The "integration branch cut problem" afflicts NIntegrate as well. Consider the following examples discovered by my colleagues Jerry Mathews and Bruce Wagner. *) (* First we observe agreement between Integrate and NIntegrate. *) In[34]:= Integrate[((Cos[x])^2)^(3/2),{x,Pi/2,Pi}] 2 Out[34]= -(-) 3 In[35]:= NIntegrate[((Cos[x])^2)^(3/2),{x,Pi/2,Pi}] Out[35]= -0.666667 (* Calculus 2, MMa 0. Integrate can also disagree with NIntegrate. *) In[36]:= Integrate[1/(x*Sqrt[5x^2-3]),{x,-3,-1}] Sqrt[3] -Sqrt[3] Sqrt[3] ArcCos[-(-------)] Sqrt[3] ArcCos[---------] Sqrt[5] 3 Sqrt[5] Out[36]= -------------------------- - ------------------------- 3 3 In[37]:= N[%] Out[37]= 0.360798 In[38]:= NIntegrate[1/(x*Sqrt[5x^2-3]),{x,-3,-1}] Out[38]= -0.360798 o / --------Cut Here------X---------snip-snip------------------------- o \ *___________________________________________________________________* | Roger Alexander | "Of the seven dwarves, only Dopey had | | alex@iastate.edu | a shaven face. This should tell us | | Expressing my opinion | something about the custom of shaving." | | is part of my *job*. | -- Tom Robbins, | *________________________|__________________________________________* -------------------------------------------------------------------- In the following, "->" is the SymbMath prompt for input. The output "inf" of integration means divergence of integration. ************ Problem 3 ********************** ->inte(1/x^2, (x from -3 to 0-zero)) + inte(1/x^2, (x from 0+zero to 1)) inf ********** Problem 11 ********************** ->y=1/(x+1)^3 ->inte(y, (x from -2 to -1-zero)) + inte(y, (x from -1+zero to 2)) (1/2) + 3^(-2)*(-1/2) **************** Problem 12 ********************* ->inte(x^(-4/3), (x from -1 to 0-zero))+inte(x^(-4/3), (x from 0+zero to 1)) (-6) + 6*zero^(-1/3) ->subs(zero=0 to last) inf ******************* Problem 15 *********************** ->inte(1/x, (x from -1 to 2)) ln(2) ******************* Problem 16 ************************** ->y=1/(x^2-x-2) ->inte(y, (x from 0 to 2-zero))+inte(y, (x from 2+zero to 4)) **************** Problem 22 ***************************** ->inte(1/(x*ln(x)^2), (x from 1/e to e)) ************** Problem 23 ************************ ->y=1/x^2*cos(1/x) ->inte(y, (x from -1 to 0-zero)) + inte(y, (x from 0+zero to 2)) ((3/2) - inf)* undefined: 1/0 *************** Problem 29 ********************** ->y=1/(x-4)^2 ->inte(y, (x from 0 to 4-zero)) + inte(y, (x from 4+zero to inf)) inf *************** Problem 30 ************************ ->inte(1/(x+2), (x from -inf to 0)) -inf + ln(2) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Here are some examples that Mathemtica cannot find solutions of differential equations. ****************** Example #1 **************************** Article 1529 of sci.math.symbolic: >From: sheyn@bucsf.bu.edu (Igor Sheyn) Newsgroups: sci.math.symbolic Subject: MMa and O.D.E. Date: 10 Sep 91 15:39:52 GMT Organization: Computer Science Department, Boston University, Boston, MA, USA As far as I understand Mma cannot solve diff. eq. where the solution would be implicit funnction y of x. I am talking about 1.2 version. Is the situation in 2.0 the same? What about other packages ( like maple, derive, reduce etc.)? --------------------------------------------------------- Article 1522 of sci.math.symbolic: >From: jpg@spectre.unm.edu (Jeffrey P. Golden) Newsgroups: sci.math.symbolic Subject: MMa and O.D.E. Date: 11 Sep 91 22:25:57 GMT Organization: Dept. of Math & Stat, University of New Mexico, Albuquerque > Date: 10 Sep 91 15:39:52 GMT > From: sheyn@bucsf.bu.edu (Igor Sheyn) > Organization: Computer Science Department, Boston University, Boston, MA, USA > As far as I understand Mma cannot solve diff. eq. where the solution > would be implicit function y of x. I am talking about 1.2 version. > Is the situation in 2.0 the same? What about other packages > (like maple, derive, reduce etc.)? I asked Igor for a concrete example to work with. He sent me: > Date: Wed, 11 Sep 91 09:23:31 -0400 > From: sheyn@bucsf.bu.edu (Igor Sheyn) > > OK, consider the family of curves x+y+Log[y]=c; > y is implicitly a function of x. > Implicit diff. gives 1+y'[x](1+1/y[x])==0; y'[x]==-y[x]/(y[x]+1); > Mathematica given this eq. as input to DSolve says that built-in > procedure can't solve it. Using MACSYMA: (c1) depends(y,x)$ (c2) ode2(diff(y,x) = -y/(y+1),y,x); (d2) - log(y) - y = x + %c (c3) method; (d3) separable >From: Jeffrey P. Golden Organization: Symbolics MACSYMA Division ****************** Example #2 ***************************** Article 1553 of sci.math.symbolic: >From: leach@images.cs.und.ac.za Newsgroups: sci.math.symbolic Subject: Solution of differential equation Date: 23 Sep 91 06:03:03 GMT Organization: Univ. Natal, Durban, S. Africa I have tried the following equation on Mathemtica (V1.2) MSDOS 386/7. y'[x] = y[x]^(1/2) y[0] = 0 DSolve could not handle it. (It rarely solves anything!!), and the RungeKutta package only gave me the solution y[x]=0 Obviously, there is another solution viz. y[x] = (x/2)^2 Can anyone run the original two equations through any package they have and tell me the results. I want to see if any package will actually give both or at least the other equation. Kesh Govinder leach@images.cs.und.ac.za ------------------------------------------------------------ Article 1556 of sci.math.symbolic: >From: hanche@imf.unit.no (Harald Hanche-Olsen) Newsgroups: sci.math.symbolic Subject: Re: Solution of differential equation Date: 23 Sep 91 17:25:22 GMT Organization: The Norwegian Institute of Technology, Trondheim, Norway. In article <1991Sep23.060303.12010@images.cs.und.ac.za> leach@images.cs.und.ac.za writes: I have tried the following equation on Mathemtica (V1.2) MSDOS 386/7. y'[x] = y[x]^(1/2) y[0] = 0 DSolve could not handle it. (It rarely solves anything!!) Right. Of course you should realize that this problem has an infinity of solutions, of the form y[x]=0 for x < a and y[x]=((x-a)/2)^2. This is the classic example of an equation for which the uniqueness theorem breaks down because the righthand side does not satisfy the Lipschitz condition. That said, I am sorry to report that Maple 4.3 only finds the solution (1/4)x^2. But maybe it is too much to expect these systems to worry about the breakdown of uniqueness theorems? -- Harald Hanche-Olsen I eat my peas with honey Division of mathematical sciences I've done it all my life The Norwegian Institute of Technology It makes the peas taste funny N-7034 Trondheim NORWAY But it keeps them on the knife ---------------------------------------------------------- Shareware version of SymbMath 1.3A can solve these problems. In SymbMath, the symbol "->" is the input prompt, and "last" is the last output. ****************** Example #1 ************************* ->1+d(y)/d(x)*(1+1/y)==0 1 + d(y)/d(x) + d(y)/(y*d(x)) == 0 ->inte(last*d(x)) x + y + ln(sgn(y)*y) == Constant ->last-x y + ln(sgn(y)*y) == Constant - x ***************** Example #2 ************************** ->d(y)/d(x)==sqrt(y) d(y)/d(x) == y^0.5 ->last*y^(-0.5) y^(-0.5)*d(y)/d(x) == 1 ->inte(last*d(x)) y^0.5/0.5 == Constant + x ->last*0.5 y^0.5 == 0.5*Constant + 0.5*x ->last^2 y == (0.5*Constant + 0.5*x)^2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Here is some bugs of sqrt(x^2) and integrals of abs(x) in Maple V and Mathematica 1.2 and 2.0. --------------------------------------------------------------------- Article 1634 of sci.math.symbolic: >From: deghare@daisy.waterloo.edu (Dave Hare) Newsgroups: sci.math.symbolic Subject: Re: Bug in Maple V Date: 7 Oct 91 00:05:23 GMT Organization: University of Waterloo In article <1991Oct03.131235.28858@donau.et.tudelft.nl> reeuwijk@dutentb.et.tudelft.nl (C. van Reeuwijk) writes: >In <22802@duke.cs.duke.edu> yu@physics.phy.duke.edu (Yu Yun-Liang) writes: > > >>Dear Maple Users, > >> I found a bug in the procedure `@` in Maple V, see the following >>session. > >How about this one: > > |\^/| MAPLE V >._|\| |/|_. Copyright (c) 1981-1990 by the University of Waterloo. > \ MAPLE / All rights reserved. MAPLE is a registered trademark of > <____ ____> Waterloo Maple Software. > | Type ? for help. >> sqrt(x*x); > x <-- should be abs(x) Unfortunately, that is also wrong. Assuming you want to use the principal branch, the correct answer is sqrt(x^2) = s(x)*x where / 1 if Re(x) > 0 or Re(x) = 0 and Im(x) > 0 s(x) = < 0 if x = 0 \ -1 otherwise (The value s(0) is not important for this application, but it is reasonable to define it to be 0 for other purposes.) I think it is important to keep in mind that to all intents and purposes functions containing "abs" cannot be integrated symbolically, and can be quite hard to integrate numerically. Thus it is not simply a matter of replacing the (sometimes) invalid transformation sqrt(x^2) -> x with the correct one, for this would effectively neuter much of the symbolic machinery in use in Maple. Rather, a mechanism must be developed which allows for properties to be asserted which indicate when such a transformation is valid. Experience with other symbolic mathematics programs has shown that it is difficult to make such a mechanism user intelligible, let alone user friendly. Dave Hare ---------------------------------------------------------------------- Article 1690 of sci.math.symbolic: >From: burnetas@andromeda.rutgers.edu (Apostolos Burnetas) Newsgroups: sci.math.symbolic Subject: Mathematica (Inconsistency?) Date: 22 Oct 91 00:15:57 GMT Organization: Rutgers Univ., New Brunswick, N.J. When I ask mathematica to compute Sqrt[a^2] I get back the answer a and not the correct Absolute[a]. Is there any way around this difficulty? Please note that this works fine if a has a certain value. My problem is how to get the correct answer with general a. {personal e-mail : burnetas@andromeda.rutgers.edu } ----------------------------------------------------- Article 1710 of sci.math.symbolic: >From: gjc@mitech.com (George J. Carrette) Newsgroups: sci.math.symbolic Subject: Re: Mathematica (Inconsistency?) Date: 24 Oct 91 10:39:31 GMT Organization: Mitech Corporation, Concord MA In article <1991Oct22.015749.1581@blaze.cs.jhu.edu>, stiller@blaze.cs.jhu.edu (Lewis Stiller) writes: > In Mathematica 2.0, Sqrt[a^2] evaluates to Sqrt[a^2], unless > PowerExpand is explicitly applied to the expression. > I suppose then in Mathematica 3.0, Integrate(x^n,x) will evaluate to Integrate(x^n,x) unless IntegrateExpand is explicitly applied to the expression. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SymbMath 1.4 easily solve these problems. In the following examples, a symbol "->" is the SymbMath input prompt, sgn(a)=1 declares a>0, and sgn(b) =-1 declares b<0. *************** Problem 1: reduction of sqrt(x^2) ***************** ->sgn(a)=1 ->sqrt(a^2) a ->sgn(b)=-1 ->sqrt(b^2) (-b) ->sqrt(x^2) x*sgn(x) ******************** Problem 2: integral of abs(x) ********************* ->inte(abs(x), x from -1 to 1) 1 ->inte(abs(x)^6*d(x)) Constant + (1/7)*x*abs(x)^6