When does the integral converges? 
For what $\alpha, \beta$ the integral $$\int_0^\frac{\pi}{2} \frac{(\frac{\pi}{2} - x)^\alpha}{(\cos x)^\beta} dx$$ converges?

So first I used WolframAlpha to know that $\frac{\pi}{2} - x < \cos x$ on $[0,\frac{\pi}{2}]$, but I'm not so sure how to prove it.
Second, I evaluated the derivative of the inegrand and looked for extremum points. I've found that $x$ which agrees with $\frac{\alpha}{\beta} = \frac{\frac{\pi}{2}-x}{\cos x}$ is an extremum point.
I think the first insight is crucial for the solution, though I'm not sure how to proceed.
Can you help me?

By changing the variable $t=\frac\pi2-x$ the integral becomes
$$\int_0^{\pi/2}\frac{t^\alpha}{(\sin t)^\beta}dt$$
and since
$$\frac{t^\alpha}{(\sin t)^\beta}\sim_0\frac1{t^{\beta-\alpha}}$$
so the given integral is convergent if and only if $\beta-\alpha<1$.
