# Closed Form of Integration [duplicate]

I have tried this integral in Mathematica,

Assuming[m > 0,Integrate[Cos[m k] Exp[ Cos[k]], {k, 0, 2 Pi}]]


And Mathematica failed to perform this. Whereas if any value of m is declared then it is showing the result in terms of Modified Bessel Function. I want to know the reason why Mathematica can not perform the integral in the general term of m, but performing this integral when the value of m is declared.

• For fixed m I get a result, for example Integrate[Cos[3 k] Exp[Cos[k]], {k, 0, 2 Pi}] (* 2 \[Pi] BesselI[3, 1] *) Sep 24 at 7:35
• But Integrate[Cos[3/2* k] Exp[Cos[k]], {k, 0, 2 Pi}] gives a result of zero. So the general formula with the Bessel function probably only applies to integers. Sep 24 at 7:43
• Integrate[Cos[17*k] Exp[Cos[k]], {k, 0, 2 *Pi}] performs $$2 \pi (183252363823720801 I_1(1)-762935687373888144 I_2(1)) .$$ Sep 24 at 7:51
• N[2 \[Pi] (183252363823720801 BesselI[1, 1] - 762935687373888144 BesselI[2, 1]), 50] is equal to N[ 2 \[Pi] BesselI[17, 1], 50] Sep 24 at 16:21
• @VaclavKotesovec: That can presumably be proven analytically using the identity $I_{n+1}(z) = \frac{2n}{z} I_n(z) + I_{n-1}(z)$. And Mathematica returns True from FullSimplify[(183252363823720801 BesselI[1, 1] - 762935687373888144 BesselI[2, 1]) == BesselI[17, 1]]. Sep 24 at 17:56

The problem is probably that the formula with the Bessel function only applies to some m and in general it will be more complicated. Take a look at the following graph.
Show[Plot[NIntegrate[Cos[m* k] Exp[Cos[k]], {k, 0, 2 Pi}], {m, 0, 5}, PlotStyle -> Red], Plot[2*Pi*BesselI[m, 1], {m, 0, 5}]] 