I have a problem with an integral:
$$\small \int_0^\infty \alpha^{-\frac{5}{4}}\left(\alpha^{ik_2}+\alpha^{-ik_2}\right) {}_{2}F_1\left(\frac{1}{4}-ik_1-ik_2,\frac{1}{4}+ik_1+ik_2,\frac{1}{2},-\alpha\right) {}_{2}F_1\left(\frac{1}{2}-ik_3-ik_2,\frac{1}{2}+ik_3+ik_2,1,-\frac{1}{\alpha}\right) \, d\alpha$$
where $ {}_{2}F_1$ is the hypergeometric function.
Wolfram Mathematica gives answer but it's tedious.
Could you give some information about how to solve evaluate such integral?
$k_i\in \mathbb{R}^+$.
Some information connected to the problem which I know:
There is a useful integral for this case:
$$\int_0^\infty \alpha^{\gamma-1} {}_{2}F_1\left(\frac{\gamma}{2}-ik_1,\frac{\gamma}{2} + ik_1,\gamma,-\alpha\right) {}_{2}F_1\left(\frac{\gamma}{2}-ik_2,\frac{\gamma}{2} + ik_2,\gamma,-\alpha\right) \, d\alpha\propto \delta(k_1-k_2)f(k_1)$$
where $f$ is a product of $\Gamma$-functions.
It is connected with sturm-liouville operator:
$-\frac{d}{d\alpha}\alpha(\alpha+1)\frac{df}{d\alpha}+\frac{(1-\gamma)^2}{4\alpha}f$
Function: $\alpha^{\frac{1}{2}(\gamma-1)} {}_{2}F_1(\frac{\gamma}{2}-ik,\frac{\gamma}{2}+ik,\gamma,-\alpha)$ is an eigenfunction of this operator with eigenvalues $k^2+\frac{1}{4}$ If you have some information about that I'll be glad to know it.
To evaluate something this tough, I'd start with Mathematica. Let's see what it (version 10.4.1.0, Linux x86 (64-bit)) does with this integral.
... which certainly is a mess. Let's simplify that at $k_2 = 1$ and graph it to get a glimpse of how much numerical treachery we are facing.
... so, a lot of treachery. Sometimes increasing
WorkingPrecision(above the default,$MachinePrecision= 15.9546) helps, especially for functions that have substantial cancellation in the sums that define them.The non-smooth surface normals in the corner of large
k1andk3suggest we are near the edge of losing the meager precision shown, so we add a few more digits, giving a result that is better, but not perfect.So if we are going to use Mathematica to evaluate this integral, we should be careful about specifying precision and accuracy goals. As an example, with $k_1 = k_2 = k_3 = 100$ ("medium" choices of the $k_i$):
So we get no digits of precision until the
PrecisionGoalandAccuracyGoalare somewhat greater than the $k_i$s and the computation time will be long.This question and answer over at CS.SE discuss how to evaluate the various (regularized) hypergeometric functions appearing in your integrand and result. References there are to Abramowitz and Stegun's "Handbook of Mathematical Functions" which has continued life as NIST's DLMF (Digital Library of Mathematical Functions). Chapter 15 covers the Gauss hypergeometric function ${}_2F_1(a,b;c;z)$ and its regularized version.
The DLMF recommends splitting your integral and applying identities so that all evaluations of ${}_2F_1(a,b;c;z)$ have $z$ in the interval $\left[ 0,\frac{1}{2} \right]$.
You have \begin{align*} f(k_1, k_2, k_3) &= {}_{2}F_1\left(\frac{1}{4}-ik_1-ik_2,\frac{1}{4}+ik_1+ik_2,\frac{1}{2},-\alpha\right) \text{,} \\ g(k_1, k_2, k_3) &= {}_{2}F_1\left(\frac{1}{2}-ik_3-ik_2,\frac{1}{2}+ik_3+ik_2,1,-\frac{1}{\alpha}\right) \text{, and} \\ I(k_1, k_2, k_3) &= \int_0^\infty \; \alpha^{-\frac{5}{4}}\left(\alpha^{ik_2}+\alpha^{-ik_2}\right) f(k_1, k_2, k_3) g(k_1, k_2, k_3) \, \mathrm{d}\alpha \text{.} \end{align*} Following the suggestion, we write \begin{align*} I(k_1, k_2, k_3) &= J_1(k_1, k_2, k_3) + J_2(k_1, k_2, k_3) + K_1(k_1, k_2, k_3) + K_2(k_1, k_2, k_3) \\ J_1(k_1, k_2, k_3) &= \int_0^{1/2} \; \alpha^{-\frac{5}{4}}\left(\alpha^{ik_2}+\alpha^{-ik_2}\right) f(k_1, k_2, k_3) g(k_1, k_2, k_3) \, \mathrm{d}\alpha \\ J_2(k_1, k_2, k_3) &= \int_{1/2}^1 \; \alpha^{-\frac{5}{4}}\left(\alpha^{ik_2}+\alpha^{-ik_2}\right) f(k_1, k_2, k_3) g(k_1, k_2, k_3) \, \mathrm{d}\alpha \\ K_1(k_1, k_2, k_3) &= \int_1^2 \; \alpha^{-\frac{5}{4}}\left(\alpha^{ik_2}+\alpha^{-ik_2}\right) f(k_1, k_2, k_3) g(k_1, k_2, k_3) \, \mathrm{d}\alpha \\ K_2(k_1, k_2, k_3) &= \int_2^\infty \; \alpha^{-\frac{5}{4}}\left(\alpha^{ik_2}+\alpha^{-ik_2}\right) f(k_1, k_2, k_3) g(k_1, k_2, k_3) \, \mathrm{d}\alpha \end{align*}
Having done this, there are a profusion of new hypergeometric functions, but no apparent simplifications. Unless there is a sneaky identity application, I think you're stuck with evaluating with software: Mathematica, mpmath (for Python, see
hyp2f1(a,b,c,z)), or some other tool that is capable.Since we seem to be stuck with software, and you have access to Mathematica, can we build an automated evaluator? (Note: I have not done the numerical analysis to show that the following works or requires the minimal amount of computation to get the desired accuracy/precision. I'm just leaning on prior experience trying to get combinations of hypergeometric functions to evaluate accurately.) Starting with a cut-and-paste of
resultfrom above, and specifying the evaluation only occurs when all arguments are numbers,And we test a few values. We don't get
$MaxExtraPrecisionerrors this time. We could suppress them withQuiet[], if needed.Happily, the digits we claimed we wanted to be good are replicated with the higher precision calculations and the last digits of prior results are rounded in the correct direction.
So, do we get a more encouraging graph?
Yes, but very slowly.