For which values of $p$ and $q$ does an improper integral converge Determine all $p$ and $q$ for which the following improper integral converges. Justify your answer.
$$\int_0^{\pi/2}\frac{\mathrm{d}x}{(\sin^px)(\cos^qx)}$$
I think I have an idea of how to approach this problem, but I'm not certain it's correct.
What I've done is to split the interval so we have:
$$\int_{0}^{\pi/4}\frac{\mathrm{d}x}{(\sin^px)(\cos^qx)}+ \int_{\pi/4}^{\pi/2}\frac{\mathrm{d}x}{(\sin^px)(\cos^qx)}$$
Then I state that since $ \frac{\sqrt{2}}{2} \le \cos^qx \le 1 $ in the first interval, I can use the comparison test:
$$0 \le \frac{1}{\sin^px} \le \frac{1}{(\sin^px)(\cos^qx)}$$
and find that the comparison function converges when $p\le0$ 
After that I would do something similar for the second interval in which the comparison function would involve $\cos^qx$ in place of $\sin^px$
Is what I've done so far correct? Thanks in advance.

I would consider the behavior at the endpoints.  Near $x=0$, $\sin{x} \sim x$, so that convergence of the integral requires that $p<1$.  Similarly, near $x=\pi/2$, $\cos{x} \sim (\pi/2)-x$, so that $q<1$ for convergence.  Therefore, $p$ and $q$ each must be less than $1$ for convergence.
