This is the classical diophantine equation from number theory. It is inacurrately called, "Pellian Equation".

Some History.

---

The first first person to make use of it was Fermat in 17th Century. He claimed he had a proof of the infinitude of solutions using the method of infinitedescent(not ascent). Not supprsingly, he never published it. Nor do I think there exists a proof using infinite descent.

A century later Euler decided to solve this problem in general. But even he failed. Eventually, Lagrange succedded in showing that:

x^2-ny^2=1

Where n is a non-square integer has infinitely many solutions.

I have only seen two proofs. One which I believe was worked out by Euler/Lagrange by the use of infinite continued fractions. [Every solution is a convergent of the continued fractional expansion of sqrt(n)]. It takes like 6 pages (if you already know the fundamental properties of continued fractions).

The other proof I have only gazed upon. It was done by Dirichelt. Without the use of continued fractions. All he did was show the infininitude of solution (where Euler/Lagrange has an algorithm).

Both the proofs are really ugly/hard/long using non-stop use of inequalities.

But the basic theorem you need to know that, is "n" is NOT a square then there are infinitely many solutions. Otherwise, the only solution is trivial.