# Integration of $\int_0^{\pi} \cos^2(\theta) \cos(a \sin(\theta+b))\, \mathrm d\theta$

I'm interested in integrating

\begin{equation*} \int_0^{\pi} \cos^2(\theta) \cos(a \sin(\theta+b))\, \mathrm d\theta, \quad a, b \in \mathbb{R} \backslash \left\{0 \right\} \end{equation*} I was wondering if there are any clever tricks for dealing with such an integral. I am capable of finding a series solution, but it isn't ideal for my situation and rather messy to expand $\sin^n(\theta+b)$ in any case. Any help would be greatly appreciated.

• If it helps,you can use $\cos(a)\cos(b)=\frac{1}{2}(\cos(a-b)+\cos(a+b))$. – Adrian Sep 22 '17 at 21:51
• Another thing is to rewrite the integral as $\displaystyle \int_{0}^{\frac{\pi}{2}} \text{that product}d\theta$+ $\displaystyle \int_{\frac{\pi}{2}}^{\pi} \text{that product}d\theta$. Now for the first integral you make the substitution $t=\frac{\pi}{2}-x$ and you will get something like $\sin^2(\theta)$. But if you add the one with $\cos^2$ and the one with $\sin^2$, the only thing that remains is $\cos(a\sin(\theta+b))$. From here I think it is easier. – Adrian Sep 22 '17 at 22:10
• For the record, that integral is equal to $(\pi/2)[J_0(a) + J_2(a)\cos(2b)]$. I don't have a proof of this, but Mathematica assures me it is. – eyeballfrog Sep 22 '17 at 22:10
• For the second integral the substitution $t=x-\frac{\pi}{2}$ because now your limits are $0$ and $\frac{\pi}{2}.$ – Adrian Sep 22 '17 at 22:18
• @Adrian Note that that changes $\sin(\theta + b)$ to $\cos(\theta+b)$. – eyeballfrog Sep 22 '17 at 22:20

Whenever you see an integrand with trig functions of trig functions, there's probably going to be Bessel functions. Although there are several equivalent forms of the Bessel integral, the most common one is $$\pi J_n(z) = \int_0^{\pi}\cos(n\theta-z\sin\theta)d\theta.$$ So let's try to make integrals of that form.
First, note that the integrand has period $\pi$, and the integral is over a full period. This means we can translate the integral however we want as long as it's still over an interval of length $\pi$. So let's turn $\sin(\theta + b)$ into $\sin\theta$. \begin{multline} \int_0^\pi \cos^2\theta\cos(a\sin(\theta + b))d\theta = \int_{0}^{\pi} \cos^2\left(\theta -b\right)\cos(a\sin\theta)d\theta \\ = \frac{1}{2}\int_{0}^{\pi} \left[1 + \cos(2\theta)\cos(2b)+\sin(2\theta)\sin(2b)\right]\cos(a\sin\theta)d\theta \\ = \frac{1}{2}\int_0^\pi \cos(-a\sin\theta)d\theta + \frac{\cos(2b)}{2}\int_0^\pi\cos(2\theta)\cos(a\sin\theta)d\theta, \end{multline} where the $\sin$ terms can be seen to drop out by parity considerations.
So far so good. The first term is in the desired form, and is thus equal to $(\pi/2)J_0(a)$. For the second one, we have \begin{multline} \int_0^\pi\cos(2\theta)\cos(a\sin\theta)d\theta = \int_0^\pi[\cos(2\theta-a\sin\theta) - \sin(2\theta)\sin(a\sin\theta)]d\theta \\ = \pi J_2(a) - \int_0^\pi \sin(2\theta)\sin(a\sin\theta)d\theta \end{multline} This second term can be seen to be zero from the fact that \begin{multline} \int_0^\pi \sin(2\theta)\sin(a\sin\theta)d\theta = \int_0^\pi\sin(2\pi - 2\theta)\sin(a\sin(\pi - \theta))d\theta \\= -\int_0^\pi \sin(2\theta)\sin(a\sin\theta)d\theta. \end{multline} Putting it all together then gives $$\int_0^\pi \cos^2\theta\cos(a\sin(\theta + b))d\theta = \frac{\pi}{2}\left[J_0(a) + J_2(a)\cos(2b)\right]$$