TITLE: Solve the following equation in integers $x,y:$ $x^2+6xy+8y^2+3x+6y=2.$
QUESTION [7 upvotes]: Question: Solve the following equation in integers $x,y:$ $$x^2+6xy+8y^2+3x+6y=2.$$
Solution: For some $x,y\in\mathbb{Z}$ $$x^2+6xy+8y^2+3x+6y=2\\\iff x^2+2xy+4xy+8y^2+3x+6y=2\\\iff x(x+2y)+4y(x+2y)+3(x+2y)=2\\\iff(x+4y+3)(x+2y)=2.$$ 
Now if $(x+4y+3)(x+2y)=2$, then either $$\begin{cases} x+4y+3=1\\ x+2y=2\end{cases}\text{ or }\begin{cases} x+4y+3=2\\ x+2y=1\end{cases}\text{ or }\begin{cases} x+4y+3=-1\\ x+2y=-2\end{cases}\text{ or }\begin{cases} x+4y+3=-2\\ x+2y=-1\end{cases}.$$ 
We have $$\begin{cases} x+4y+3=1\\ x+2y=2\end{cases}\iff (x,y)=(6,-2), \\\begin{cases} x+4y+3=2\\ x+2y=1\end{cases}\iff (x,y)=(3,-1), \\\begin{cases} x+4y+3=-1\\ x+2y=-2\end{cases}\iff (x,y)=(0,-1),\\\begin{cases} x+4y+3=-2\\ x+2y=-1\end{cases}\iff (x,y)=(3,-2).$$ 
Now since, all the four pairs $(6,-2),(3,-1),(0,-1),(3,-2)$ satisfies the integer equation $(x+4y+3)(x+2y)=2$, thus we can conclude that $(x+4y+3)(x+2y)=2\iff (x,y)=(6,-2),(3,-1),(0,-1),(3,-2).$ 
Hence, we can conclude that the integer equation $x^2+6xy+8y^2+3x+6x=2$ is satisfied if and only if $(x,y)=(6,-2),(3,-1),(0,-1),(3,-2)$, and we are done. 
Is the solution correct and rigorous enough? And, I am always confused while solving equations regarding the usage of the if and only if arguments, which I feel is very necessary in order to have a complete and rigorous solution, but I rarely find it's usage in any book while solving equations of any kind. So, is it necessary? Also, is there a better solution than this?

REPLY [2 votes]: Below is a different solution. It's not as easy as other methods to which this equation might be amenable, but it generalizes nicely to degree two polynomial Diophantine equations in two variables and has a nice geometric interpretation. The general idea is to parameterize all rational solutions and then restrict them to integers. Here we go.
First we notice that $(0,-1)$ works. This will be helpful because we can use it to generate all other rational solutions. Note that for $x=0,$ the only solutions are $y=-1,\frac{1}{4}.$ Note that if $(p,q)$ is a rational solution other than $(0,-1)$ and $\left(0,\frac{1}{4}\right),$ then the line through $(p,q)$ and $(0,-1)$ is non-vertical and has slope $\frac{q+1}{p},$ which is rational. The main idea is the converse: If there is a non-vertical line through $(0,-1)$ with a rational slope $m,$ then it intersects the curve of real solutions at a rational point. We can prove it as follows: The equation of the line is $y=mx-1.$ By substituting it into the curve's equation and simplifying, we get $$(1+6m+8m^2)x^2 -(3+10m)x=0.$$ Since $x\ne 0,$ we get $$(1+6m+8m^2)x =3+10m.$$ The only ways that $1+6m+8m^2=0$ are $m=-\frac{1}{4},-\frac{1}{2}.$ Each of these cause the left side to disappear while making the right side non-zero, so we don't have to worry about division by zero when we produce $$x=\frac{3+10m}{1+6m+8m^2},$$ which is rational. So the rational solutions for $x\ne 0$ are parameterized by $$(x,y)=\left(\frac{3+10m}{1+6m+8m^2},mx-1\right)$$ over all rational $m.$ We want to find out which of there are not merely rational, but integers.
Isolating $m$ in $$x=\frac{3+10m}{1+6m+8m^2}$$ using the quadratic formula yields $$m=\frac{5-3x\pm\sqrt{(x-3)^2+2^4}}{8x}.$$ So we want to find all cases where $(x-3)^2+2^4=z^2$ for some integer $z.$ By difference of squares, we want to solve the Diophantine equation $$(z-x+3)(z+x-3)=2^4.$$ Via casework, we get the solutions $$(x,z)=(6,5),(3,4),(0,5),(0,-5),(3,-4),(6,-5).$$ Omitting the cases where $x=0,$ we can find all the corresponding values of $$m=\frac{5-3x\pm z}{8x}$$ and subsequently all the values of $y.$ There turn out to be some overlaps in these cases, but anyway, the solutions are $$(6,-2),(3,-1),(3,-2),(0,-1),$$ where the last one is the one that we initially guessed.