Suppose n is a fixed integer not equal to 0 and d is a positive integer not a perfect square, and suppose

,

where . Let , where a>0, b>0 provides a solution to the Fermat-Pell equation, . Show that

.

Conclude that the equation either has no solutions or infinitely many solutions.

********************

I do know that the problem is similar to http://www.mathhelpforum.com/math-he...od-ascent.html, but I did not understand something in that thread. How did TPH go from to

Is there a method to that or is it just something you recognize as the right formula to use?