TITLE: What is the integral of $e^{\cos x}$
QUESTION [13 upvotes]: Question:

Find out $\displaystyle{\int e^{\cos x}~dx}$.

My Attempt:
Let $\cos x = y$. Hence $-\sin x\ dx = dy$ or $$dx = \displaystyle{\frac{-dy}{\sin x}=\frac{-dy}{\sqrt{1-\cos^2x}}=\frac{-dy}{\sqrt{1-y^2}}}$$ So
$$\begin{align}\int e^{\cos x}~dx &= \int e^y\left(\frac{-dy}{\sqrt{1-y^2}}\right)\\
&=-\int\frac{e^y}{\sqrt{1-y^2}}~dy
\end{align}$$
This integral is one I can't solve. I have been trying to do it for the last two days, but can't get success. I can't do it by parts because the new integral thus formed will be even more difficult to solve. I can't find out any substitution that I can make in this integral to make it simpler. Please help me solve it. Is the problem with my first substitution $y=\cos x$ or is there any other way to solve the integral $\displaystyle{\int\frac{e^y}{\sqrt{1-y^2}}~dy}$?

REPLY [2 votes]: This indefinite integral has no closed form $$I(x)=\int_0^xe^{\cos(t)}dt$$
The usual expansions of $ I (x) $ are generally obtained by expanding $ e ^ x $ and integrating $ \int \cos ^ \alpha (x) dx $, thus obtaining a series in terms of the hypergeometric function. Since I am not very familiar with the hypergeometric function, I will show you first how it is possible to express $I (x)$ in Taylor series and then I will show you how it is possible to decompose the hypergeometric function in a more familiar way
Applying the Faà di Bruno's formula for the composite function $f(x)=\exp(\cos(x))$ we can show that $f^{(2n+1)}(0)=0$ and $f^{(2n)}(0)$ are the number of partitions of a $2n$-set into even blocks A005046 therefore we can express $f (x)$ with the following taylor series:
$$\frac{e^{\cos(x)}}{e}=1+\sum_{n=1}^{\infty} (-1)^n\Bigg(\sum_{k=1}^{2n}\sum_{h=0}^{k-1}\frac{(-1)^h(h-k)^{2n}}{2^{k-1}k!}\binom{2k}{h} \Bigg)\frac{x^{2n}}{(2n)!}$$

$$\frac{1}{e}\int_0^xe^{\cos(t)}dt=x+\sum_{n=1}^{\infty} (-1)^n\Bigg(\sum_{k=1}^{2n}\sum_{h=0}^{k-1}\frac{(-1)^h(h-k)^{2n}}{2^{k-1}k!(2n+1)!}\binom{2k}{h} \Bigg)\frac{x^{2n+1}}{(2n)!}$$


We can add to the answer of the user @Turing the following expression to transform the indefinite integral $\int \cos(x)^kdx$ into a definite integral, very easy to calculate numerically: by the integral expression of the hypergeometric function
$$_2F_1\left(a,b;c;z\right)=\frac{\Gamma(c)}{\Gamma(b)\Gamma(c-b)}\int_0^1 \frac{t^{b-1}(1-t)^{c-b-1}}{(1-t z)^a}dt$$

$$\int_0^x e^{\cos(t)}dt =2(-1)^{\lfloor x/\pi\rfloor}\cos(x)\sum_{k=0}^\infty \frac{ \cos(x)^{k}}{k!}\int_0^1\frac{t^{k/2}}{\sqrt{t(t \cos(x)^2)-1}}dt$$

Or using the series expansion of the hypergeometric function:
$$_2F_1\left(a,b;c;z\right)=\sum_{h=0}^\infty \frac{\Gamma(a+h)\Gamma(b+h)\Gamma(c)}{\Gamma(a)\Gamma(b)\Gamma(c+h)} \frac{z^h}{h!}$$
$$\frac{\Gamma(\frac{1}{2}+h)\Gamma(\frac{k+1}{2}+h)\Gamma(\frac{k+3}{2})}{\Gamma(\frac{1}{2})\Gamma(\frac{k+1}{2})\Gamma(\frac{k+3}{2}+h)}=\frac{(1+k)\Gamma\left(h+\frac{1}{2}\right)}{(1+k+2h)\sqrt{\pi}}=\frac{(1+k)(2h)!}{4^{h}(1+k+2h)h!} $$
$$_2F_1\left(\frac{1}{2},\frac{k+1}{2};\frac{k+3}{2};\cos(x)^2\right)=\sum_{j=0}^\infty \frac{(1+k)(2j)!}{4^{j}(1+k+2j)j!} \frac{\cos(x)^{2j}}{j!}=\sum_{j=0}^\infty \frac{(1+k)}{4^{j}(1+k+2j)} \binom{2j}{j}\cos(x)^{2j}$$
$$\int \cos(x)^k dx=(-1)^{\lfloor x/\pi\rfloor+1}\sum_{h=0}^\infty \frac{1}{4^{h}(1+k+2h)} \binom{2h}{h}\cos(x)^{1+k+2h}+c$$

$$\int e^{cos(x)}dx=(-1)^{\lfloor x/\pi\rfloor+1}\sum_{k=0}^{\infty}\sum_{h=0}^\infty \frac{\binom{2h}{h}}{4^{h}(1+k+2h)k!} \cos(x)^{1+k+2h}+c$$