Incorrect results for elementary integrals when using Integrate
An experimental internal function Integrate`InverseIntegrate
helps here, although it's intended more for integrands involving logs. This is what it returns in the development version:
Integrate`InverseIntegrate[Exp[-x Cosh[t]], {t, 0, Infinity}, Assumptions -> Re[x] > 0]
(* BesselK[0, x] *)
For those who are interested, what Integrate`InverseIntegrate
seems to do is to try various substitutions of the form u == g[x]
, where g[x]
is an expression in the integrand. Here is a function that can make such substitutions in an integral.
ClearAll[sub];
SetAttributes[sub, HoldFirst];
sub[Integrate[f_, {x_, a_, b_}, opts___?OptionQ], g_] :=
Module[{xx, u, inv},
inv = Simplify[
InverseFunction[Function[xx, ConditionalExpression[g /. x -> xx, a < xx < b]]][u]
];
Integrate[(f /. x -> inv) * D[inv, u],
{u,
Limit[g, x -> 0, Direction -> -1],
Limit[g, x -> Infinity, Direction -> 1]},
opts] /; FreeQ[inv, InverseFunction]
]
Applied to a couple of the OP's examples:
sub[Integrate[Exp[-x Cosh[r]], {r, 0, Infinity}, Assumptions -> Re[x] > 0], Cosh[r]]
(* BesselK[0, x] *)
sub[Integrate[Cos[-x Sinh[t]], {t, 0, Infinity}, Assumptions -> x ∈ Reals], Sinh[t]]
(* BesselK[0, Abs[x]] *)
The integrand Exp[-x Cosh[t]] Cosh[a t]
seems beyond the reach of this sort of stratagem.