Help me out by calculating this limit Could someone help me out by calculating this limit:

$\lim_{n \rightarrow \infty} x_n,$ where $$x_n= \left(\frac{n^p+1}{n^q-1}\right)^{rn-\sqrt{n^2-2n}},$$ 
  and $p,q,r$ are natural numbers, so is $n$ .

I was trying to discuss different cases but it seems that there are too much..is there any trick that I haven't noticed?
Thanks in advance! 
 A: the usual trick is 
$$\left(\frac{n^p+1}{n^q-1}\right)^{rn-\sqrt{n^2-2n}}=e^{\log{\left(\frac{n^p+1}{n^q-1}\right)^{rn-\sqrt{n^2-2n}}}}=e^{(rn-\sqrt{n^2-2n})\log{\left(\frac{n^p+1}{n^q-1}\right)}},$$ and so now you need to study
$$(rn-\sqrt{n^2-2n})\log{\left(\frac{n^p+1}{n^q-1}\right)}.$$
If $r=1$ then $n-\sqrt{n^2-2n}=\frac{2n}{n+\sqrt{n^2-2n}}\to 1$ and so it is enough to study $\log{\left(\frac{n^p+1}{n^q-1}\right)}.$ If $p>q$ you get $\infty$, if $p=q$ you get $\log1=0$ if $p<q$ you get $-\infty$
If $r\ne 1$ and $p>q$, then $rn-\sqrt{n^2-2n}=n\left(r-\sqrt{1-\frac2n}\right)$ and so
$$(rn-\sqrt{n^2-2n})\log{\left(\frac{n^p+1}{n^q-1}\right)}=n\left(r-\sqrt{1-\frac2n}\right)\log{\left(\frac{n^p+1}{n^q-1}\right)}\to(r-1)\infty.$$
If $p<q$ then $\log{\left(\frac{n^p+1}{n^q-1}\right)}\sim-\log n^q+\log n^p$ and so the limit is $-(r-1)\infty$ since $n$ goes to infinity faster that the log.
If $p=q$ then $\log{\left(\frac{n^p+1}{n^p-1}\right)}=\log{\left(1+\frac{2}{n^q-1}\right)}\sim \frac{2}{n^q-1}\sim \frac{2}{n^q}$
and so you need to study the limit $\frac{n}{n^q}$ and distinguish $r<1$, $r=1$ and $r>1$.
