# How to find $x$ such that $a^2-b^2-(c+d)x=r^2$; $c^2-d^2+(a+b)x=s^2$

Let $a,b,c,d,r,s,x$ be integers. Find all integers $x$ such that the following quantities are integral squares: $$a^2-b^2-(c+d)x=r^2$$ $$c^2-d^2+(a+b)x=s^2$$ First, I noticed that if $$(a+b)(c+d)=0$$ then it is easy to solve. I supposed $(a+b)(c+d)\neq 0$. I tried to compare the 2 values of $x$, I did not get too far. Please help. Thanks.

• Are $a,b,c,d$ given? – Robert Israel Oct 1 '17 at 21:49
• @RobertIsrael, yes. The only unknown is $x$ – user97615 Oct 1 '17 at 21:50
• But surely $r$ and $s$ must be unknown as well? – Robert Israel Oct 1 '17 at 21:51

It should be obvious that if $a^2- b^2- (c+ d)x= r$ then $x= \frac{a^2- b^2- r}{c+ d}$. And if $c^2- d^2- (a- b)x= s$ then $x= \frac{c^2- d^2- s}{a- b}$.

In order that x satisfy both of those equations, it must be true that $\frac{a^2- b^2- r}{c+ d}= \frac{c^2- d^2- s}{a- b}$.

• $r^2$ and $s^2$, not $r$ and $s$ – Robert Israel Oct 1 '17 at 22:00
• That's what I did but it didn't take me too far – user97615 Oct 1 '17 at 22:17

Eliminating $x$, we get an equation

$$(a+b) r^2 + (c+d) s^2 = (a-b)(a+b)^2 +(c-d)(c+d)^2$$

If $a+b$ and $c+d$ have the same sign, there are finitely many integer solutions; if the signs are different, there may be infinitely many, but they can be parametrized (as a Pell-type equation).

You then look for integer solutions such that $r^2 - a^2 + b^2$ is divisible by $c+d$.

EDIT: For example, if $a=5, b=-3, c=5, d = -1$, the equation in $r$ and $s$ is $$2 r^2 + 4 s^2 = 128$$ whose integer solutions are $r = \pm 8$, $s=0$. This does have $r^2 - a^2 + b^2 = 48$ divisible by $c+d=4$, and we get $x = -12$.

• Great input.I am just wondering whether there is an easier method. – user97615 Oct 1 '17 at 22:45

For the system of equations.

\left\{\begin{aligned}&A^2-B^2-(C+D)X=R^2\\&C^2-D^2+(A+B)X=S^2\end{aligned}\right.

Make such a change.

$$a=x(t+p+z-x)+z(t+p-k)+k(k-t-p)+p^2-t^2$$

$$d=x(t+z-p-x)+z(t-p-k)+k(k-t+p)-(p-t)^2$$

$$b=x(p+z-t-x)+z(p-t-k)+k(k+t-p)+(p-t)^2$$

$$s=x(t+p+z-x)+z(t+p-3k)+k(3(k-p)+t-2x)+p^2-t^2$$

$$r=x(3(t-x)+2k-z-p)+z(t+p-k)+k(k-t-p)+p^2-t^2$$

$$c=x(t+p-z-x)+z(3t+k-p-2z)+k(k-t-p)+p^2-t^2$$

The solution can be written as.

$$A=r(r-c-d)+c(2a+s-c-d)+d(a+s)-a(s+r)+b^2$$

$$B=b(a+c-s-r)$$

$$X=(a-c+s-r)(a+c-s-r)$$

$$C=r(r-c-d)+c(2a-r-d)+d(a+s)+b^2-a^2$$

$$D=d(a+c-s-r)$$

$$R=r(a-s-d)+c(a+s-c-d)+d(a+s)+b^2-a^2$$

$$S=s(c-b-r)+r(a+b)-a(a+b-c)+d^2+bc-c^2$$

• Is this enlightening in some way? Would taking a moment to explain the process to this answer be asking too much? Is this what Math Stack Exchange is about? Your answer may be right but for those who bother signing up to a website like math stack exchange... the answer isn't enough. The answer with the derivation or proof is! – AmateurMathPirate Oct 7 '17 at 22:23
• I appreciate his effort. However, I cannot even verify the result. Please @individ, show us your methods. Thanks. – user97615 Oct 8 '17 at 4:11