$\textbf{Question:}$Find all positive integers $a, b$ such that the expression $$\frac{a^2+b^2+1}{ab-1}$$ is an integer.
$$$$As the expression is symmetric in $a, b$, so let $a \geq b$. It is easy to check the cases when $a=b+k$ where $0 \leq k \leq 2$, so let $a \geq b+3$. Suppose $a, b$ satisfies the given condition with $a+b$ minimized. Let us write $$\frac{a^2+b^2+1}{ab-1}=k$$ then our equation becomes $$a^2-kab+b^2+k+1=0$$. Now this equation has a root $a$ and from the Viet's formula we get the second root $$a'=kb-a$$ and $$a'=\frac{b^2+k+1}{a}$$. Now the first equation shows that $a'$ is an integer and the second equation shows that $a'$ is a positive integer. Now to show that $a' < a$ we have to prove that $$a'=\frac{b^2+k+1}{a} < a$$. Now consider $$a^2-(b^2+k+1)=a^2-b^2-1-k=a^2-b^2-1-(\frac{a^2+b^2+1}{ab-1})=\frac{a^3b-ab^3-ab-a^2+b^2+1-(a^2+b^2+1)}{ab-1}=\frac{a(a^2b-b^3-b-2a)}{ab-1}$$. Now as $a \geq b+3$ so we have $$a^2b-2a=a(ab-2) \geq a((b+3)(b)-2)=a(b^2+3b-2) \geq a(b^2+1) > b(b^2+1) > b^3+b$$ and hence we get $\frac{a(a^2b-b^3-b-2a)}{ab-1}>0$ and hence we have $a' < a$ and hence $a'+b < a+b$ contradicting the minimality of $a+b$. So there are no solutions. $$$$Is My Proof Correct??



I wrote and ran some Mathematica code:
Running the code gives:
Where the code looks for integer solutions to your problem given as $\left(\text{a},\text{b},\frac{\text{a}^2+\text{b}^2+1}{\text{a}\text{b}-1}\right)$.
So, we can see that your claim that there are no solutions is certainly not true for $2\le\text{a}\le10^4$ and $2\le\text{b}\le10^4$.