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. 
 A: 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]
$$
