# Integer Solutions Explaination

I know how to solve linear diophantine equations, but I was wondering if someone can give me a step by step to solve something like $$2x^2 + 2x - 5y = -1$$? I cannot find a lot of resources on this particular form.

I know the solutions are

$${ y = 10 k^2 - 14 k + 5, x = 3 - 5 k}$$

$${ y = 10 k^2 - 6 k + 1, x = 1 - 5 k}$$

$$2 x^2 + 2 x + 1 \equiv 0 \pmod 5$$ $$4 x^2 + 4 x + 2 \equiv 0 \pmod 5$$ $$(4 x^2 + 4 x + 1) +1 \equiv 0 \pmod 5$$ $$(4 x^2 + 4 x + 1) \equiv -1 \pmod 5$$ $$(2 x + 1)^2 \equiv -1 \pmod 5$$ $$2 x + 1 \equiv 2,3 \pmod 5$$ $$2 x \equiv 1,2 \pmod 5$$ $$2 x \equiv 6,2 \pmod 5$$ $$x \equiv 3,1 \pmod 5$$
• @RyanTopps I wouldn't put it that way. If we are considering things $\pmod p$ where $p$ is an odd prime, square roots of a number (if there are any at all) come in $\pm$ pairs. As $-1 \equiv 4 \equiv 9 \pmod 5,$ we find the square roots as $2,3 \pmod 5.$ Note that $2+3 \equiv 0 \pmod 5$ – Will Jagy Sep 28 '18 at 3:35