# Misunderstanding with MeijerG function

I cannot understand a situation with MeijerG function. My problem is as follows. I obtained a MeijerG function as the result of a Fourier transform:

Integrate[
Integrate[
Exp[I*k*r*Cos[φ]]/(k^4 + 1)*k, {φ, 0, 2 π},
Assumptions -> {k > 0, r > 0}],
{k, 0, ∞}, Assumptions -> {r > 0}]

(* 1/2 π MeijerG[{{}, {}}, {{0, 1/2, 1/2}, {0}}, r^4/256]  *)


Let us look at it:

Plot[MeijerG[{{}, {}}, {{0, 1/2, 1/2}, {0}}, r^4/256], {r, 0, 5}] However, few years ago I remember to have obtained the same integral in terms of a more familiar Kelvin kei function as follows $$-\frac{\mathrm{kei}_0(r)}{2 \pi }.$$ I tried to get it using FullSimplify, but failed.

This is my first question on this subject: are you aware of an approach to transform this MeijerG function into any Bessel-based (or Kelvin kei) form?

OK, at that time I used the tables of integrals of Prudnikov, Brychkov and Marichev, and these tables might have had an error.

However, now I try to get this result at r = 0. According to the plot above it is regular in this point. This calculation might be done in several ways: by a direct substitution r -> 0 in the above result, provided I change the assumptions to Assumptions -> {r >= 0} everywhere. Alternatively I can go to a limit r -> 0 or within the old assumptions I can substitute, say, r -> 0.001 to get a close numeric answer. I can, finally, simply put 0 instead of r into the MeijerG function. Here you are:

MeijerG[{{}, {}}, {{0, 1/2, 1/2}, {0}}, 0] // Evaluate

(* MeijerG[{{}, {}}, {{0, 1/2, 1/2}, {0}}, 0] *)

MeijerG[{{}, {}}, {{0, 1/2, 1/2}, {0}}, 0]

(* MeijerG[{{}, {}}, {{0, 1/2, 1/2}, {0}}, 0] *)

MeijerG[{{}, {}}, {{0, 1/2, 1/2}, {0}}, r] /. r -> 0

(* MeijerG[{{}, {}}, {{0, 1/2, 1/2}, {0}}, 0] *)

MeijerG[{{}, {}}, {{0, 1/2, 1/2}, {0}}, 0.00001]

(* 3.00952 *)

Limit[ MeijerG[{{}, {}}, {{0, 1/2, 1/2}, {0}}, r^4/256], r -> 0.00001]

(* 3.14159  *)


In addition I can do the following:

f[r_] := Integrate[
Integrate[
Exp[I*k*r*Cos[φ]]/(k^4 + 1)*k, {φ, 0, 2 π}, Assumptions -> {k > 0, r >= 0}], {k, 0, ∞},
Assumptions -> {r >= 0}]  ;
f

(*  π^2/2  *)


However, one can act another way around. One can substitute r=0 into the initial integral, which will then reduce to the following:

1/(2 π)*Integrate[k/(k^4 + 1), {k, 0, ∞}]

(*  1/8  *)


which, evidently, differs from the results about 3 obtained above.

So, the second question is: what happens here? Why is it so difficult to obtain the value of the MeijerG function in zero?

• Which version were you getting KelvinKei for your integral? I tested your input all the way back to version 5 and still got the same MeijerG. – Chip Hurst Sep 20 '16 at 15:05
• @Chip Hurst I explained it in the main text: this I did about 15 years ago when I still did not use Mma. At that time I used a table of integrals authored by Prudnikov, Brychkov and Marichev, rather than Mma. – Alexei Boulbitch Sep 21 '16 at 7:08
• You could have written your Fourier transform as a single Integrate[] call: Integrate[Exp[I k r Cos[φ]]/(k^4 + 1) k, {k, 0, ∞}, {φ, 0, 2 π}, Assumptions -> {r > 0}]. – J. M.'s torpor Oct 2 '16 at 3:03

The standard way to express MeijerG in terms of more specific special functions is with FunctionExpand. For example

MeijerG[{{1}, {}}, {{1/2, 1, 3/2}, {}}, z]

MeijerG[{{1}, {}}, {{1/2, 1, 3/2}, {}}, z]

FunctionExpand[%]

-2 π z - π^2 z BesselY[1, 2 Sqrt[z]] + π^2 z StruveH[1, 2 Sqrt[z]]


However your expression does not simplify with this approach

FunctionExpand[1/2 π MeijerG[{{}, {}}, {{0, 1/2, 1/2}, {0}}, r^4/256], r > 0]

1/2 π MeijerG[{{}, {}}, {{0, 1/2, 1/2}, {0}}, r^4/256]


The best work around I could find is to express the 3-arg form of MeijerG into a 4-arg form, which will be correct on the positive real axis.

mei = 1/2 π MeijerG[{{}, {}}, {{0, 1/2, 1/2}, {0}}, r^4/256];

FunctionExpand[mei /. {
MeijerG[as_, bs_, c_. r^n_?Positive] :> MeijerG[as, bs, c^(1/n) r, 1/n]
}]

-2 π KelvinKei[0, r]


Another (less successful) workaround is to solve the ODE your MeijerG satisfies.

DifferentialRootReduce[1/2 π MeijerG[{{}, {}}, {{0, 1/2, 1/2}, {0}}, r^4/256], r] Now FunctionExpand knows how to handle DifferentialRoot objects, but it seems to spin forever on this input presumably because the solution from DSolve on this ODE has very complicated coefficients.

If we approximate the initial conditions, we can see your expression is really $-2\pi \text{kei}_0(r)$.

DSolveValue[{
r^3 y[r] + y'[r] - r y''[r] + 2 r^2 y'''[r] + r^3 y''''[r] == 0,
y == 3.110143027307120851178402662733411034645367086925774882662730.,
y' == -2.214005462165970924630693054668943764074273364285757097870330.,
y'' == 0.41257722400705183190081950995066136281590673901451233878430.,
y''' == 1.737742276700605449681080184088918782097307834598471524755230.
}, y[r], r] // Chop

-6.28318530717958647692528677 KelvinKei[0, r]


Addressing your second question, my guess is this particular MeijerG isn't evaluating at the origin because it's a (rather complicated looking) branch point: In addition to Chip's nice answer, another way would be to do a "round trip" using the Mellin transform and its inverse:

InverseMellinTransform[
MellinTransform[π/2 MeijerG[{{}, {}}, {{0, 1/2, 1/2}, {0}}, r^4/256], r, t], t, r]
-2 π KelvinKei[0, r]


Bonus: the original integral can in fact be expressed as an appropriate Mellin convolution:

2 π MellinConvolve[BesselJ[0, k], k^2/(1 + k^4), k, r]


Unfortunately, this also returns the normal $G$ function (as with Integrate[]) instead of the more useful (at least in this case) extended $G$ function.

To evaluate at r = 0, take the Limit of the Series expansion

int = Assuming[{r > 0},
Integrate[
Exp[I*k*r*Cos[φ]]/(k^4 + 1)*k, {k, 0, ∞}, {φ,
0, 2 π}]]

(*  (1/2)*Pi*MeijerG[{{}, {}}, {{0, 1/2, 1/2}, {0}}, r^4/256]  *)

approx = Series[int, {r, 0, 1}] // Normal // FullSimplify[#, r > 0] &

(*  (Pi*(3456*Pi - r^2*(6*EulerGamma*(-576 + r^4) +
864*(4 + Log) + r^4*(-11 + Log)) +
3456*r^2*Log[r]))/6912  *)


approx is also undefined at r = 0 due to the Log[r]

Plot[{int, approx}, {r, 0, 2.8},
PlotStyle -> {Automatic, Dashed},
PlotLegends -> {"int1", "approx"}] Limit[approx, r -> 0]

(*  Pi^2/2  *)


which has an approximate numeric value of

% // N

(*  4.9348  *)

• Thank you, Bob, I've understand this approach. Could you explain, why Mma returns the result in the rather complex and uncommon form of the Meijer function, rather than in a more simple form of the Kelvin kei? – Alexei Boulbitch Sep 20 '16 at 8:03
• @AlexeiBoulbitch - Presumably the Meijer function is the form that an internal highly generalized algorithm returns and it doesn't have a simplification or FunctionExpand rule for that specific case. – Bob Hanlon Sep 20 '16 at 14:56