I have been trying this diophantine equation

Find all integer solutions to $$x^2-xy+y^2=13$$

but was unable to crack it.I have solved a few diophantine equations only.So please give a approach to solve this type of many problems and some methods which are used in these equations.

I think that we should try to factorise the equations so that we can pair up the solutions and we can see 13 is a prime number so it is easy to count the solutions or we can create a $$(x-y)^2$$ to solve and then do the factorisation.

Please while answering try to share the idea one should get while doing these type of questions and the basic approach on should hit to solve.

If there is any trick to solve these equation then please share that also,so that I can use that in further questions.

If both $$x,y$$ are positive you can use the inequality $$x^2 + y^2 \ge 2xy$$. We have:

$$13 = x^2 + y^2 - xy \ge 2xy - xy = xy$$

Thus we have $$xy \le 13$$. Now WLOG let $$x \ge y$$. Then we have that $$y \le \sqrt{13}$$. Thus $$y=1,2$$ or $$3$$.

Plug these into the equation to check for solutions. Also don't forget that if $$(x,y)$$ is a solution, so is $$(y,x)$$.

Note that this will yield the negative solutions too, as $$(x,y)$$ is a solution if and only if $$(-x,-y)$$ is a solution, too.

If one of $$x,y$$ is positive and the other is negative you can WLOG assume that $$x$$ is positive and $$y = -m$$, where $$m$$ is non-negative integer. Then you want to solve $$13 = x^2 + xm + m^2$$. Similarly as above you get that:

$$3xm \le 13$$

And if we set $$x \ge m$$ we have that $$m = 1$$ or $$2$$. Again plug these values into the equation to check for solutions.

• how you applied the AM-GM inequality in the expression,and i do not know anything about WLOG just the full form without loss of generality.so please help by explaining this further or by any other method – Aryan 24k Jun 11 '19 at 18:48
• @Aryan24k I explaine how I used AM-GM. And yes, WLOG means exactly that. What I mean is that you can assume that $x \ge y$, as if $(x,y)$ is a solutions so is $(y,x)$ – Stefan4024 Jun 11 '19 at 18:50
• you have assumed that y is less then x .that's ok but how you get y is less then equal to root 13 – Aryan 24k Jun 11 '19 at 18:56
• @Aryan24k $13 \ge yx \ge y^2 \implies \sqrt{13} \ge y$ – Stefan4024 Jun 11 '19 at 19:43
• Ok thanks i get what you have done – Aryan 24k Jun 12 '19 at 5:15

Hint: $$x^2-xy+y^2=\frac34(x-y)^2+\frac14(x+y)^2$$, so you want to solve $$3(x-y)^2+(x+y)^2=52$$ for integers $$x,y$$. Start by bounding $$\lvert x-y\rvert$$ and $$\lvert x+y\rvert$$.

• how would i solve this further – Aryan 24k Jun 11 '19 at 18:32
• whether i have to break 52 in a perfect square and the othe one in multiple of 3 and a perfect square – Aryan 24k Jun 11 '19 at 18:34
• Just check the finitely many cases, or if you want a more advanced solution, work with $\mathbb{Z}[\zeta_3]$. – user10354138 Jun 11 '19 at 18:35
• and also share the way how you get to this format of the equation and how would one think of it to get there. – Aryan 24k Jun 11 '19 at 18:37
• what is $Z(C_3)$ – Aryan 24k Jun 11 '19 at 18:39

I would write $$x_{1,2}=\frac{y}{2}\pm \sqrt{13-\frac{3}{4}y^2}$$ We consider here the equation $$x^2-xy+y^2-13=0$$ as an equation in $$x$$ using the quadratic formula. So we get $$|y|\le \sqrt{\frac{52}{3}}$$ this means $$|y|\le 4$$ It must be $$13\geq \frac{3}{4}y^2$$ since the radicand must be non negative.

• please clarify how you get to this solution and how may i will solve that down further – Aryan 24k Jun 11 '19 at 18:40
• How you get y is less than equal to root 53/3 – Aryan 24k Jun 12 '19 at 5:20
• I think the expression inside the square root can be negative also.so should we do D less than equal to 0 to make it always positive and then we can get a range bound in y and can assume the integers values of y. – Aryan 24k Jun 12 '19 at 5:23
• The expression inside the square root must be greater or equal to zero. – Dr. Sonnhard Graubner Jun 12 '19 at 5:25
• Ok thanks i got what you have done – Aryan 24k Jun 12 '19 at 5:27

Above equation shown below,

$$x^2-xy+y^2=13$$ -----$$(1)$$

Equation $$(1)$$ has parametric solution:

$$x=w(3k^2+2k-4)$$

$$y=w(4k^2-6k-1)$$

Where, $$w=[(1)/(k^2-k+1)]$$

For $$k=2$$, we get $$(x,y)=(4,1)$$

• How you get the parametric solution and what is parametric solution – Aryan 24k Jun 12 '19 at 5:12
• Please also share what approach you have taken when you first saw the question – Aryan 24k Jun 12 '19 at 5:19
• en.wikipedia.org/wiki/Parametric_equation – İbrahim İpek Jun 12 '19 at 12:15
• As an example, instead of writing $y = f(x)$, you write $(x, f(x))$. Or with a third variable $t$: $(x(t), y(t))$. If $x(t) = t$ and $y(t)=t^2$ it is same with $y = x^2$ etc. – İbrahim İpek Jun 12 '19 at 12:17