TITLE: Integrating $\int_{-\frac{\pi}{4}}^{\frac{\pi}{4}} \frac{\log\left( x^2 + 2 x \sin(\theta) + 1 \right)}{x + 2 \sin(\theta)} d\theta$
QUESTION [8 upvotes]: Let $x>0$. I've encountered the following integral:
$$
I(x) \ = \ \int_{-\frac{\pi}{4}}^{\frac{\pi}{4}} \frac{\log\left( x^2 + 2 x \sin(\theta) + 1 \right)}{x + 2 \sin(\theta)} d\theta
$$
Is there a way to integrate this? I've been looking through Gradshteyn and Ryzhik, and I have found some similar integrals but nothing that looks exactly like this. Maybe through a contour integration?
If there is no way to integrate this, is it possible to derive asymptotics for the above $I(x)$ in the limit $x \to \infty$?

REPLY [2 votes]: For $x$ sufficiently large, and putting all in the form 
$$2\int_{-\pi/4}^{\pi/4} \frac{\log(x)}{x}\cdot \frac{\textrm{d}\theta}{1+2\sin(\theta)/x}+\int_{-\pi/4}^{\pi/4} \frac{\log\left(1 + 1/x (2\sin(\theta) + 1/x) \right)}{x }\cdot \frac{\textrm{d}\theta}{1+2\sin(\theta)/x} $$
combined with the power series of $\log(1+x)$ and $\displaystyle \frac{1}{1+x}$, and integrating termwise, we arrive, for example, at the asymptotical behaviour
$$I(x)\approx\pi\frac{\log(x)}{x}+\frac{2(\pi-2)\log(x)+3-\pi}{x^3}+\frac{12(3\pi-8)\log(x)-21\pi+64}{6x^5}.$$