# How to evaluate the integral $\int_0^{2\pi} \theta\exp(x\cos(\theta) + y\sin(\theta))) d\theta$

I found five other related integrals whose proofs I am studying now A, B, C, D, and E

$$\int^{2\pi}_0e^{\cos \theta}\cos(a\theta -\sin \theta)\,d \theta = \frac{2\pi}{a!}$$ $$\int_0^{2\pi} \exp(\cos(\theta)) \cos(\theta + \sin(\theta)) = 0$$ $$\int_0^{2\pi} \exp(\alpha \cos(\theta))\cos(\sin(\theta)) = 2\pi I_0(\sqrt{1 - \alpha^2})$$ $$\int_0^{2\pi} \exp(x\cos(\theta) + y\sin(\theta))) = 2\pi I_0(\sqrt{x^2 + y^2})$$ $$\int_0^\dfrac{\pi}{2}\beta^\alpha\exp\left(-\beta\cos(\theta)\right)d\theta = \dfrac{1}{2}\beta^\alpha\pi\left(J_0(\beta)-L_0(\beta)\right)$$

I was also able to find a very general statement in Gradshteyn as entry number 3.338. $$\int_{-\pi}^{\pi} \frac{\exp{\frac{a + b\sin x + c \cos x}{1 + p \sin x + q \cos x}}}{1 + p \sin x + q \cos x} dx = \frac{2\pi e^{-\alpha}I_0(\beta)}{\sqrt{1 - p^2 - q^2}}$$ $$\textrm{where } \alpha = \frac{bp + cq -a}{1 - p^2 - q^2},\; \beta = \sqrt{\alpha^2 - \frac{a^2 - b^2 - c^2}{1 - p^2 - q^2}}$$

But the simplest approach of using integration by parts to reduce my problem to one of these does not work.

Background Here's some background into why I am interested in this integral, let $v = [x, y] \in \mathbb{R}^2$ and $r = [\cos(\theta), \sin(\theta)] \in \mathbb{R}^2$, Consider the value of $$\underset{\theta \tilde{} \textrm{Hill}}{E}[\exp(v^Tr)]$$ This is the expected value of exponential of the projection of a random vector chosen using the Hill distribution, where the "Hill" is an unnormalized distribution that linearly increases from $0$ at $-\pi$ to $1$ at $0$ and then decreases linearly from $0 \textrm{ to } \pi$. Discarding normalizing factor of Hill, This expectation will become:

$$\int_{-\pi}^{0} (\theta + \pi)\exp(x\cos\theta + y\sin\theta) d\theta + \int_{0}^{\pi} (\pi - \theta) \exp(x\cos\theta + y\sin\theta) d\theta$$

Now, there are simplifying unnormalized distributions I could assume in my model, instead of Hill, such as Uniform from 0 to $2\pi$, or $\exp(\cos(\theta))$ both of these distribution allow analytical calculation of the above expectation just based on the identities written below, but I want to know which distributions I can compute this expectation for (Can I do this for Hill?) I will guess that I can only do it for distributions that have some finite decomposition in terms of spherical harmonics. Unfortunately, my knowledge is lacking in complex analysis and spherical harmonics so I can't quickly assess my options.

• $\theta$ showing up outside the exponentials and trigs don't give me much hope that there's a tidy closed form. – J. M. is a poor mathematician Jan 21 '17 at 5:23

## 1 Answer

Not hard to see that \begin{align*} \int_0^{2 \pi } \theta \cdot e^{x \cos \theta +y \sin \theta } \, \mathrm{d}\theta &=\int_{0}^{2\pi }\theta \sum_{k=0}^{\infty }\frac{\left ( x \cos \theta +y \sin \theta \right )^{k}}{k!}\, \mathrm{d}\theta \\ &=\int_{0}^{2\pi }\theta \sum_{k=0}^{\infty }\frac{1}{k!}\sum_{j=0}^{k}\binom{k}{j}y^{j}\sin^{j}\theta x^{k-j}\cos^{k-j}\theta \, \mathrm{d}\theta \\ &=\sum_{k=0}^{\infty }\frac{1}{k!}\sum_{j=0}^{k}\binom{k}{j}y^{j}x^{k-j}\int_{0}^{2\pi }\theta \sin^{j}\theta \cos^{k-j}\theta \, \mathrm{d}\theta \end{align*} For the last integral, with the help of Mathematica we get the following complex result \begin{align*} \int_{0}^{2\pi }\theta \sin^{m}\theta \cos^{n}\theta \, \mathrm{d}\theta =&\frac{(-1)^{m+n} \pi ^2 \csc \left(\frac{n \pi }{2}\right) \csc \left(\frac{\pi m}{2}+\frac{n \pi }{2}\right) \Gamma \left(\frac{n}{2}+\frac{1}{2}\right)}{4 \Gamma \left(\frac{1}{2}-\frac{m}{2}\right) \Gamma \left(\frac{m}{2}+\frac{n}{2}+1\right)}+\frac{\pi ^2 \csc \left(\frac{n \pi }{2}\right) \csc \left(\frac{\pi m}{2}+\frac{n \pi }{2}\right) \Gamma \left(\frac{n}{2}+\frac{1}{2}\right)}{4 \Gamma \left(\frac{1}{2}-\frac{m}{2}\right) \Gamma \left(\frac{m}{2}+\frac{n}{2}+1\right)}\\ &+(-1)^{m+n} 2^{\frac{m}{2}-\frac{1}{2}} \cos \left(\frac{m \pi }{2}\right) \Gamma \left(\frac{m}{2}+\frac{1}{2}\right) \Gamma \left(-\frac{m}{2}-n-\frac{1}{2}\right) \Gamma (n+1) \, _2F_1\left(\frac{1-m}{2},\frac{m+1}{2};\frac{m}{2}+n+\frac{3}{2};\frac{1}{2}\right)\\ &+\frac{(-1)^{m+2 n} 2^{\frac{m}{2}-\frac{1}{2}} \pi \Gamma \left(\frac{m}{2}+\frac{1}{2}\right) \Gamma (n+1) \, _2F_1\left(\frac{1-m}{2},\frac{m+1}{2};\frac{m}{2}+n+\frac{3}{2};\frac{1}{2}\right)}{\Gamma \left(\frac{m}{2}+n+\frac{3}{2}\right)}\\ &+\frac{(-1)^{m+n} \Gamma \left(\frac{n}{2}\right) \Gamma \left(\frac{m}{2}+1\right) \, _3F_2\left(\frac{1}{2},1,\frac{m}{2}+1;\frac{3}{2},1-\frac{n}{2};1\right)}{2 \Gamma \left(\frac{m}{2}+\frac{n}{2}+1\right)}\\ &+\frac{\Gamma \left(\frac{n}{2}\right) \Gamma \left(\frac{m}{2}+1\right) \, _3F_2\left(\frac{1}{2},1,\frac{m}{2}+1;\frac{3}{2},1-\frac{n}{2};1\right)}{2 \Gamma \left(\frac{m}{2}+\frac{n}{2}+1\right)}\\ &+\frac{(-1)^n \Gamma \left(\frac{m}{2}\right) \Gamma \left(\frac{n}{2}+1\right) \, _3F_2\left(\frac{1}{2},1,\frac{n}{2}+1;\frac{3}{2},1-\frac{m}{2};1\right)}{2 \Gamma \left(\frac{m}{2}+\frac{n}{2}+1\right)}\\ &+\frac{(-1)^{m+2 n} \Gamma \left(\frac{m}{2}\right) \Gamma \left(\frac{n}{2}+1\right) \, _3F_2\left(\frac{1}{2},1,\frac{n}{2}+1;\frac{3}{2},1-\frac{m}{2};1\right)}{2 \Gamma \left(\frac{m}{2}+\frac{n}{2}+1\right)}\\ &+\frac{(-1)^n \pi \Gamma \left(\frac{m}{2}+\frac{1}{2}\right) \left(\pi \csc \left(\frac{m \pi }{2}\right) \csc \left(\frac{\pi m}{2}+\frac{n \pi }{2}\right)+\pi \sec \left(\frac{n \pi }{2}\right)\right)}{4 \Gamma \left(\frac{1}{2}-\frac{n}{2}\right) \Gamma \left(\frac{m}{2}+\frac{n}{2}+1\right)}\\ &+\frac{(-1)^{m+2 n} \pi \Gamma \left(\frac{m}{2}+\frac{1}{2}\right) \left(\pi \csc \left(\frac{m \pi }{2}\right) \csc \left(\frac{\pi m}{2}+\frac{n \pi }{2}\right)+\pi \sec \left(\frac{n \pi }{2}\right)\right)}{4 \Gamma \left(\frac{1}{2}-\frac{n}{2}\right) \Gamma \left(\frac{m}{2}+\frac{n}{2}+1\right)}\\ &+\frac{(-2)^{m+n} \pi ^{5/2} \Gamma \left(\frac{m}{2}+\frac{1}{2}\right) \sec \left(\frac{\pi m}{2}+n \pi \right)}{\Gamma \left(\frac{1}{2}-\frac{n}{2}\right) \Gamma \left(-\frac{m}{2}-\frac{n}{2}+\frac{1}{2}\right) \Gamma (m+n+1)} \end{align*} Looking at this horrible result, If I'm not doing the wrong way, I don't there will be a closed form for the integral, as least it won't be too short.