[Math] Finding all integers satisfying an equation

number theory

My task is to find all $x,y\in\mathbb{Z}$ which satisfy
$$
2x^2+2xy+y^2=25\quad\quad\text{(1)}
$$
Is there a general approach of solving a task like this? If not, have you got tips for me, that might help me solving this? Below are my attempts of solving this task:

First I tried to solve it as a differential equation:
$$
2x^2+2xy+y^2=25 \\
\Leftrightarrow\quad\frac{d}{dx}(2x^2+2xy+y^2)=\frac{d}{dx}(25) \\
\Leftrightarrow\quad4x+2y+2x\cdot\frac{dy}{dx}+2y\cdot\frac{dy}{dx}=0 \\
\Leftrightarrow\quad\frac{dy}{dx}(2x+2y)=-4x-2y \\
\Leftrightarrow\quad\frac{dy}{dx}=\frac{-4x-2x}{2x+2y} \\
\Leftrightarrow\quad\frac{dy}{dx}=-\frac{2x+x}{x+y}
$$
Here I got stuck, so I tried to solve equation (1) like a quadratic equation (for $x$ as well as for $y$) and came up with this pair of equations (which didn't help either):
$$
x=-\frac{1}{2}y\pm\sqrt{-\frac{1}{4}y^2+\frac{25}{2}} \\
y=-x\pm\sqrt{(5+x)(5-x)}
$$

Best Answer

These equations are called Diophantine equations and we don't know yet how to solve them effectively, we know only how to solve some particular cases, Your equation is equivalent to $(x+y)^2+x^2=5^2$ and we know that the only representations of $5^2$ as sum of squares are :$5^2=5^2+0^2=3^2+4^2$ (search for Pythagorean triples).

so you have either:

  • $x+y=0$ $x=\mp 5$
  • $x+y=\mp 5$ $x=0$
  • $x+y=\mp 4,x=\mp 3$
  • $x+y=\mp 3,x=\mp 4$