# Integration with Bessel function

I know that the integration of:

IntegrateInverseIntegrate[Exp[-x Cosh[t]], {t, 0, Infinity},
Assumptions -> Re[x] > 0]


is:

BesselK[0, x].


I would like to integrate the following expression, using the same procedure:

IntegrateInverseIntegrate[Exp[-x Cosh[t] - t], {t, 0, Infinity},
Assumptions -> Re[x] > 0]


The integration fails.

The result should be:

BesselK[1, x]-Exp[-x]/x


What can I do?

• what does IntegrateInverseIntegrate supposed to do? Where is this function documented? How can one answer this without knowing what does IntegrateInverseIntegrate mean? I do not see it documented anywhere? It helps if you explain more what this is supposed to do. Oct 10, 2016 at 15:25
• In principle I want only to integrate. For this I found the following link: mathematica.stackexchange.com/questions/4728/…. Integrate[Exp[-x Cosh[t]], {t, 0, Infinity}]does not solve. 
– mrz
Oct 10, 2016 at 16:39
– mrz
Oct 10, 2016 at 16:46
• thanks, I did ?Integrate* before, but it only gave !Mathematica graphics which did not say much about what this is supposed to do, that is why I asked ;) Oct 10, 2016 at 22:32
• Of course, I meant I added a little explanation to (4728), but dyslexia struck. Oct 10, 2016 at 23:10

The internal function IntegrateInverseIntegrate[] tries what I call the "obvious" substitutions, namely, u == g[x], where g[x] appears as the argument to a function in the expression being integrated. The problem here is that Power automatically combines the product

Exp[-x Cosh[t]] * Exp[-t]


into a single power. If we try TrigToExp@Exp[-x Cosh[t] - t], we again cannot separate out the Exp[-t] from the integrand. Even if we enter

TrigToExp@Exp[-x Cosh[t]] Exp[-t]
(*  E^(-t - 1/2 (E^-t + E^t) x) *)


the factor Exp[-t] is combined with the other factor. This keeps IntegrateInverseIntegrate[] from identifying u = Exp[t] + Exp[-t] as the substitution to try.

The substitution @mrz shows, u == Exp[-t] is tried by IntegrateInverseIntegrate[], and it gets one step from the solution, by using IntegrateInverseIntegrate[] again. But IntegrateInverseIntegrate[] is applied only once, so it fails. In fact, after the first substitution, IntegrateInverseIntegrate is set equal to $Failed &, preventing any further application of it. Here's a way to get Mathematica to try two applications of IntegrateInverseIntegrate[]. Basically, we make a copy of it, and have Integrate call it under suitable conditions. ClearAll[int]; DownValues[int] = DownValues[IntegrateInverseIntegrate] /. IntegrateInverseIntegrate -> int; InternalInheritedBlock[{Integrate}, Unprotect[Integrate]; Integrate[i_, {x_, a_, b_}, stuff___] /; ! TrueQ[$in] :=
Block[{$in = True, res}, If[FreeQ[{stuff}, ConditionalInertUndefined | ConditionalExpression], If[a < b, res = int[i, {x, a, b}, stuff], res = int[-i, {x, b, a}, stuff] ], res =$Failed
];
If[FreeQ[res, \$Failed],
res,
Integrate[i, {x, a, b}, stuff]
]];
Protect[Integrate];
Assuming[Re[x] > 0,
IntegrateInverseIntegrate[
TrigToExp@Exp[-x Cosh[t] - t], {t, 0, Infinity},
Assumptions -> Re[x] > 0]
]]

(*  (E^-x (-1 + E^x x BesselK[1, x]))/x  *)


Here's a way to do the substitution manually and use Integrate[] instead of IntegrateInverseIntegrate[]:

Assuming[Re[x] > 0 && t > 0 && u > 2,
TrigToExp[Exp[-x Cosh[t] - t] Dt[t] /.            (* integrand *)
First@Solve[2 Cosh[t] == u && t > 0, t]] /.   (* substitution *)
_Dt -> 1 // Simplify];
(Numerator[%] (u - Sqrt[-4 + u^2])) /               (* rationalize, in part *)
Expand[Denominator[%] (u - Sqrt[-4 + u^2])]
(*  (E^(-((u x)/2)) (u - Sqrt[-4 + u^2]))/(2 Sqrt[-4 + u^2])  *)

Integrate[%, {u, 2, Infinity}, Assumptions -> Re[x] > 0]
(*  -(E^-x/x) + BesselK[1, x]  *)


For some reason, Integrate[] cannot solve the unrationalized expression.

Consider just what's under the integral

Exp[-x*Cosh[t]-t]dt
= Exp[-x*Cosh[t]]*Exp[-t]dt
= Exp[-(x/2)*(Exp[-t]+Exp[t])]*Exp[-t]dt


Now, make the u substitution

u=Exp[-t]
du=-Exp[-t]dt


Thus, the Integrand is

-Exp[-(x/2)*(u+1/u)]du


and the integral runs from 1 to 0. We can then flip the limits of integration and eliminate the minus sign out front. With the integral in this form, we can get the desired result.

IntegrateInverseIntegrate[Exp[-(x/2)*(u + 1/u)], {u, 0, 1},
Assumptions -> Re[x] > 0]

(E^-x (-1 + E^x x BesselK[1, x]))/x


Using FullSimplify, we get the result in the form you are looking for.

FullSimplify[%]

-(E^-x/x) + BesselK[1, x]