Re: question about Integrate
- To: mathgroup at smc.vnet.net
- Subject: [mg49266] Re: question about Integrate
- From: "David W. Cantrell" <DWCantrell at sigmaxi.org>
- Date: Sat, 10 Jul 2004 02:48:36 -0400 (EDT)
- Organization: NewsReader.Com Subscriber
- References: <cclelo$k9m$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
"Florian Jaccard" <florian.jaccard at eiaj.ch> wrote:
> Dear specialists,
>
> I asked my students to compute the area of the following closed curve :
>
> x[t_] := Sin[t]; y[t_] := E^Cos[t];
>
> ParametricPlot[{x[t], y[t]},
> {t, 0, 2*Pi}];
>
> I expected the following input :
>
> 2*NIntegrate[x[t]* Derivative[1][y][t],{t, Pi, 0}]
>
> which gives the following output :
>
> 3.5509993784243483
>
> (They also could have done it like this :
> 2*NIntegrate[y[t]*Derivative[1][x][t],{t, 0, Pi}]
> and it gives the same output)
>
> As the help browser says "N[Integrate[ . ]] calls NIntegrate for
> integrals that cannot be done symbolically" , I never told my students to
> avoid that way :
>
> 2*N[Integrate[x[t]*Derivative[1][y][t],{t, Pi, 0}]]
>
> But, surprise, it gives an other answer :
>
> 2.1262
>
> Checking carefully, I could see that NIntegrate did it fine, but
> N[Integrate...] is wrong. It seems that the special functions BesselI and
> StruveL (used by Mathematica if you type Integrate[...]) are making the
> mistake...
If you simply drop StruveL from the result, it is then correct. I have seen
this happen on several other occasions too. This bug needs to be
exterminated soon!
> Now, what should I tell my students ? To never believe Integrate if not
> checked with NIntegrate ?
Maybe: Be wary of StruveL!
> Must I recognize that there is a bug in Integrate, or what did I
> understand wrong ?
Eh? You must recognize that there are lots of bugs in Integrate, not just
the one described above. (And of course, as you mentioned above, checking
with NIntegrate can be a good idea.)
David Cantrell