Introduction to the Pell's Equation
Difficult
Video tutorial
Lecture Notes
A Pell's equation is in the form of $x^2 - dy^2=\pm 1$ where positive integer $d$ is not a square.
Most attention is on the form $x^2 -dy^2=1$. It can be shown that Pell's equation in this form has infinitely many solutions in addition to the trivial one of $(1, 0)$.
However, the negative Pell's equation $x^2 -dy^2=-1$ may be unsolvable. A well-known conclusion is that a necessary (but not sufficient) condition for a negative Pell's equation to be solvable is $n$ is neither divisible by $4$ nor divisible by a prime of form $4k-1$.
Comments
When $d$ is a perfect square, then the given equation can be handled by the difference of squares method.