Find all pairs $(a, b)$ of strictly positive integers such that $\frac{a^{2}+b}{b^{2}-a}$ and $\frac{b^{2}+a}{a^{2}-b}$ are integers.
Suppose spdg that $b \geq a$. We have $\frac{a^{2}+b}{b^{2}-a}$ is an integer, so $b^{2}-a \mid a^{2}+b$.

$b^{2}-a \leq a^{2}+b \Leftrightarrow b^{2}-a^{2} \leq a+b \Rightarrow b-a \leq 1 \Rightarrow a \leq b \leq a+1$ Therefore, we now have two possibilities: $a=b$ or $a=b+1$.

Verification of cases:

1) $a=b$

$a^{2}+b=a^{2}+a=a(a+1)$ and $b^{2}-a=a^{2}-a=a(a-1)$. Therefore, $a-1 \mid a+1$ which means $a-1 \mid 2$, so $a=2$ or $a=3$, and both values work.

2) $a+1=b$

$a^{2}-b=a^{2}-a-1$ and $b^{2}+a=a^{2}+3a+1$ so $a^{2}-a-1 \mid 4a+2$. Since $2 \mid a(a-1)$, $\operatorname{gcd}(a^{2}-a-1, 2)=1$, so $a^{2}-a-1 \mid 2a+1$. This gives us $a^{2} \leq 3a+2 \Rightarrow a \leq 3$. $a=1$ and $a=2$ work. However, for $a=3$, we have $a^{2}+3a+1=19$ and $a^{2}-a-1=5$. Therefore, we have a contradiction since 5 does not divide 19.

The solution pairs are therefore $(2,2),(3,3),(1,2),(2,3)$.