# Integrate a Bessel Function K0(a*x) without the constant 'a' ?

Posted 6 days ago
116 Views
|
10 Replies
|
7 Total Likes
|
 Thanks for reading !I am having a problem with the numerical integration of the Bessel functiony = BesselK0(a*x)Since my constant is too large (a = 6800) I am getting the large arguments aproximation for the Bessel K0 function, making the integration difficult.My question is: Is there some mathematical method or manipulation to remove the constant 'a' from the integration likey = BesselK0(x)to make me integrate it like small arguments and then insert the constant 'a' in it somehow after ?Thank you very much !
Answer
10 Replies
Sort By:
Posted 6 days ago
 Yeah, I think Mathematica has some problems with the integration of Bessel functions. I am trying to somehow avoid the evaluation of the integral in the Cauchy principal value sense by removing the constant and thus making the integral weakly singular. The Large value expression for the Bessel K0 has a series of finite part integrals that Mathematica should have problems solving it. But the small argument expression has only weakly singular integrals. thats why I am trying to somehow remove that constant.Thank you for proving my point !
Answer
Posted 6 days ago
 For this integral, the integrand has odd symmetry, so its principal value is zero.
Answer
Posted 6 days ago
 It's seems a bug is in Integrate command and Yes you are right.  Integrate[BesselK[0, (6632555543 Sqrt[xi^2])/135117312]/xi, {xi, -1, 1}, PrincipalValue -> True](* It should be Zero*) Indefine integral: Integrate[BesselK[0, Sqrt[x^2]]/x, x](*Cant find !*) but: $$\int \frac{K_0\left(\sqrt{x^2}\right)}{x} \, dx=-\frac{1}{4} G_{1,3}^{3,0}\left(\frac{x^2}{4}| \begin{array}{c} 1 \\ 0,0,0 \\ \end{array} \right)+C$$With Cauchy Principal Value:  Limit[((-Inactive[MeijerG][{{}, {1}}, {{0, 0, 0}, {}}, x^2/4]/4 // Activate) /. x -> (-e)) - ((-Inactive[MeijerG][{{}, {1}}, {{0, 0, 0}, {}}, x^2/ 4]/4 // Activate) /. x -> -1) + (((-Inactive[MeijerG][{{}, {1}}, {{0, 0, 0}, {}}, x^2/ 4]/4 // Activate) /. x -> 1) - ((-Inactive[MeijerG][{{}, {1}}, {{0, 0, 0}, {}}, x^2/ 4]/4 // Activate) /. x -> e)), e -> 0, Direction -> -1] (* 0 *) 
Answer
Posted 6 days ago
 This is a singular integral, maybe mathematica is having some problems integrating it ?
Answer
Posted 6 days ago
  func = Rationalize[(Sqrt[(0. + 0.0078125 (1 - xi) + 0.0078125 xi)^2] (-0.0078125 + 0.0078125 (1 - xi) (1 + xi) + 0.0078125 xi (1 + xi)) BesselK[ 0, 6283.185307179586* Sqrt[0. + (-0.0078125 + 0.0078125 (1 - xi) (1 + xi) + 0.0078125 xi (1 + xi))^2]])/(0. + (-0.0078125 + 0.0078125 (1 - xi) (1 + xi) + 0.0078125 xi (1 + xi))^2), 0] // FullSimplify; NIntegrate[func, {xi, -1, 0, 1}, Method -> PrincipalValue] (* 2.52435*10^-29 *) With the Cauchy principal value integral is finite and equal to Zero.
Answer
Posted 6 days ago
 Thank you very much for playing with the integral, yes this one is divergent !! But this is at one node of the problem, I am also dealing with integrals that are not divergent like this one: Integrate[(Sqrt[(0. + 0.0078125*(1 - xi) + 0.0078125*xi)^2]*(-0.0078125 + 0.0078125*(1 - xi)*(1 + xi) + 0.0078125*xi*(1 + xi))* BesselK[0, 6283.185307179586* Sqrt[0. + (-0.0078125 + 0.0078125*(1 - xi)*(1 + xi) + 0.0078125*xi*(1 + xi))^2]])/ (0. + (-0.0078125 + 0.0078125*(1 - xi)*(1 + xi) + 0.0078125*xi*(1 + xi))^2), {xi, -1, 1}] If the correct numerical integration is used, this integral is given = 0. So if the constant is used 6283.185307179586, one need to solve as a cauchy principal value integral, if the constant is small one could solve as a weakly singular integral. I would love to remove that constant from the Bessel Term and then add it somehow after the integration. But Thank you very much for your answer !
Answer
Posted 6 days ago
  func = Rationalize[(Sqrt[(0. + 0.0078125 (1 - xi) + 0.0078125 xi)^2] (-0.015625 + 0.0078125 (1 - xi) (1 + xi) + 0.0078125 xi (1 + xi)) BesselK[0, 6283.185307179586* Sqrt[0. + (-0.015625 + 0.0078125 (1 - xi) (1 + xi) + 0.0078125 xi (1 + xi))^2]])/(0. + (-0.015625 + 0.0078125 (1 - xi) (1 + xi) + 0.0078125 xi (1 + xi))^2), 0] // FullSimplify Integrate[func, {xi, -1, 1}](*Integral is divergent*) Integrate[BesselK[0, 2 Sqrt[(-1 + xi)^2]]/(-1 + xi), {xi, -1, 1}] (*Simplified version.Integral is divergent*) Removing this: '6283.185307179586' large number will not help you at all.
Answer
Posted 6 days ago
 Let me clarify my question:I am using the online paid wolfram alpha.Thank you two for the responses, I am trying to implement a fortran code here to Integrate this bessel function wich is a series of functions that multiply that bessel function, and the online wolfram cannot integrate analitcaly. The true form of the function is: NIntegrate[(Sqrt[(0. + 0.0078125*(1 - xi) + 0.0078125*xi)^2]*(-0.015625 + 0.0078125*(1 - xi)*(1 + xi) + 0.0078125*xi*(1 + xi))* BesselK[0, 6283.185307179586* Sqrt[0. + (-0.015625 + 0.0078125*(1 - xi)*(1 + xi) + 0.0078125*xi*(1 + xi))^2]])/ (0. + (-0.015625 + 0.0078125*(1 - xi)*(1 + xi) + 0.0078125*xi*(1 + xi))^2), {xi, -1, 1}] The constant '6283.185307179586' is the constant 'a' that I said. If it is small, I can integrate it since it has a LOG singularity BY USING GAUSS LOG INTEGRATION. If the constant 'a' is large, I cant integrate it since it has finite part integrals of many orders ( large argument expansion). Is there any mathematical method ( change of variables ?, substitution ? ) that can make me remove this 'a' '6283.185307179586' from the integral ? or make the argument small ?
Answer
Posted 6 days ago
 For large arguments, you might consider looking into the asymptotic expansion of the modified Bessel function (e.g. this one).
Answer
Posted 6 days ago
 Integrate[BesselK[0, a x], x] gives: 1/2 \[Pi] x (BesselK[0,a x] StruveL[-1,a x]+BesselK[1,a x] StruveL[0,a x]) Where you then can plug in the end-pointsâ€¦
Answer
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments