integration of exp(cos(x-a)) dx I would like to compute either of the following integrals:
$$\int e^{\cos(x-a)} \, dx$$
or
$$\int_{-\pi}^{\pi} e^{\cos(x-a)} \, dx$$
In both cases, $a$ is a constant.
MATLAB doesn't seem to be helpful with either.
 A: The integrand is periodic, with period $2\pi$, so the second one is independent of $a$.  In fact
$$
\int_{-\pi}^\pi e^{\cos(x-a)}\,dx = 2\pi I_0(1) \approx 7.9549
$$
where $I_0$ is a certain Bessel function.
In the integral form for $I_\alpha(x)$ given on that page, put $x=1$ and $\alpha=0$.
A: For $\int e^{\cos(x-a)}~dx$ ,
$\int e^{\cos(x-a)}~dx$
$=\int\sum\limits_{n=0}^\infty\dfrac{\cos^{2n}(x-a)}{(2n)!}dx+\int\sum\limits_{n=0}^\infty\dfrac{\cos^{2n+1}(x-a)}{(2n+1)!}dx$
$=\int\left(1+\sum\limits_{n=1}^\infty\dfrac{\cos^{2n}(x-a)}{(2n)!}\right)dx+\int\sum\limits_{n=0}^\infty\dfrac{\cos^{2n+1}(x-a)}{(2n+1)!}dx$
For $n$ is any natural number,
$\int\cos^{2n}(x-a)~dx=\dfrac{(2n)!x}{4^n(n!)^2}+\sum\limits_{k=1}^n\dfrac{(2n)!((k-1)!)^2\sin(x-a)\cos^{2k-1}(x-a)}{4^{n-k+1}(n!)^2(2k-1)!}+C$
This result can be done by successive integration by parts.
For $n$ is any non-negative integer,
$\int\cos^{2n+1}(x-a)~dx$
$=\int\cos^{2n}(x-a)~d(\sin(x-a))$
$=\int(1-\sin^2(x-a))^n~d(\sin(x-a))$
$=\int\sum\limits_{k=0}^nC_k^n(-1)^k\sin^{2k}(x-a)~d(\sin(x-a))$
$=\sum\limits_{k=0}^n\dfrac{(-1)^kn!\sin^{2k+1}(x-a)}{k!(n-k)!(2k+1)}+C$
$\therefore\int\left(1+\sum\limits_{n=1}^\infty\dfrac{\cos^{2n}(x-a)}{(2n)!}\right)dx+\int\sum\limits_{n=0}^\infty\dfrac{\cos^{2n+1}(x-a)}{(2n+1)!}dx$
$=x+\sum\limits_{n=1}^\infty\dfrac{x}{4^n(n!)^2}+\sum\limits_{n=1}^\infty\sum\limits_{k=1}^n\dfrac{((k-1)!)^2\sin(x-a)\cos^{2k-1}(x-a)}{4^{n-k+1}(n!)^2(2k-1)!}+\sum\limits_{n=0}^\infty\sum\limits_{k=0}^n\dfrac{(-1)^kn!\sin^{2k+1}(x-a)}{(2n+1)!k!(n-k)!(2k+1)}+C$
$=\sum\limits_{n=0}^\infty\dfrac{x}{4^n(n!)^2}+\sum\limits_{n=1}^\infty\sum\limits_{k=1}^n\dfrac{((k-1)!)^2\sin(x-a)\cos^{2k-1}(x-a)}{4^{n-k+1}(n!)^2(2k-1)!}+\sum\limits_{n=0}^\infty\sum\limits_{k=0}^n\dfrac{(-1)^kn!\sin^{2k+1}(x-a)}{(2n+1)!k!(n-k)!(2k+1)}+C$
