# How can I solve the folowing Diophantine equation with two unknowns?

Find one integer solution to the following Diophantine equation: \begin{equation*} \\\forall \,x,y \in \mathbb{Z}\\ 6xy + x - y = 274 \end{equation*}

The resultat ist $x = 9$, $y = 5$ (Obtained with wolframalpha )

I need to know a method that allows me to reach such a result. How can I calculate the value of these two variables in a Diophantine equation?
For example: 6xy + x - y = 458

• But, the equation is not linear. – Emilio Novati Dec 5 '16 at 15:43
• you can use this site. It does a step-by-step solution or just a solution but it also provides the method Bill Dubuque mentioned in his answer. so you basically have everything in one neat package. alpertron.com.ar/QUAD.HTM – user25406 Dec 5 '16 at 15:48

Hint $\$ This type of diophantine equation is solvable by a generalization of completing the square. Namely, completing a square generalizes to completing a product, using the AC-method, viz.

$$\begin{eqnarray} &&axy + bx + cy\, =\, d,\ \ a\ne 0\\ \overset{\times\,a}\iff\, &&\!\! (ax+c)(ay+b)\, =\, ad+bc\end{eqnarray}\qquad\qquad$$

So the problem reduces to checking which factors of $\,ad+bc\,$ have above form, a finite process.

$\dfrac{274+y}{6y+1}=x$

As $x$is an integer, if integer $d$ divides both $274+y,6y+1;d$ must divide $6(274+y)-(6y+1)=1643$

For integer $x,6y+1$ must divide $1643=31\cdot53$ whose divisors are $\pm1\pm31,\pm53$

• In case anyone wonders, solving it this way ends up being essentially equivalent to the method in my answer using the AC method to complete the product. – Bill Dubuque Dec 5 '16 at 16:25

This is @Bill Dubuque's answer in more detail.

I don't know what you mean by $\mathbb Z_0$.

$$\forall x,y \in \mathbb Z_0, \quad 6xy + x - y = 274$$

\begin{align} 6xy + x - y &= 274 \\ 36xy + 6x - 6y &= 1644 \\ 36xy + 6x - 6y - 1 &= 1643 \\ 6x(6y+1) -1(6y+1) &= 1643 \\ (6x-1)(6y+1) &= 1643 \end{align}

\begin{array}{|cc|cc|} \hline 6x-1 & 6y+1 & x &y \\ \hline 1 & 1643 & \ast & \ast\\ 31 & 53 & \ast & \ast\\ 53 & 31 & 9 & 5\\ 1643 & 1 & 274 & 0\\ \hline \end{array}

• Thank you for your answer. I do not quite understand the table How do you get on the numbers 31 and 53? – Darío A. Gutiérrez Mar 10 '17 at 15:44
• @DaríoA.Gutiérrez Listed is the four ways of multiplying two integers to get the product 1643. I got it by going to Wolfram Alpha and typing in Divisors. – steven gregory Mar 10 '17 at 16:14
• Know you what an algorithm used Wolfram Alpha by Divisors to extract the integer solutions (9, 5)? – Darío A. Gutiérrez Mar 12 '17 at 1:25
• @DaríoA.Gutiérrez - You solve 6x-1=53 and 6y+1=31. – steven gregory Sep 16 '17 at 4:25