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.
If you expand out $\{(n+1)^2p-(n-1)^2q\}(p-q)$, you end up with the first expression.
In particular, $ \{(n+1)^2p-(n-1)^2q \}(p-q)=(n+1)p^2-(n+1)^2pq+(n-1)^2q^2-(n-1)^2pq $. Combining the $pq$ terms, we observe that $-(n+1)^2pq-(n-1)^2pq=-2pq(n^2+1)$.
Then the inequality comes from the fact that $D>0$.
To see this range condition, we first write the inequality as $(n+1)^2p(p-q)>q(p-q)(n-1)^2$. Then if $q<p$ we can cancel the $p-q$ and divide by $(n-1)^2$ to get $q<\frac{(n+1)^2}{(n-1)^2}p$. Conversely, if $q>p$, then dividing by $p-q$ switches the inequality so that $q>\frac{(n+1)^2}{(n-1)^2}p$. Thus, $q$ cannot be between the numbers $p$ and $\frac{(n+1)^2}{(n-1)^2}p$.