Re: A trap: TWO HOWLERS in Mathematica 6 making a dangerous match



On Jun 16, 7:57 pm, Vladimir Bondarenko <v...@xxxxxxxxxxxxxxx> wrote:
(* A freshman - or a biologist etc - tries to calculate a
divergent integral not realizing that it diverges... *)

Integrate[(1+z) Sin[z]/z, {z, 0, Infinity}]

(* Mathematica 6 returns an invalid answer, - but without
any warning message, the first defect. *)

(2+Pi)/2

%//N

2.5708

(* The customer has heard about some Vladimir and his VM
machine and realizes already that computer algebra systems
tend to have bugs, so he or she tries to verify the above
result via a quadrature... *)

NIntegrate[(1+z) Sin[z]/z,{z,0,Infinity}]

(* ... and encounters yet another Mathematica 6 eerie defect
- not a only a finite number is given - again without any
warning message which is itself a bug... - but this number
coincides identically with the approximation of the exact
answer... nothing to add. *)

2.5708

This is, I think, an interesting phenomenon from the point of view of
both symbolic and numeric calculus. I don't claim to fully understand
it but, having encountered it over the years, I can say a bit. The
first trouble, for both symbolic and numeric integration, is the
failure to detect divergence. But why do such disparate methods then
give numerically equivalent results? This is because some singularity-
crushing quadrature schemes have the effect, in cases of divergent
integrals, of giving a finite result that agrees with the generalized
integral (that is, the result of removing singular parts e.g via
series expansion).

I guess this feature of quadrature can be a blessing or a curse. It
depends on whether you are striving for a numerical evaluation of a
generalized integral, or trying to double-check your symbolic result
and wanting to know if in fact it diverges (or using a symbolic
computation to check your numeric routine).

While I'd not refer to the problems indicated herein as howlers, it is
generally acknowledged that this phenomenon can be a dangerous match.
I hope I'm stating the obvious here.


Best wishes,

Vladimir Bondarenko

VM and GEMM architect
Co-founder, CEO, Mathematical Director

http://www.cybertester.com/ Cyber Tester, LLChttp://maple.bug-list.org/ Maple Bugs Encyclopaediahttp://www.CAS-testing.org/ CAS Testing

P.S.

Hummm... shouldn't I give a call to Wolfram Research
and offer them to rely upon my famous VM machine?

It would be quite redundant. I'm fairly certain (I'll verify when I
have more time) that this is a simple failure of the convergence
testing code. The deficiencies therein are vast, at least where
growing and oscillatory factors coexist. About all I'll say is I think
it has improved over time. I wouldn't even put money on that.

The point is not to further test what we know is held together by spit
and frayed bailing wire; we have testing a-plenty to tell us this. The
point is to figure out the algorithms, or, failing that, better
heuristics, to improve on the current status.


P.P.S.

Guess... how many Mathematica 6 defects the VM machine
has already calculated? :-)

P.P.P.S.

My birthday, Jun 19, is closer and closer...

Daniel Lichtblau
Wolfram Research

.



Relevant Pages

  • Re: How do you make decisions that optimize software quality?
    ... >> leaving integration until the end of the project. ... Programmer tests must run perfectly all the time. ... Customer tests are defined by the customer, ... Whenever a defect shows up in spite of all the tests, ...
    (comp.object)
  • Re: How do you make decisions that optimize software quality?
    ... >> leaving integration until the end of the project. ... Programmer tests must run perfectly all the time. ... Customer tests are defined by the customer, ... Whenever a defect shows up in spite of all the tests, ...
    (comp.lang.java.softwaretools)
  • Re: LISP routines to do symbolic differentiation
    ... But, I've tried Mathematica to integrate the function I have, ... methods other than indefinite integration, ... For the integration in the present thread, I'm guessing you want to do ... to find antiderivatives using genetic programming, ...
    (comp.lang.lisp)
  • not a bug in integrate, Mma 6.0. But simplfication/assumptions
    ... You will need mathematica 6.0 or 5.* to try this. ... Integration is not, I think, inherent in the problem. ... expressions with assumptions is an issue, or that the Mma operation S/. ... but one generic to other computer algebra systems [most of which I ...
    (sci.math.symbolic)
  • Re: Optimizing/minimizing functions that use absolute value.
    ... with both differentiation and integration of absreal itself: ... This is a difficult problem for computer algebra systems. ... Mathematica and Derive, and neither is able to do this symbolically. ... I could be wrong; the numerical integration ...
    (sci.math.num-analysis)