Generating pythagorean triples in this question

Find all integer solutions to $x^{2}+8xy+25y^{2}=225 \tag 1$

$(1)$ can be written as $$(x+4y)^2 + (3y)^2 = 15^2$$

This reduces the problem to a matter of generating pythagorean triples. I'm thinking that Euclid's method would be useful, but it's not immediately obvious to me how to use it.

Consider the quadratic equation $$x^2 + 8xy + 25y^2 - 225 = 0$$ where $x$ is the unknown. Compute $$\frac{\Delta}{4} = 16y^2 - 25y^2 + 225 = 225 - 9 y^2.$$ Then $x$ is an integer if and only if the discriminant is a perfect square.

Notice that $9 \cdot 5^2 = 225 = 0$, therefore $-5 \le y \le 5$. Now check for which $y$ the discriminant is a perfect square, and then compute the solutions for both $x$ and $y$.

• How do you arrive at the inequality from the observation that $9(5^2) = 225$? – Airdish Sep 4 '16 at 17:53
• If $\lvert y \rvert > 5$, then $225 - 9 y^2 < 225 - 9 \cdot 25 < 0$, and $\Delta < 0$ implies that the equation has no solutions for $x$. – Luca Bressan Sep 4 '16 at 17:54
• Ah I see, this is really nice. Do you have any ideas on whether my approach is a dead end without brute force? – Airdish Sep 4 '16 at 17:55
• Looking at your equation $(x + 4y)^2 + (3y)^2 = 15^2$, you could still have obtained that $-5 \le y \le 5$. From then, I think brute force is necessary, but it's not that much of a burden since there are few values to check. In fact, my approach is almost the same as yours; I would say it's simply more mechanical. – Luca Bressan Sep 4 '16 at 17:58
• How would I obtain the inequality from my approach? – Airdish Sep 4 '16 at 18:00

Note that :-

$$15^2=9^2+12^2$$ is true.

So,$$(x+4y)^2+(3y)^2=9^2+12^2$$

• More preferable than just an answer would be a method which I'd be able to apply in other scenarios. – Airdish Sep 4 '16 at 17:38
• @Airdish You cannot have a general brute force formula for solving all these types of question because this is a two variable equation but you only have one equation.Generally we need to have that many equations as the number of variables.For solving a $3$ variable equation,you would be provided with three equations which satisfy the same condition....so you must apply some intuition and trick... – tatan Sep 4 '16 at 17:41
• Maybe there are solutions using $15^2+0^2$? The danger in just finding something that works ad hoc is you miss other possibities. I have mis-solved plenty of Sudoku puzzles by falling into that trap :-S . – Oscar Lanzi Sep 4 '16 at 18:04