So, I have understood how to solve Diophantine equations of the form $$x^2-Dy^2=1.$$ However, when I was reading the solution of the generalized Pell's equation $$x^2-Dy^2=c,$$ I got stuck. I knew how to solve it using continued fraction, but the book used an intriguing method, but skips over so much detail that I can't understand it. It seems to be using a method similar to Euclid's algorithm, which reduces the $c$ step by step, finally reaching $c=1$.
Here is the translated text:
Example 5. Find all integer solutions of the equation $x^2-15y^2=61$.
Solution: This is not a standard Pell's equation, therefore we need to transform it.
First, solve for the equation $l^2\equiv15(\mathrm{mod}\;61)\;(0\le l\le\frac{61}2)$, which is equivalent to $l^2=15+61h\;(l^2\le900)$. Since $0\le h\le \left[\frac{900}{61}\right]=14$, trying $h=0,1,\dots,14$ gives us $h=10, l=25$.
Next, find the solutions of $x^2_1-15y^2_2=10$, which reduces to to solving $l^2=15+10h\;(l\le\frac{10}{2}=5)$. We can see that $l=5,h=1$. Therefore $x_1=5, y_1=1$.
Next, solve the equation $x^2_2-15y^2_2=1$. This is a Pell's equation, whose fundamental solution is $x_2=4, y_2=1$.
Therefore, $x_2+\sqrt{15}y_2=\pm(4+\sqrt{15})^n$,
$x_1+\sqrt{15}y_1=\pm(4+\sqrt{15})^n(5\pm\sqrt{15})$,
$x+\sqrt{15}y=\pm(4+\sqrt{15})^n(5\pm\sqrt{15})(\frac{25\pm\sqrt{15}}{10})$.As the three $\pm$ signs are mutually independent, the solution to the equation is therefore $$x+\sqrt{15}y=\pm(4+\sqrt{15})^n(14+3\sqrt{15})$$ and $$x+\sqrt{15}y=\pm(4+\sqrt{15})^n(11+2\sqrt{15})$$