3
$\begingroup$
  1. Analytic result Integrate[x BesselK[0, x], {x, 0, x0}] gives the result of -1 - x0 BesselK[1, x0], for positive x0. If Let x0 = 0.001, result = -2.
  2. Numerical integration NIntegrate[x BesselK[0, x], {x, 0, 0.001}],the result is 3.76184*10^-6

One would expect the result should be > 0. Thus, the numerical result seems to be right. Is the analytic result wrong?

$\endgroup$
  • $\begingroup$ "...for positive x0" implies you should use the option ``Assumptions -> x0 > 0` in Integrate. $\endgroup$ – Michael E2 Aug 8 '17 at 3:36
2
$\begingroup$

M11 seems inconsistent.

$Assumptions =.

Integrate[x BesselK[0, x], {x, 0, x0}]

ConditionalExpression[-x0 Subscript[K, 1](x0)-1,Re(x0)>0\[And]Im(x0)==0]

Simplify[%, x0 > 0]

-x0 BesselK[1, x0] - 1

Compare with

$Assumptions = x0 > 0

Integrate[x BesselK[0, x], {x, 0, x0}]

1 - x0 BesselK[1, x0]

However, M8 just works.

$\endgroup$
  • $\begingroup$ 10.1 has this bug too. FWIW you only need to specify the assumption that x0 is real to get the correct conditional expression. $\endgroup$ – george2079 Nov 6 '17 at 22:52
1
$\begingroup$

If

Integrate[x BesselK[0, x], x]
(* -x BesselK[1, x] *)

Limit[-x BesselK[1, x], x -> 0]
(* -1 *)

then Integrate[x BesselK[0, x], {x, 0, x0}] = -x0 BesselK[1, x0] - (-1) and

(-x BesselK[1, x] /. x -> 1/1000) - (-1) // N
(* 3.76184*10^-6 *)

Instead Mathematica gives:

Integrate[x BesselK[0, x], {x, 0, x0}]
(*  ConditionalExpression[-1 - x0 BesselK[1, x0], Re[x0] > 0 && Im[x0] == 0] *)

which seems incorrect.

$\endgroup$
  • 3
    $\begingroup$ However, Assuming[x0 > 0, Integrate[x BesselK[0, x], {x, 0, x0}]] /. x0 -> 0.001 works as expected. $\endgroup$ – Bob Hanlon Jun 8 '17 at 18:33

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.