For which $p$, $q$ does the improper integral exist? 
For which $p$, $q$ does the improper integral exist?
  $$
\text{(a)}\quad \int_0^\infty \frac{dx}{x^p+x^q}
\qquad\quad\text{(b)}\quad \int_0^\infty x^p |x-1|^q \, dx
$$

I tried for (a) to simplify the problem 


*

*if $p=q$ it doesn't exist


I am not sure if that's true. I am also having hard time solving (b).
I'd be thankful if you helped me with (b) at least.
 A: You should use the asymptotic comparison test for improper integrals (no explicit integration is needed). 
As regards (a), we have that, as $x\to 0^+$,
$$ \frac{1}{x^p+x^q}\sim\frac{1}{x^{\min(p,q)}}$$
and the integral is finite in $(0,a)$ iff $\min(p,q)<1$.
On the other hand as $x\to +\infty$,
$$ \frac{1}{x^p+x^q}\sim\frac{1}{x^{\max(p,q)}}$$
and the integral is finite in $(a,+\infty)$ iff $\max(p,q)>1$.
So we may conclude that the whole integral over $(0,+\infty)$ is convergent if and only if 
$$\min(p,q)<1\quad\text{AND}\quad \max(p,q)>1.$$
Now try (b) and note that in this case you should investigate what happens near $0^+$, $+\infty$ AND $1$.
i) if $x\to 0^+$ then
$$x^p |x-1|^q \sim x^p\implies ?$$
ii) if $x\to 1$ then
$$x^p |x-1|^q \sim |x-1|^q\implies ?$$
iii) if $x\to +\infty$ then
$$x^p |x-1|^q \sim x^{p+q}\implies ?$$
A: Here is case (a). For it to converge, we have to have $\text{max}\{p,q\}>1$ and $\text{min}\{p,q\}<1$ Let $p-q=\alpha$.
\begin{align}
\int_0^\infty \frac{1}{x^p+x^q}\,dx&=\int_0^\infty \frac{x^{-q}}{1+x^{p-q}}\,dx \\
&=\frac{1}{\alpha}\int_0^\infty \frac{u^{-q/\alpha}}{1+u} u^{1/\alpha-1}\,du \\
&=\frac{1}{\alpha}\int_0^\infty \frac{u^{(1-p)/\alpha}}{1+u}\,du \\
&=\frac{1}{\alpha}\frac{\Gamma\big(\frac{1-q}{\alpha}\big)\Gamma\big(\frac{p-1}{\alpha}\big)}{\Gamma\big(1\big)} \tag{1}\\
&=\frac{1}{\alpha}\Gamma\left(\frac{1-q}{\alpha}\right)\,\Gamma\left(\frac{p-1}{\alpha}\right) \\ \\
&=\frac{1}{p-q}\Gamma\left(\frac{1-q}{p-q}\right)\,\Gamma\left(\frac{p-1}{p-q}\right)
\end{align}
Where I've used an integral representation of the Beta function, and its relationship with the Gamma function in $(1)$.
