It was originally asked here.

According to About the confluent versions of Appell Hypergeometric Function and Lauricella Functions the integral

$$\int_0^1t^{a-1}(1-t)^{c-a-1}(1-xt)^{-b}e^{yt}~dt $$

can be expressed as


It look like true, but gives numeric error. Look that, calculated by Mathematica:

F[a_?NumericQ, b_?NumericQ, c_?NumericQ, x_?NumericQ, y_?NumericQ] := 
 NIntegrate[t^(a - 1) (1 - t)^(c - a - 1) (1 - x t)^(-b) Exp[ y t], {t, 0, 1}]

N[F[3/2, 1, 2, .4, .3], 20]

G[a_?NumericQ, b_?NumericQ, c_?NumericQ, x_?NumericQ, y_?NumericQ] := 
 Gamma[a] Gamma[c - a]/Gamma[c] Limit[AppellF1[a, b, k, c, x, y/k],k -> Infinity]

N[G[3/2, 1, 2, .4, .3], 20] 

where I was careful to ensure that $|x|<1,|y|<1$, and $\text{Re}(c)>\text{Re}(a)>0$, which are the condition of $F_1$.Note that the results are different. Furthermore, according to Wolfram Alpha

$$\lim\limits_{k\rightarrow \infty}F_1[3/2,1,k;2;0.4,\text{any/k}]=1.4549$$

So, is It a math issue or Mathematica issue?

  • $\begingroup$ Question to other users: should we include the tag bugs? $\endgroup$ – AccidentalFourierTransform May 2 '18 at 19:19
  • $\begingroup$ @AccidentalFourierTransform Did you report this bug to Mathematica? Do you know if they fixed it? $\endgroup$ – Dinesh Shankar Aug 17 '18 at 20:53

There is a bug in the calculation of the large $k$ limit of AppellF1. This is easy to illustrate:

wrongLimit = Limit[AppellF1[3/2, 1, k, 2, 4/10, (3/10)/k], k -> Infinity];
correctLimit = NLimit[AppellF1[3/2, 1, k, 2, 4/10, (3/10)/k], k -> Infinity];
Plot[{AppellF1[3/2, 1, k, 2, 4/10, (3/10)/k], wrongLimit, correctLimit}, {k, .5, 5}
, PlotStyle -> {Blue, Directive[Red, Dashed], Directive[Green, Dashed]}, PlotRange -> {Automatic, {0, 3}}]

enter image description here

Perhaps the bug should be reported. In the meantime, you can use NLimit to get the correct limit. If you use NLimit in your definition of G, you get results that consistent with those of F (up to numerical inaccuracy).

| improve this answer | |
  • $\begingroup$ Thank you a lot! I didn't know 'NLimit'. $\endgroup$ – Dinesh Shankar May 2 '18 at 19:16
  • 1
    $\begingroup$ @user3321 I'm glad I could help :-) $\endgroup$ – AccidentalFourierTransform May 2 '18 at 19:17
  • $\begingroup$ Is it normal this code NLimit[AppellF1[3/2, -1, k,1, 16(1)^2 Sin[Pi/2]^2, -(8 (1)^2 Sin[Pi/2]^2)/k], k -> Infinity] take a long time? $\endgroup$ – Dinesh Shankar May 9 '18 at 20:00
  • $\begingroup$ I don't know how NLimit works internally, so I can't tell. But if you want to accelerate the process, you can use SequenceLimit[AppellF1[3/2, -1, #, 1, 16, -(8/#)] & /@ N[Range[17, 35, 2]]], which yields the approximate limit 0.065 in a few seconds on my PC. It is less reliable than NLimitthough, so use at your own risk (I plotted the function and it seems that the result is more or less good, but don't take my word for it). $\endgroup$ – AccidentalFourierTransform May 9 '18 at 20:15
  • $\begingroup$ Unfortunately this result is not correct. The correct result should be $-0.05971141134287522$, which is the result of the integral NIntegrate[ t^{-1/2} (1-t)^{-1/2} (1-16 Sin[Pi/2]^2 t) Exp[-8 Sin[Pi/2]^2 t], {t, 0, 1}]. Sorry, but it's a $1/2$ instead of $3/2$. The code with $1/2$ results $-0.06334540766907899$. Maybe the issue is math now. Anyway, thank you again for your help. If you know anything else, let me know, please. $\endgroup$ – Dinesh Shankar May 9 '18 at 20:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.