# Problems with definite integral

By using Mathematica, I obtain the result

$$\int_0^\infty e^{-2x}(e^x + a)(e^x + b)J_0(x)dx = 1 + \frac{a}{\sqrt{2}} + \frac{b}{\sqrt{2}} + \frac{ab}{\sqrt{5}}$$

which agrees with integration tables. However, when I try to compute

f1[k_] := (Exp[k] + 1)*(Exp[k] + 3)/(Exp[2*k] - 3);
Integrate[f1[k]* BesselJ[0, k], {k, 0, Infinity}]


then I get the error message that the integral does not converge on $$(0, \infty)$$. I can't see why the integral wouldn't converge when adding the -3 term to the exponential in the denominator, or maybe it is a bug. If the latter is the case, how can I solve it?

• Adding the -3 in the denominator creates a singularity at x=Log[3]/2. See Plot[f 1[k], {k, 0, 3} ] Commented Apr 17, 2020 at 1:02
• OTOH, you can (numerically) evaluate a Cauchy principal value: NIntegrate[(Exp[k] + 1) (Exp[k] + 3)/(Exp[2 k] - 3) BesselJ[0, k], {k, 0, Log[3]/2, Infinity}, Method -> PrincipalValue] Commented Apr 17, 2020 at 3:29

Re : "I can't see why the integral wouldn't converge when adding the -3 term to the exponential in the denominator". You didn't add it to the exponent; if you do, there is no problem.

Clear["Global*"]

f1[k_] := (Exp[k] + a)*(Exp[k] + b)/Exp[2*k - c];

int = Integrate[f1[k]*BesselJ[0, k], {k, 0, Infinity}]

(* (1 + b/Sqrt[2] + a (1/Sqrt[2] + b/Sqrt[5])) E^c *)

int /. {a -> 1, b -> 1, c -> 3}

(* (1 + Sqrt[2] + 1/Sqrt[5]) E^3 *)
`