# Integrating $\int\limits_{-\pi/2}^{\pi/2}e^{a\sin(x)}\cos^2(x)\,\mathrm{d}x$

Calculate the integral $$\int\limits_{-\pi/2}^{\pi/2}e^{a\sin(x)}\cos^2(x)\,\mathrm{d}x$$

We can use the Beta Integral: \begin{align*} \int\limits_{-1}^1x^{2n}\sqrt{1-x^2}\,\mathrm{d}x=\int\limits_0^1x^{n-1/2}\sqrt{1-x}\,\mathrm{d}x&=\frac{\Gamma\!\left(n+\frac12\right)\Gamma\!\left(\frac32\right)}{\Gamma(n+2)}\\ &=\frac\pi2\frac{(2n)!}{2^n2^nn!(n+1)!} \end{align*} along with the series for $$e^{ax}$$ to get: \begin{align*} \int\limits_{-\pi/2}^{\pi/2}e^{a\sin(x)}\cos^2(x)\,\mathrm{d}x=\int\limits_{-\pi/2}^{\pi/2}e^{a\sin(x)}\cos(x)\,\mathrm{d}\sin(x)&=\int\limits_{-1}^1e^{au}\sqrt{1-u^2}\,\mathrm{d}u\\ &=\frac\pi2\sum_{k=0}^\infty\frac{a^{2n}}{2^{2n}n!(n+1)!} \end{align*} Then the answers is $$\frac\pi{a}I_1(a)$$, where $$I_1$$ is a modified Bessel Function of the First Kind

This is my attempt ... Tungsten does not give an exact result. Can you tell me if I made the right decision or not?

• Note that $I_1(a)=\sum_{k=0}^\infty\frac{a^{2k+1}}{2^{2k+1}k!(k+1)!}$.
– J.G.
Commented Dec 10, 2021 at 16:48

We can use the definition of the modified Bessel function $$I_{\alpha}(x)=\frac{1}{\pi}\int_0^\pi d\theta\,e^{x \cos(\theta)}\cos(\alpha\theta)$$ and notice that $$\cos^2(\theta)=\frac{\cos(2\theta)+1}{2}$$ combined with $$\frac{1}{\pi}\int_0^\pi d\theta\,e^{x \cos(\theta)}\cos(\alpha\theta)\overset{\phi=\theta-\frac{\pi}{2}}{=}\frac{1}{\pi}\int_{-\frac{\pi}{2}}^{\frac{\pi}{2}} d\phi\,e^{-x \sin(\phi)}\cos\left(\alpha\bigl(\phi+\frac{\pi}{2}\big)\right),$$ which then gives \begin{align} \int_{-\frac{\pi}{2}}^{\frac{\pi}{2}}d\theta\,e^{x \sin(\theta)}\cos^2(\theta)&=\frac{1}{2}\int_{-\frac{\pi}{2}}^{\frac{\pi}{2}}d\theta\,e^{x \sin(\theta)}\bigl(\cos(2\theta)+1\big)\\&=\frac{\pi}{2}\bigl(-I_2(-x)+I_0(-x)\big). \end{align} Using the recurrence relation $$\frac{2\alpha}{x} I_\alpha(x) = I_{\alpha-1}(x) - I_{\alpha+1}(x)$$ readily gives (with $$\alpha=1$$) the result $$\int_{-\frac{\pi}{2}}^{\frac{\pi}{2}}d\theta\,e^{x \sin(\theta)}\cos^2(\theta)=\frac{\pi}{x}I_1(x).$$

I don't know how you made the last step because in beta function the first term is $$x^{2n}$$ while in the integral you have $$e^{au}$$.

we can use the taylor expansion of $$e^x = \sum_{n=0}^\infty \frac{x^n}{n!}$$ to get $$\int_{-1}^{1} e^{au} \sqrt{1 - u^2} du = \int_{-1}^{1}du \sum_{n=0}^\infty \frac{(au)^n}{n!}\sqrt{1 - u^2} = \sum_{n=0}^\infty \frac{a^n}{n!} \int_{-1}^{1} u^n \sqrt{1 - u^2}du$$

according to wolframalpha the integral $$\int_{-1}^{1} u^n \sqrt{1 - u^2}du = \frac{\sqrt{\pi} ((-1)^n + 1)}{4} \frac{\Gamma{(\frac{n+1}{2})}}{\Gamma{(\frac{n}{2} + 2)}}$$, meaning that for odd $$n$$ the integral is zero and for even $$n$$ (i.e. $$n = 2k$$) it's $$\frac{\sqrt{\pi}}{2} \frac{\Gamma{(\frac{n+1}{2})}}{\Gamma{(\frac{n}{2} + 2)}} = \frac{\sqrt{\pi}}{2} \frac{\frac{(2k)!\sqrt{\pi}}{4^k k!}}{(k + 1)!} = \frac{\pi}{2 \times 4^k}\frac{(2k)!}{(k + 1)!k!}$$

where I used the gamma function identities $$\Gamma{(k + \frac{1}{2})} = \frac{(2k)!\sqrt{\pi}}{4^k k!}, \Gamma{(k)} = (k-1)!$$

putting it together we have $$\sum_{k=0}^\infty \frac{a^{2k}}{(2k)!}\frac{\pi}{2 \times 4^k}\frac{(2k)!}{(k + 1)!k!} = \frac{\pi}{2} \sum_{k=0}^\infty \frac{a^{2k}}{4^k}\frac{1}{(k + 1)!k!} = \frac{\pi}{2} \sum_{n=0}^\infty \frac{a^{2n}}{2^{2n}}\frac{1}{(n + 1)!n!}$$