In one of the solved examples in the book I'm following, the following expression arises after considering $D > 0$ for a certain equation:
$$D = (n+1)^2p^2 - 2pq(n^2+1) + (n-1)^2q^2$$
From this, the following step was derived:
$$\{(n+1)^2p-(n-1)^2q\}(p-q) > 0$$
or
$q$ cannot lie between $p$ and $\left( \dfrac{n+1}{n-1} \right)^2p$.
First of all, I'm not sure how the step was arrived, and finally, how the range of $q$ was determined. Please help.