2. (5 points) Solve the equation in integers

$$
x^{2}-y^{2}+2(a+b) x+2(a-b) y=p-4 a b \quad p \in \mathbb{P}
$$

In your answer, write the smallest value of the variable $x$.
Solution: We transform our equation to the form

$$
\left(x^{2}+2(a+b) x+(a+b)^{2}\right)-\left(y^{2}-2(a-b) y+(a-b)^{2}\right)=p
$$

We get

$$
(x+a+b)^{2}-(y-a+b)^{2}=p
$$

or

$$
(x-y+2 a) \cdot(x+y+2 b)=p
$$

We obtain four possible cases

$$
\left\{\begin{array} { l } 
{ x - y + 2 a = 1 } \\
{ x + y + 2 b = p }
\end{array} \quad \left\{\begin{array} { l } 
{ x - y + 2 a = - 1 } \\
{ x + y + 2 b = - p }
\end{array} \quad \left\{\begin{array} { l } 
{ x - y + 2 a = p } \\
{ x + y + 2 b = 1 }
\end{array} \quad \left\{\begin{array}{l}
x-y+2 a=-p \\
x+y+2 b=-1
\end{array}\right.\right.\right.\right.
$$

We find $x$ and $y$

$$
\left\{\begin{array} { l } 
{ x = \frac { p + 1 } { 2 } - a - b } \\
{ y = \frac { p - 1 } { 2 } + a - b }
\end{array} \left\{\begin{array} { l } 
{ x = \frac { - p - 1 } { 2 } - a - b } \\
{ y = \frac { 1 - p } { 2 } + a - b }
\end{array} \left\{\begin{array} { l } 
{ x = \frac { p + 1 } { 2 } - a - b } \\
{ y = \frac { 1 - p } { 2 } + a - b }
\end{array} \left\{\begin{array}{l}
x=\frac{-p-1}{2}-a-b \\
y=\frac{p-1}{2}+a-b
\end{array}\right.\right.\right.\right.
$$

The minimum value of $x=-\frac{p+1}{2}-a-b$.

## Answers:

| Option | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
| :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: |
| Answer | -58 | -59 | -59 | -60 | -61 | -62 | -64 | -65 | -56 | -57 | -119 |