Re: Integral problem
- To: mathgroup at smc.vnet.net
- Subject: [mg84839] Re: Integral problem
- From: "David W.Cantrell" <DWCantrell at sigmaxi.net>
- Date: Wed, 16 Jan 2008 03:29:35 -0500 (EST)
- References: <fmhq3n$beb$1@smc.vnet.net>
"Josef Otta" <josef.otta at gmail.com> wrote: > Dear mathgroup, > > consider the following integral: > > sol=Integrate[ > (4a (1-u^2)^(a-2)(s-u)s)^(-1/p), {u,0,s}, Assumptions-> > {a>1,p>1,1>s>0,Element[s,Reals],Element[p,Rationals],Element[a, > Rationals]} > ] > > I do not know why i got complex result, which is in this case > unexpected. does anyone have any idea? is this a bug or i overlooked > anything? It's a bug, but there is a simple way to get an answer which I suspect is correct: In[8]:= Integrate[(4*a*(1 - u^2)^(a - 2)*(s - u)*s)^(-1/p), {u, 0, s}] Out[8]= If[Re[1/p] < 1 && 0 < s <= 1, (p*s^((-2 + p)/p)*(1 - s^2)^((2 - a)/p)*AppellF1[(-1 + p)/p, (-2 + a)/p, (-2 + a)/p, 2 - 1/p, s/(1 + s), s/(-1 + s)])/(a^p^(-1)*(-1 + p)), Integrate[(a*s*(s - u)*(1 - u^2)^(-2 + a))^(-p^(-1)), {u, 0, s}, Assumptions -> s > 1 || Re[1/p] >= 1 || s <= 0]]/4^p^(-1) In[9]:= corsol = FullSimplify[%, p > 1 && 0 < s < 1] Out[9]= (p*s^((-2 + p)/p)*(1 - s^2)^((2 - a)/p)* AppellF1[(-1 + p)/p, (-2 + a)/p, (-2 + a)/p, 2 - 1/p, s/(1 + s), s/(-1 + s)])/(4^p^(-1)*a^p^(-1)*(-1 + p)) I said that I suspect it is correct. My suspicion is based, in part, on a few numerical checks such as In[10]:= corsol /. {a -> 5/3, p -> 3, s -> 9/10} Out[10]= (9*19^(1/9)*AppellF1[2/3, -(1/9), -(1/9), 5/3, 9/19, -9])/(4*2^(2/9)*5^(8/9)) In[11]:= N[%] Out[11]= 0.723373 In[12]:= a = 5/3; p = 3; s = 9/10; NIntegrate[(4*a*(1 - u^2)^(a - 2)*(s - u)*s)^(-1/p), {u, 0, s}] Out[12]= 0.723373 - 2.18311*10^-13 I Now that we have a presumably correct answer, let's consider the bug. As best I can tell, it is not caused by any of the "standard culprits" I would have guessed. It seems not to be caused by the presence of parameters in the integrand, unnoticed discontinuities of a presumed antiderivative, etc. Consider the incorrect result In[13]:= a = 5/3; p = 3; s = 9/10; Integrate[(4*a*(1 - u^2)^(a - 2)*(s - u)*s)^(-1/p), {u, 0, s}] Out[13]= -((9*(-1)^(1/4)*HypergeometricPFQ[{-(1/9), 1/2, 1}, {5/6, 4/3}, (81*I)/100])/(4*5^(2/3))) In[14]:= N[%] Out[14]= -0.56906 - 0.528588 I But the truly surprising thing to me is that if we modify In[8], which gave a presumably correct answer, by merely supplying assumptions which should have been _helpful_, we get an incorrect result instead: In[15]:= Clear[a, p, s]; Integrate[(4 a (1 - u^2)^(a - 2) (s - u) s)^(-1/p), {u, 0, s}, Assumptions -> {p > 1, 0 < s < 1}] Out[15]= If[a > 0, ((-(-1)^(1/4))*2^(-1 + 1/p)*Sqrt[Pi]*s^((-1 + p)/p)*Gamma[(-1 + p)/p]*HypergeometricPFQRegularized[{1/2, 1, (-2 + a)/p}, {3/2 - 1/(2*p), 1 - 1/(2*p)}, I*s^2])/(a*s)^p^(-1), Integrate[1/((s*(s - u))^p^(-1)*(a*(1 - u^2)^(-2 + a))^p^(-1)), {u, 0, s}, Assumptions -> p > 1 && 0 < s < 1 && a <= 0]]/4^p^(-1) Thus we have an example showing that supplying assumptions can be detrimental! David W. Cantrell