11.5. Find all pairs of natural numbers $a$ and $b$ such that both numbers $\frac{a^{2}+b}{b^{2}-a}$ and $\frac{b^{2}+a}{a^{2}-b}$ are integers.
Answer. $(a, b)=(2,2),(3,3),(1,2),(2,1),(2,3),(3,2)$ - six pairs.

Solution. When $a$ is replaced by $b$ and $b$ by $a$, the fractions in the condition swap places, so we can immediately assume that $a \leq b$, adding the symmetric solutions obtained later. In this case, the case $a=b=1$ is excluded due to the inequality $b^{2}-a \neq 0$, so $b^{2}-a>0$ and the first fraction must be a natural number. Therefore, $a^{2}+b=n\left(b^{2}-a\right) \geq b^{2}-a$, which means $a+b \geq b^{2}-a^{2}=(a+b)(b-a)$. Dividing by the natural number $a+b>0$, we get $b-a \leq 1$. Considering the inequality $a \leq b$, we get $a=b$ or $b=a+1$.

In the first case, $\frac{a^{2}+b}{b^{2}-a}=\frac{a^{2}+a}{a^{2}-a}=\frac{a+1}{a-1}=1+\frac{2}{a-1}$ is a natural number, and $a-1$ divides 2, so $a=2$ or $a=3$. In this case, the second fraction is equal to the first, so both options are valid. We get two solutions here: $a=b=2$ and $a=b=3$.

In the second case, $\frac{a^{2}+b}{b^{2}-a}=\frac{a^{2}+a+1}{a^{2}+a+1}=1, \frac{b^{2}+a}{a^{2}-b}=\frac{a^{2}+3 a+1}{a^{2}-a-1}=1+\frac{4 a+2}{a^{2}-a-1}$, so $4 a+2$ is divisible by $a^{2}-a-1$. The latter is a natural number for natural $a \geq 2$, since the minimum value of this quadratic function is achieved at $a=\frac{1}{2}$, it increases for $x \geq \frac{1}{2}$, and is positive for $a=2$. Therefore, it must be $4 a+2 \geq a^{2}-a-1$, which means $a^{2}-5 a-3 \leq 0$. Solving the quadratic inequality, we get $a \in\left(\frac{5-\sqrt{37}}{2}, \frac{5+\sqrt{37}}{2}\right)$, so $a=1,2,3,4,5$. Checking by substitution, $a=1,2$ are valid, while $a=3,4,5$ are not. We get two more solutions: $a=1, b=2$ and $a=2, b=3$. Note that in the first of these cases, the second fraction will be an integer -5, which is allowed by the condition. It remains to add the symmetric solutions $a=2, b=1$ and $a=3, b=2$, and we get the complete answer: $(a, b)=(2,2),(3,3),(1,2),(2,1),(2,3),(3,2)$ - a total of six pairs of solutions.

Grading criteria. Correctly obtained that $a=b$ or $b=a+1$: 3 points. Only solutions with $a=b$ found: 2 points. Only solutions with $a+1=b$ found: 2 points. Forgot to add symmetric solutions: minus 1 point. Solutions $a=1, b=2$ and $a=2, b=1$ incorrectly excluded due to the negativity of one of the fractions in the condition: minus 2 points. Lack of checks in cases $a=1, b=2$ and $a=2, b=3$: minus 1 point.