Mathematica Asked by user75220 on April 18, 2021
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}
*)
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]
Plot[D[2/(Pi z) + temp2, z] - g[z] // Evaluate, {z, 1/10, 10},
WorkingPrecision -> 16]
Correct answer by Michael E2 on April 18, 2021
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP