Re: Strange result with Integrate
- To: mathgroup at smc.vnet.net
- Subject: [mg38312] Re: Strange result with Integrate
- From: "David W. Cantrell" <DWCantrell at sigmaxi.org>
- Date: Thu, 12 Dec 2002 01:32:25 -0500 (EST)
- References: <at4bi0$elm$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Ray <rayfg at optonline.net> wrote: > Can anyone explain the following results? > > In[8]:= > r[t_]:=4-3Sin[t] > > In[9]:= > \!\(NIntegrate[Sqrt[r[t]\^2 + \(r'\)[t]\^2], {t, 0, 2 \[Pi]}]\) > > Out[9]= > 28.8142 This is correct. > In[10]:= > \!\(Integrate[Sqrt[r[t]\^2 + \(r'\)[t]\^2], {t, 0, 2 \[Pi]}] // N\) > > Out[10]= > -18.9606 This is wrong. The exact (incorrect) result of this integration in my version 4.1 is, after simplification, 2*(EllipticE[Pi/4, -48] + EllipticE[(3*Pi)/4, -48] - 25*(EllipticF[Pi/4, -48] + EllipticF[(3*Pi)/4, -48])). The last two terms, involving incomplete elliptic integrals of the first kind, are spurious. Omitting them, the answer would then be correct. However, there is a simplification which I'm surprised that Mathematica doesn't know: 2*(EllipticE[Pi/4, -48] + EllipticE[(3*Pi)/4, -48]) should simplify to an expression with just a _single complete_ elliptic integral of the second kind, namely (#) 4*EllipticE[-48], a much nicer form of the exact (correct) answer. But there's more of interest here! Note that the radicand of the integrand simplifies to just 25 - 24*Sin[t]. So what do we get if we ask Mathematica to Integrate[Sqrt[25 - 24*Sin[t]], {t, 0, 2*Pi}]? We find yet another error! We get 2*EllipticE[Pi/4, -48] + 2*EllipticE[(3*Pi)/4, -48] + 4*EllipticF[I*ArcSinh[1/(4*Sqrt[3])], -48] the last term of which is spurious (but, being imaginary, is different from the spurious terms mentioned previously). Next, let's see what we get if we ask for an indefinite integral: Integrate[Sqrt[25 - 24*Sin[t]], t] yields -2*EllipticE[(Pi/2 - t)/2, -48]. Hooray! If we now use the Fundamental Theorem _ourselves_, we do get a correct exact answer (finally!), albeit not in the simplified form of (#). So I must now wonder why Mathematica got a spurious imaginary term when it did the corresponding definite integral. Finally, let's see what happens if we first transform the integral ourselves using the standard substitution u = Sin[t]: We get 2*Integrate[Sqrt[(25-24u)/(1-u^2)], {u, -1, 1}]. For this, Mathematica then gives (28*I)*(EllipticE[1/49] - EllipticE[ArcSin[7], 1/49] + EllipticF[ArcSin[7], 1/49] - EllipticK[1/49]) which, although messy (and looking as though it might be complex, when it is in fact purely real), does happen to be correct! Hooray again! In summary, correct exact results can -- at least, sometimes -- be obtained by assisting Mathematica ourselves, although these are not as simple as (#). But we should not have to lead Mathematica by the hand, so to speak. I will be very happy when such matters concerning elliptic integrals are corrected. David Cantrell -- -------------------- http://NewsReader.Com/ -------------------- Usenet Newsgroup Service New Rate! $9.95/Month 50GB