4
$\begingroup$

Mathematica is unable to produce a result for the following definite integral:

$$\int\limits_{0}^{\infty}\cos{(x \sinh{t})} \ dt$$

Integrate[Cos[x Sinh[t]], {t, 0, Infinity}]

However, this is a standard integral of the form BesselK[0, x], the modified Bessel function of the second kind. Is Mathematica unaware of this definition?

$\endgroup$
4
  • $\begingroup$ Could you put the command as code that can be copied. $\endgroup$ Commented May 11, 2018 at 15:18
  • 2
    $\begingroup$ It seems to be aware of the equivalent integral representation Integrate[Cos[x t]/Sqrt[t^2 + 1], {t, 0, Infinity}, Assumptions -> x \[Element] Reals], which returns BesselK[0, Abs[x]]. Mathematica only "knows" the special integrals that it was taught... $\endgroup$
    – MarcoB
    Commented May 11, 2018 at 15:34
  • 1
    $\begingroup$ If you add the assumption that x in Reals, then you get the message: Integrate::idiv: Integral of Cos[x Sinh[t]] does not converge on {0,[Infinity]}. $\endgroup$
    – bill s
    Commented May 11, 2018 at 15:51
  • $\begingroup$ Related: mathematica.stackexchange.com/q/4728/1871 (Notice the posts linked to this one. ) $\endgroup$
    – xzczd
    Commented May 12, 2018 at 3:24

2 Answers 2

8
$\begingroup$

Workaround:

func=Cos[x*Sinh[t]];    

InverseMellinTransform[Integrate[MellinTransform[func, x, s], {t, 0, Infinity}, 
Assumptions -> 0 < s < 1], s, x]

(* BesselK[0, x] *)

FourierCosTransform[Integrate[FourierCosTransform[func, x, s], {t, 0, Infinity}, 
Assumptions -> s > 0], s, x]

(* BesselK[0, x] *)

Summary: Obviously nothing's foolproof.

$\endgroup$
7
$\begingroup$

You can try dumb substitutions:

Integrate[
 Cos[x Sinh[t]] Dt[t] /. First@Solve[x Sinh[t] == u, t, Reals] /. {Dt[u] -> 1, Dt[x] -> 0},
 {u, 0, ∞}, Assumptions -> x > 0]
(*  BesselK[0, x]  *)

The above converts the integral to almost the same as in @MarcoB's comment.

Here's a general function to do the above more or less automatically:

ClearAll[trydumbsubs];
SetAttributes[trydumbsubs, HoldAll];
trydumbsubs[Integrate[f_, {t_, a_, b_}, Assumptions -> hyp_]] :=
  Module[{subs, sub, res = $Failed},
   subs = SortBy[
      DeleteCases[DeleteDuplicates@Cases[f, (g_)[arg_] :> arg, {0, Infinity}], t],
      -LeafCount[#] &];
   Do[
     sub = Solve[arg == u, t, Reals];
     If[ListQ[sub],
      res = Integrate[
        f*Dt[t] /. First@sub /. {Dt[u] -> 1, _Dt -> 0},
        {u, Limit[arg, t -> a, Assumptions -> hyp], 
         Limit[arg, t -> b, Assumptions -> hyp]},
        Assumptions -> hyp
        ],
      res = $Failed];
     If[FreeQ[res, Integrate | $Failed],
      Return[res]
      ],
     {arg, subs}];
   res /; FreeQ[res, Integrate | $Failed]
   ];

OP's example:

trydumbsubs@ Integrate[Cos[x Sinh[t]], {t, 0, Infinity}, Assumptions -> x > 0 && t > 0]
(*  BesselK[0, x]  *)
$\endgroup$
2
  • $\begingroup$ I tried yours code for general function(automata) and dosen't work ? $\endgroup$ Commented May 12, 2018 at 8:39
  • $\begingroup$ @MariuszIwaniuk Dumb editing mistake. Fixed now, I think. Thanks. $\endgroup$
    – Michael E2
    Commented May 12, 2018 at 11:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.