## Task B-1.5.

Determine all integer solutions of the equation

$$
(m n-3)^{2}=m^{2}+n^{2}-4 m n
$$
## Solution.

Let's rewrite the given equation in a different form:

$$
\begin{aligned}
(m n-3)^{2} & =m^{2}+n^{2}-4 m n \\
(m n)^{2}-6 m n+9 & =m^{2}+n^{2}-4 m n \\
(m n)^{2}+9 & =m^{2}+n^{2}+2 m n \\
(m n)^{2}+9 & =(m+n)^{2}
\end{aligned}
$$

By moving the quadratic terms to one side of the equation and factoring the difference of squares, we get:

$$
\begin{aligned}
(m+n)^{2}-(m n)^{2} & =9 \\
(m+n-m n)(m+n+m n) & =9
\end{aligned}
$$

Since $m$ and $n$ are integers, from the last equation we get six possible cases:

1. $\left\{\begin{array}{l}m+n-m n=1 \\ m+n+m n=9\end{array}\right.$
2. $\left\{\begin{array}{l}m+n-m n=-1 \\ m+n+m n=-9\end{array}\right.$
3. $\left\{\begin{array}{l}m+n-m n=9 \\ m+n+m n=1\end{array}\right.$
4. $\left\{\begin{array}{l}m+n-m n=-9 \\ m+n+m n=-1\end{array}\right.$
5. $\left\{\begin{array}{l}m+n-m n=3 \\ m+n+m n=3\end{array}\right.$
6. $\left\{\begin{array}{l}m+n-m n=-3 \\ m+n+m n=-3\end{array}\right.$

In the first case, after adding and subtracting the given equations and rearranging, we obtain the system:

$$
\left\{\begin{aligned}
m+n & =5 \\
m n & =4
\end{aligned}\right.
$$

From the second equation, it follows that $(m, n) \in\{(1,4),(4,1),(-4,-1),(-1,-4),(-2,-2),(2,2)\}$. By substituting into the first equation, we conclude that the only solutions are $(m, n) \in\{(1,4),(4,1)\}$.

In the second case, we get the system:

$$
\left\{\begin{aligned}
m+n & =-5 \\
m n & =-4
\end{aligned}\right.
$$

From the second equation, it follows that $(m, n) \in\{(-1,4),(4,-1),(-4,1),(1,-4),(-2,2),(2,-2)\}$, but none of these ordered pairs are solutions to the given system, and thus not to the original equation.

In the third case, the system is

$$
\left\{\begin{aligned}
m+n & =5 \\
m n & =-4
\end{aligned}\right.
$$

Similarly, as in the previous case, we find that the system has no integer solutions.

In the fourth case, we solve the system

$$
\left\{\begin{aligned}
m+n & =-5 \\
m n & =4
\end{aligned}\right.
$$

whose solutions are $(m, n) \in\{(-1,-4),(-4,-1)\}$.

In the fifth case, we solve the system

$$
\left\{\begin{aligned}
m+n & =3 \\
m n & =0
\end{aligned}\right.
$$

whose solutions are $(m, n) \in\{(0,3),(3,0)\}$.

In the sixth case, we solve the system

$$
\left\{\begin{aligned}
m+n & =-3 \\
m n & =0
\end{aligned}\right.
$$

whose solutions are $(m, n) \in\{(0,-3),(-3,0)\}$.

Finally, all integer solutions to the original equation are:

$$
(m, n) \in\{(1,4),(4,1),(-1,-4),(-4,-1),(0,-3),(-3,0),(0,3),(3,0)\}
$$

## NATIONAL MATHEMATICS COMPETITION

## 2nd grade - high school - B variant

## April 25, 2023.