MathGroup Archive 2002

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Removed[] pop-visiting explanation?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg34276] Re: [mg34265] Removed[] pop-visiting explanation?
  • From: Daniel Lichtblau <danl at wolfram.com>
  • Date: Mon, 13 May 2002 05:54:22 -0400 (EDT)
  • References: <200205120726.DAA26031@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Vladimir Bondarenko wrote:
> 
> Hello,
> 
> In Mathematica 4.1, the answers to several thousands of
> integrals involve  Removed["$$Failure"] . For example,
> you can see it in the following simplest inputs
> 
> Integrate[Log[1 - z^2] Cos[Sqrt[z]], {z, -1, 1}]// InputForm
> 
> (-8*E^2 + 4*(-2 + EulerGamma - CosIntegral[-1 + I] + 2*CosIntegral[I] -
> CosIntegral[1 + I] - 2*ExpIntegralEi[1] + ExpIntegralEi[2] - Log[4] +
> I*SinIntegral[-1 + I] - (2*I)*SinIntegral[I] + I*SinIntegral[1 + I]) +
> 
> E*(Removed["$$Failure"]         - 4*(EulerGamma*(Cos[1] + Sin[1]) + Sin[1]*(-
> 
> 2*CosIntegral[1] + CosIntegral[2] - Log[4] - 2*SinIntegral[1] +
> SinIntegral[2]) - Cos[1]*(4 + 2*CosIntegral[1] - CosIntegral[2] +
> Log[4] - 2*SinIntegral[1] + SinIntegral[2]))))/(2*E)
> 
> Integrate[Log[1 - z^2] Sin[Sqrt[z]], {z, -1, 1}]
> Integrate[Log[1 - z^2] Cosh[Sqrt[z]], {z, -1, 1}]
> Integrate[Log[1 - z^2] Sinh[Sqrt[z]], {z, -1, 1}]
> Integrate[Log[1 - z^2] Sinh[Sqrt[-z]], {z, -1, 1}]
> .......................................................................
> .......................................................................
> .......................................................................
> 
> I tried to ferret out more about it, but the Help Browser does not
> include it, and I found only
> 
> ?? Removed
> 
> "Removed[string] is printed to indicate a symbol that has been removed."
> 
> Attributes[Removed] = {Protected}
> 
> Why this unusual bug occurs? I mean, what language constructions might
> be involved in or responsible for it?
> 
> How can I get more information about the stuff like this?
> 
> What is the simplest way to program in Mathematica this case?
> 
> Can anybody drop me at least a couple of words?
> 
> Thanks in advance!
> 
> Vladimir Bondarenko

Alot of Integrate code is written in Mathematica and makes use of
$$Failure to indicate problems that arise in certain attempts. Not all
the code correctly handles this (which is a bug). Somewhere prior to
returning the result, Remove is applied to all instances of $$Failure
(this may be another bug, I'm not certain). Hence what you see.

I've recently been going over alot of Integrate bugs of this sort. Our
development version now gives:

In[14]:= Integrate[Log[1 - z^2] Cos[Sqrt[z]], {z, -1, 1}]// InputForm
Out[14]//InputForm= 
Sqrt[2*Pi]*(BesselI[-3/2, 1] - BesselJ[-3/2, 1])*(-2 + Log[4])

In[15]:= In[15]:= N[%]
Out[15]= -1.24446

In[16]:= NIntegrate[Log[1 - z^2] Cos[Sqrt[z]], {z, -1, 1}]// InputForm
Out[16]//InputForm= -1.262993846600215 + 0.*I

In[26]:= In[26]:= Integrate[Log[1 - z^2] Sin[Sqrt[z]], {z, -1, 1}] //
InputForm
Out[26]//InputForm= 
(Sqrt[Pi/2]*(-15*Pi*(BesselI[3/2, 1] + I*BesselJ[3/2, 1]) + 
   BesselI[3/2, 1]*((52 - 92*I) + (30*I)*Log[8]) + 
   2*BesselJ[3/2, 1]*((-46 + 26*I) + 15*Log[8])))/15

In[27]:= N[%]
Out[27]= -0.475055 - 0.628458 I

In[29]:= NIntegrate[Log[1 - z^2] Sin[Sqrt[z]], {z, -1, 1}] // InputForm
Out[29]//InputForm= -0.4763959406176462 - 0.6298381554069934*I

and similarly for the other examples.


Daniel Lichtblau
Wolfram Research


  • Prev by Date: Re: Re: Tough Limit
  • Next by Date: Re: RE: RE: Re: How to integrate over a constrained domain
  • Previous by thread: Removed[] pop-visiting explanation?
  • Next by thread: RE: RE: Re: How to integrate over a constrained domain