3
$\begingroup$

I am trying to integrate a product of Bessel functions as shown below. Where z is real valued and positive.

The integration yields MeijerG functions. Taking a ratio of the derivative of the MeijerG function to the original function does not yield correct results in some cases (see the function f[z]).

Any idea what's going on here?

f[z_] := BesselJ[1, z] BesselY[2, z] ;
(*  Edit : Originally I wrote g[z_] := BesselJ[0, z] BesselY[2, z]; which also is buggy and is what is used in the answer to this question   *)
g[z_] := BesselJ[2, z] BesselY[2, z];
(*Integration of functions over z*)
temp1 = Integrate[f[z], z]
temp2 = Integrate[g[z], z]
(*
-(MeijerG[{{1/2}, {-(1/2), 1}}, {{0, 0, 2}, {-1, -(1/2)}}, z, 1/2]/(
 2 Sqrt[\[Pi]]))

-(MeijerG[{{1, 1}, {-1, 1/2}}, {{-(1/2), 3/2, 3/2}, {-1, -(1/2), 0}}, 
  z, 1/2]/(2 Sqrt[\[Pi]]))

*)
(************)
(*Now take the ratio of derivative of the MeijerG Function too the original function. 
This should evaluate to 1 if the results match*)

(*Numerically this does not match*)
Table[
 D[temp1, z]/(f[z]) /. {z -> RandomReal[{0.1, 10}]}, {i, 1, 3}]
(*Numerically this does match*)
Table[
 D[temp2, z]/(g[z]) /. {z -> RandomReal[{0.1, 10}]}, {i, 1, 3}]

(*
{0.0759936, 0.257989, 0.387316}

{1, 1, 1}
*)

$\endgroup$
  • $\begingroup$ I think this is a bug. Or at least a limitation. $\endgroup$ – Michael E2 Oct 16 at 3:33
3
$\begingroup$

Both answers are wrong. Here are the correct answers: The first integral temp1 is off by Log[z]/Pi, the second one by 2/(Pi z). But, you know, integration is hard. Have pity. But it should be reported to WRI.

Plot[D[-Log[z]/Pi + temp1, z] - f[z] // Evaluate, {z, 1/10, 10}, 
 WorkingPrecision -> 16]

enter image description here

Plot[D[2/(Pi z) + temp2, z] - g[z] // Evaluate, {z, 1/10, 10}, 
 WorkingPrecision -> 16]

enter image description here

| improve this answer | |
$\endgroup$
  • $\begingroup$ Thanks! I reported this bug. I originally wrote g[z_] := BesselJ[2, z] BesselY[2, z]; in my code which gave correct results. Made the edit in the original post. Also can I ask how you were able to find/guess what was off with the results, i.e. how were you able find that "The first integral temp1 is off by Log[z]/Pi". From your plots I can see that you verified this. $\endgroup$ – user75220 Oct 16 at 18:59
  • $\begingroup$ @user75220 I played with plotting f[z] and the derivative of temp1, which look like they differ by a simple function, and made a blind guess. Neither FullSimplify nor MeijerGReduce would verify the result, so I resorted to numerical verification. $\endgroup$ – Michael E2 Oct 16 at 22:08

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.