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
Writing the congruence as an equation in the field $\Bbb F_5$ we obtain $$ x^2+5x+12=(x-2)^2=x^2-4x+4, $$ which gives $4x=2$. In $\Bbb F_5$ this has the unique solution $2^{-1}=3$, because $2\cdot 3=6=1$, so that $3$ is the inverse of $2$.