A divergent Definite Integral I am trying the study a definite integral
$$\int_{0}^{\pi}\frac{1}{(x-\frac{\pi}{2})^3+\cos{x}} dx$$
It is a divergent integral, but I am struggling to show that fact. Since the discontinuous point is at $\frac{\pi}{2}$, so
$$\int_{0}^{\pi}\frac{1}{(x-\frac{\pi}{2})^3+\cos{x}} dx= \lim_{a \rightarrow \frac{\pi}{2}} \int_{0}^{a} \frac{1}{(x-\frac{\pi}{2})^3+\cos{x}} dx + \lim_{a \rightarrow \frac{\pi}{2}} \int_{a}^{\pi} \frac{1}{(x-\frac{\pi}{2})^3+\cos{x}} dx$$
Then I study the first term on RHS which is $\lim_{a \rightarrow \frac{\pi}{2}} \int_{0}^{a} \frac{1}{(x-\frac{\pi}{2})^3+\cos{x}} dx$.
For $x \in [0,\frac{\pi}{2}]$, I try to bound the function $\frac{1}{(x-\frac{\pi}{2})^3+1} \leq \frac{1}{(x-\frac{\pi}{2})^3+\cos{x}} \leq \frac{1}{(x-\frac{\pi}{2})^3}$.
I can show $\int_{0}^{a}\frac{1}{(x-\frac{\pi}{2})^3} dx$ is divergent. But by comparison, I cannot say that the required function is also divergent.
How can I continue to show that the function is divergent? Thanks~
 A: Since $\Big(x-\frac{\pi}{2}\Big)^3+\cos x$ has three zeroes $x_1,x_2,x_3$, $0<x_1<\pi/2=x_2<x_3<\pi$, it suffices to show that 
$$f(x)=\frac{1}{\Big(x-\frac{\pi}{2}\Big)^3+\cos x}$$
 is not integrable in any interval of the for $(1,\pi/2)$.

Near $\pi/2$, $\Big|x-\frac{\pi}{2}\Big|\sim|f(x)|$ (one can check this using L'Hospital rule, $\lim_{x\rightarrow\frac{\pi}{2}}\frac{x-\frac{\pi}{2}}{\Big(x-\frac{\pi}{2}\Big)^3+\cos x}=-1$). Thus there is $1<a_*<\pi/2$ such that 
$$
\frac12\frac{1}{\Big|x-\frac{\pi}{2}\Big|}\leq |f(x)|\leq \frac32\frac{1}{\Big|x-\frac{\pi}{2}\Big|}
$$
Since $g(x)=\frac{1}{\Big|x-\frac{\pi}{2}\Big|}$ is not intergrable in $[a^*,\pi/2]$, we conclue that neither is $f(x)$.
A: One approach may be to change variables to $u = x-\pi/2$
$$
\begin{split}
\int_0^\pi \frac{dx}{(x-\frac{\pi}{2})^3+\cos{x}}
 &= \int_{-\pi/2}^{\pi/2} \frac{du}{u^3+\cos(u + \pi/2)} \\
 &= \int_{-\pi/2}^{\pi/2} \frac{du}{u^3-\sin u} \\
 &= 2 \int_0^{\pi/2} \frac{du}{u^3-\sin u},
\end{split}
$$
where the last step is because the integrand is odd. Now over $[0,\pi/2]$ we have $\sin u \le 1$ so $u^3 - 1 \le u^3-\sin x$ therefore,
$$
\int_0^{\pi/2} \frac{du}{u^3-\sin u} \ge \int_0^{\pi/2} \frac{du}{u^3-1},
$$
which you can integrate analytically by factoring the denominator and applying partial fractions. It will diverge.
