# Diophantine Equation: solving $x^2-y^2=45$ in integers

How should I solve $x^2-y^2=45$ in integers? I know $$(x+y)(x-y)=3^2\cdot 5,$$ which means $3\mid (x+y)$ or $3\mid (x-y)$, and analogously for $5$.

$$(x-y)(x+y) = 45 \Rightarrow x + y = \frac{45}{x-y}$$
but since $$x +y \in \Bbb Z \Rightarrow x - y \mid 45 \Rightarrow (x - y , x + y) \in \{ (45,1) , (1,45) , (-45,-1) , (-1 ,-45) , (3,15) , (5,9) , (-3,-15) , (-5,-9) , (9,5) , (-9, -5) , (15,3) , (-15, - 3) \}$$
so can you get now ?? $$(x,y) \in ??$$
• Just to be certain, effectively what you've done is written down all of the divisors of $45$ since you know $x-y\mid 45$. Then, perhaps a bit of abusive terminology, you take the 'multiplicative conjugate', and that must be $x+y$ (since the product must be $45$). Then, since $x-y$ and $x+y$ are centered at $x$ with radius $y$ (again, abusive terminology), we simply need to find the midpoint to determine $x$, hence $y$. Is this correct, including the technique used? – anon271828 Oct 14 '13 at 14:15
• $$\frac{(x+y) + (x-y)}{2} = x$$ $$\frac{(x+y) - (x-y)}{2} = y$$ – what'sup Oct 14 '13 at 14:19
• In the first case, isn't this the formula for midpoint? :) Just as well, once we know $x$, we already know $x-y$, so we don't need such a complicated formula for $y$ (although, 'complicated' is subjective). Was my extrapolation of your technique correct? – anon271828 Oct 14 '13 at 14:23