<s>[INST] Quadratic Diophantine Equation$(x^2+x)(y^2-1)=240$ For whole numbers $x$ and $y$,  $$x,y | (x^2+x)(y^2-1)= 240$$
Find the biggest and smallest value for $x-y$.
How do you proceed with such a question?
Are their formulas or something for that type of equation?
I'd appreciate any help.
 [/INST] Notice that $y^2-1$ is adivisor of $240$; 
also we know that $-1 \leq y^2-1$, 
by checking throuh all divisors of $240$, 
we get the folowing possibilities for $y^2-1$:  


*

*$y^2-1=-1$ but there is no pair in this case. 

*$y^2-1=0$ but there is no pair in this case. 

*$y^2-1=3$ and $x^2+x=80$; 
but notice that there is no solution to the equation $x^2+x=80$; so there is no pair $(x,y)$ for the main equation, in this case. 

*$y^2-1=8$ and $x^2+x=30$; 
which gives $(x,y)=(5,\pm3)$ and $(x,y)=(-6,\pm3)$. 

*$y^2-1=15$ and $x^2+x=16$; 
but notice that there is no solution to the equation $x^2+x=16$; so there is no pair $(x,y)$ for the main equation, in this case. 

*$y^2-1=24$ and $x^2+x=10$; 
but notice that there is no solution to the equation $x^2+x=10$; so there is no pair $(x,y)$ for the main equation, in this case. 

*$y^2-1=48$; and $x^2+x=5$; 
but notice that there is no solution to the equation $x^2+x=5$; so there is no pair $(x,y)$ for the main equation, in this case. 

*$y^2-1=80$; and $x^2+x=3$; 
but notice that there is no solution to the equation $x^2+x=3$; so there is no pair $(x,y)$ for the main equation, in this case. 

*$y^2-1=120$ and $x^2+x=2$; 
which gives $(x,y)=(1,\pm11)$ and $(x,y)=(-2,\pm11)$.
</s>