<s>[INST] Integrate $\int_{0}^{\pi} \frac{1}{1+3^{\cos x}} dx.$ I am not able to solve the following integration, $$\int_{0}^{\pi} \frac{1}{1+3^{\cos x}} dx.$$ I have tried in different ways but most good one I think,
\begin{align*} \int_{0}^{\pi} \frac{1}{1+3^{\cos x}} dx &= \int_{0}^{\pi} \frac{\sin x}{\sin x (1+3^{\cos x})} \\ &= \int_{-1}^{1} \frac{dz}{\sqrt{1-z^2} (1+3^{z})}.\end{align*} Now how could I proceed. Please help me.
 [/INST] Just for the fun of it.
Dr Zafar Ahmed DSc provided the good solution.
For the fun of it, I did consider the more general problem of 
$$\int_{a}^{\pi-a} \frac{dx}{1+k^{\cos x}} $$
Expanding the integrand as a Taylor series built around $x=\frac \pi 2$ we have
$$\frac{1}{1+k^{\cos x}}=\frac{1}{2}+\frac{\log (k)}{4} \left(x-\frac{\pi }{2}\right) -\frac{\log (k) \left(\log
   ^2(k)+2\right)}{48}
   \left(x-\frac{\pi }{2}\right)^3 +\frac{\log(k)\left(\log
   ^4(k)+5 \log ^2(k)+1\right)}{480} \left(x-\frac{\pi }{2}\right)^5 +O\left(\left(x-\frac{\pi }{2}\right)^7\right)$$ which, as expected, shows only odd powers of $\left(x-\frac{\pi }{2}\right)$.
As a result
$$\int_{a}^{\pi-a} \frac{dx}{1+k^{\cos x}}= \frac{\pi }{2}-a\qquad \forall k >0$$
</s>