MathGroup Archive 2003

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

Search the Archive

Re: New version, new bugs

  • To: mathgroup at smc.vnet.net
  • Subject: [mg42537] Re: New version, new bugs
  • From: Maxim <.!dontsendhere at uunet.uu.net>
  • Date: Sat, 12 Jul 2003 20:53:18 -0400 (EDT)
  • References: <be5tsj$jfg$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

> On Friday, July 4, 2003, at 02:33 PM, Maxim wrote:
>
> >
> > Andrzej Kozlowski wrote:
> >
> >> On Wednesday, July 2, 2003, at 07:36  pm, Maxim wrote:
> >>
> >>> Funny that it is easy to find errors even in a couple of
> >>> demonstrational
> >>> examples of Mathematica's new capabilities on the Mathworld page
> >>> (http://mathworld.wolfram.com/news/2003-06-23/mathematica5/):
> >>>
> >>> 1) Re[n]>-2 is not a correct convergence condition for
> >>>
> >>> Integrate[Abs[x - y]^n, {x, 0, 1}, {y, 0, 1}]
> >>>
> >>> (a quick way to see that there's something wrong is to look at the
> >>> sign
> >>> of Mathematica's answer when -2<n<-1);
> >>
> >> My Mathematica 5.0 simply gives:
> >>
> >> Integrate::gener: Unable to check convergence.
> >>
> >> as output to this. Am I missing something?
> >>
> >
> > I was just looking at the Mathworld page; one of the examples there was
> >
> > In[1]= Integrate[Abs[x - y]^n, {x, 0, 1}, {y, 0, 1}]
> >
> > Out[1]= If[Re[n]>-2, 2/((n+1)*(n+2)), Integrate[Abs[x - y]^n, {x, 0,
> > 1}, {y,
> > 0, 1}]]
>

Indeed, some messages are generated, but Mathematica does return an answer:

In[1]:= Timing[Integrate[Abs[x - y]^n, {x, 0, 1}, {y, 0, 1}]]

Integrate::gener : Unable to check convergence.

Integrate::gener : Unable to check convergence.

Out[1]=
{272.718Second, If[Re[n] > -2, -((2*I)/((1 + n)*(Im[n] - I*(2 + Re[n])))),
<<1>>]}

this is slightly different from what was shown on the Mathworld page, but for
real n the answers are identical and are certainly incorrect. Here it returns
an incorrect answer without even giving any warnings:

In[1]:= Integrate[Abs[x - y]^(-1), {x, 0, 1}, {y, 0, 1}]

Out[1]=
-2 + 2*I*Pi

There are many more such examples:

In[1]:= Integrate[Sqrt[(x2 - x1)^2], {x1, 0, 1}, Assumptions -> 0 < Re[x2] <
1]

Out[1]=
If[Im[x2] != 0, 1/2 - x2, <<1>>]

(in fact, with given assumption the answer should be 1/2 - x2 + x2^2 +
Im[x2]^2).


There are some areas where improvements over previous versions (if any) seem
disappointing. Here's a small What's Old in Version 5 list:

1) still doesn't handle branch cuts too well:

In[1]:= Limit[ArcTan[Sqrt[Tan[x]] - 1], x -> Pi/2]

Out[1]=
Pi/2

(the right limit is -Pi/2);

In[1]:= Integrate[1/(z^(3/2) - 1), {z, -I, I}]

Out[1]=
(1/3)*I*(2*Pi - Sqrt[3]*Log[10 - 6*Sqrt[2] + 5*Sqrt[3] - 4*Sqrt[6]])

(correct answer is (-(1/3))*I*(2*Pi + Sqrt[3]*Log[10 - 4*Sqrt[6] + Sqrt[3*(49
- 20*Sqrt[6])]]) );

2) still cannot give answers for Sum and Product in conditional form;
doesn't even indicate that the series is divergent in cases like

In[1]:= Sum[I^k, {k, 0, Infinity}]

Out[1]=
1/2 + I/2

3) still fails on integrating piecewise-continuous functions:

In[1]:= Module[
{f = UnitStep[#1, 1 - #1] & },
Integrate[f[t2]*f[t1 - t2], {t1, -Infinity, x}, {t2, -Infinity, Infinity}]]

Out[1]=
(-t2 + x + (1 + t2 - x)*UnitStep[-1 - t2 + x])*UnitStep[-t2 + x]*UnitStep[1 -
t2, t2]

this one is just ridiculous since it doesn't integrate out the t2 variable.
Although I should mention that if you rewrite such expressions as repeated
integrals -- Integrate[Integrate[f,iter2],iter1] instead of
Integrate[f,iter1,iter2] -- and replace UnitStep[x,y,...] with
UnitStep[x]UnitStep[y]... then Mathematica seems to handle such examples
pretty well;

4) I wrote about the errors in LaplaceTransform module before (it was an
add-on package in 3.x and then simply was moved to the kernel without any
bugfixes); now welcome them in 5.0:

In[1]:= LaplaceTransform[Derivative[1][f][2*x], x, y]

MapAt::partw : Part {1, 2} of {1} does not exist.

Out[1]=
y*LaplaceTransform[Derivative[#1 - 1 + 0 & , {1}, {{1, 2}}][f][2*x], x, y] -
  Derivative[#1 - 1 + 0 & , {1}, {{1, 2}}][f][0]

5) still handles DirectedInfinity rather strangely:

In[1]:=
Limit[Arg[x], x -> DirectedInfinity[1 + I], Direction -> 1]
Limit[Csc[I*x], x -> DirectedInfinity[I], Direction -> 1]

Out[1]=
0

Out[2]=
0

6) unpredictably working simplifications:

In[1]:= FullSimplify[2^(4*n + 1) - 16^n]

Out[1]=
2^(1 + 4*n) - 16^n

7) last but not least, there still exists a lot of small annoying errors; my
favorite is

In[1]:= ComplexExpand[Tan[Pi/8]]

Out[1]=
Cot[Pi/8]


I haven't looked closely at the Version 5's new features yet, but I have a
suspicion those modules won't be any more reliable:

In[1]:= Reduce[Sin[x + Pi/5] + Cos[x - Pi/10] == 0, x]

Out[1]=
False

(general solution is x -> (7*Pi)/10 + Pi*C[1]).

Maxim Rytin
m.r at prontomail.com



  • Prev by Date: Re: WeibullDistribution
  • Next by Date: Re: Crank-Nicolson finite difference method for 2D
  • Previous by thread: Re: Re: New version, new bugs
  • Next by thread: Re: Re: New version, new bugs