<s>[INST] Diophantine Equation with Square Root I want to resolve the diophantine equation:
$\sqrt{x^2+5x+12} ≡ x-2\pmod 5$
I have thought 2 ways:
1.
$(\sqrt{x^2+5x+12})^2 ≡ (x-2)^2\pmod 5$
$ x^2+5x+12 ≡ x^2 -4x+4\pmod 5$
$ 9x+8 ≡  0\pmod 5$
$ 4x+3 ≡  0\pmod 5$
$ 4x+3 = 5y$
$ 4x-5y = -3$
I resolve:
$x=5n+3$, 
n
∈
Z

$y=4n+3$, 
n
∈
Z

2.
$\sqrt{x^2+5x+12} ≡ x-2\pmod 5$
$\sqrt{x^2+5x+12} = x-2 + 5y$
$(\sqrt{x^2+5x+12})^2 = (x-2 + 5y)^2$
$x^2+5x+12 = 10xy+x^2-4x-20y+25y^2+4$
$25y^2+10xy-9x-20y-8 = 0$ and resolve that diophantine equation.
My questions are: Are both procedures valid? If so, does the development of each procedure preserve the value of the initial x and y unknowns?
Thank you
 [/INST] Then I have done:
$\sqrt{x^2+5x+12} ≡ x-2\pmod 5$
$\sqrt{x^2+2} ≡ x-2\pmod 5$
$\sqrt{x^2+2} = x-2+5y$
$x^2+2 = (x-2+5y)^2$ and that equation more recient dont have solutions and $\sqrt{x^2+5x+12} ≡ x-2\pmod 5$ has solutions, Why?
Thanks
</s>