I am trying to solve the equation $937=x^2+24x+24y+y^2$, where x and y are integers. What I've tried is changing the right side of the equation to $$(x+y)^2-2xy+24x+24y$$ $$(x+y)^2-2(x+y)(-12)+xy$$ $$(x+y)((x+y)++24+x+y)$$ $$2(x+y)(x+12+y)$$

and then trying to find integers that fit into the equation but it doesn't seem like the most efficient or proper way to solve this equation. Any suggestions?

  • 7
    $\begingroup$ Hint: $(x+12)^2 + (y+12)^2 = ???$ $\endgroup$ – achille hui Sep 14 '15 at 20:48
  • $\begingroup$ When I evaluate that I get $$x^2+24x+24y+y^2+288$$. I'm not sure how that would help me solve the equation. $\endgroup$ – Jonathan Sep 14 '15 at 20:53
  • 1
    $\begingroup$ "Borrow" the 288 from your goal number 937 and see what's left. Then you're looking for sum of two squares to equal that, and there are various techniques for solving $u^2+v^2=m$ when it can be solved. $\endgroup$ – coffeemath Sep 14 '15 at 20:56
  • 2
    $\begingroup$ $937+288 = 1225 = 35^2 = (5\times 7)^2$, this reduce to the well known problem of writing a number as sum of squares... $\endgroup$ – achille hui Sep 14 '15 at 20:58
  • 1
    $\begingroup$ @coffeemath, I think you led OP astray. You should have told him to add $288$ to both sides of the equation. $\endgroup$ – Lubin Sep 14 '15 at 21:10

Complete the square in each of the $x$ and $y$ quadratics:

$$\begin{align} (x^2+24x+144)+(y^2+24y+144)=937+288&=1225 \\ (x+12)^2+(y+12)^2=35^2 \end{align}$$

So we are seeking Pythagorean triples where the triangle has two sides of length $x+12,y+12$ and a hypotenuse of $35$. Irreducible Pythagorean triples are of the form:


The only primitive triples relevant here are those with $m^2+n^2\in\{5,7,35\}$ because these are all the factors of $35$ larger than one, and so are the only ones that can be scaled up to obtain a triangle with hypotenuse $35$.

The only one with integer solutions is $m^2+n^2=5 \implies m=2,n=1$ ($7$ and $35$ are of the form $4k+3$ so cannot be a sum of two integer squares) from which we have the primitive triple $(3,4,5)$. So

$$\begin{align} &3^2+4^2=5^2 \\ &\implies 21^2+28^2=35^2 \\ &\implies (\pm21)^2+(\pm28)^2=35^2 \\ &\implies (x+12,y+12)\in\{(21,28),(-21,28),(21,-28),(-21,-28),(28,21),(-28,21),(28,-21),(-28,-21)\} \\ &\implies (x,y)\in\{(9,16),(-33,16),(9,-40),(-33,-40),(16,9),(-40,9),(16,-33),(-40,-33)\} \end{align}$$


As $\color{blue}{\text{coffeemath}}$ has pointed out, there are also trivial solutions (not Pythagorean triples) to the original equation, i.e.




are also solutions.

  • $\begingroup$ Thank you for this explanation. It has inspired me to increase my knowledge on pythagorean triples. $\endgroup$ – Jonathan Sep 15 '15 at 1:19
  • $\begingroup$ You're welcome. I'm glad you're inspired. It's a nice topic. $\endgroup$ – Marconius Sep 15 '15 at 1:33
  • 1
    $\begingroup$ There are four more solutions $(x,y)=(-12,-12 \pm 35),(-12 \pm 35,-12).$ $\endgroup$ – coffeemath Sep 15 '15 at 12:11
  • $\begingroup$ @coffeemath - Thanks - not sure how I missed that. I've updated the answer accordingly. $\endgroup$ – Marconius Sep 15 '15 at 13:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.