And yes, before anyone says anything, I do know that they are wrongly attributed to Pell.

Anyway, I have a question about a particular form of them that is easier to solve. I've seen the solution, but there is one step that I don't really understand that I was hoping someone could explain to me.

Consider the following diophantine equation (with the usual constraints on alpha):

Let's say we have a particular solution, p and q, then want to find other solutions from this. You can raise one side to the and then factor to get:

So far so easy. Now comes the step I'm unclear about. You create the following two equalities:

From here it is easy to derive expressions for a and b in terms of p and q that are easy to work with, but I don't see why you can set these terms equal in this step in the first place. Is this just a matter of "let's try this and see if it works, and what do you know, we get some easy solutiosn, how lucky", in which case there may be other solutions being missed, or is there some logic to why this should be true and why you can set these terms equal like this, besides it looking nice and being "intuitive"?

Thanks.