If $\frac{a+1}{b}+\frac{b}{a}$ is an integer then it is $3$. If $\frac{a+1}{b}+\frac{b}{a}$ is an integer for positive integers $a,b$ then prove that this integer is $3$.
I reduced the to prove that if $\frac{c^2+d^2+1}{cd}$ is an integer then it is $3$ where $c,d\in{\mathbb{N}}$. And this is equivalent to prove that the Pell's equation $x^2-(k^2-4)y^2=-4$ has solutions for $k=3$ only. But I dont know how to prove it.
 A: (The following answer  is quite similar to the one given by @math110, but I 
realized that only after arriving at my solution independently.
My formulation and the minimality condition is slightly different, so that I hope that it deserves
a separate answer.)
For fixed $k \in \mathbb N$, define the set of all solutions to 
$\frac{a+1}{b}+\frac{b}{a} = k$ as
$$
    S := \{ (a, b) \in \mathbb N^2 \mid a^2 + a + b^2 = kab \} \, .
$$
We want to proof that if $S$ is not empty then $k = 3$.
The proof is based on the following observations (similar to the
"Vieta Root Jumping" method):


*

*(i) If $(a, b) \in S$ then $(b^2/a, b) \in S$.

*(ii) If $(a, b) \in S$ then $(a, (a^2+a)/b) \in S$.


Proof of (i): $a$ is a solution of the quadratic equation
$$
   P(x) = x^2 - (kb-1)x + b^2 = 0 \, .
$$
It follows from Vieta's formulas that $a' = kb-1 -a \in \mathbb Z$ is the
other solution, and $aa' = b^2$, so that actually $a' \in \mathbb N$.
Therefore $(a', b) \in S$.
The proof of (ii) is the same, now considering $b$ as a solution of the quadratic equation
$$
   Q(y) = y^2 - (ka) y + (a^2 + a) = 0 \, .
$$
Finally we prove: If $S$ is not empty then $k = 3$.
The set $\{ a + b \mid (a, b) \in S \}$ is a non-empty set of positive
integers and therefore has a minimal element. Let $(a, b) \in S$ be such that $a + b$ is minimal.
Case 1: $a > b$. Then $a' = b^2/a < b < a$. From (i) we know that $(a', b)\in S$.
But $a' + b < a + b$ in contradiction to the minimality, so this case
cannot happen.
Case 2: $a < b$. Then $b' = (a^2+a)/b \le (a^2+a)/(a+1) = a < b$.
From (ii) we know that $(a, b') \in S$.
But $a + b' < a +b $ again in contradiction to the minimality, so this case
can also not happen.
That leaves us with Case 3: $a = b$. From
$$
  k = \frac{a+1}{b}+\frac{b}{a} = 2 + \frac 1b
$$
it follows that $b = 1$ and therefore $k = 3$ and we are done.
Remark: The proof has shown that if we start with an arbitrary solution $(a, b) \in S$
and apply the transformations (i), (ii) alternatingly, then we get a
sequence of solutions
$$
  (a, b) = (a_0, b_0), (a_1, b_1), \ldots (a_{n-1}, b_{n-1}), (a_n, b_n) = (1,1)
$$
where alternatingly $a_i < b_i$ or $a_i > b_i$ as long as $i < n$.
Since the transformations (i) and (ii) are self-inverse,
we can reverse the process to get all solutions iteratively
by starting with $(1,1)$ and then applying  (i) and (ii) alternatingly.
This gives the solutions
$$
  (1, 1), (1, 2), (4, 2), (4, 10), (25, 10), (25, 65), \ldots
$$ 
A: Let
$$\dfrac{a^2+a+b^2}{ab}=k,k\in N^{+}$$
so
$$b^2-ka\cdot b+a^2+a=0$$
case 1
if $a\le b$ and $b$ is minimum 
Now Assmue that  $b>a$,
then $b_{1}=ka-b\in Z$,and 
$$b\cdot b_{1}=a^2+a$$
so $b_{1}$ is postive integer number.
then
$$b_{1}=\dfrac{a^2+a}{b}<\dfrac{a^2+a}{a}=a+1$$ 
since $b_{1}>b\ge a+1$ impossible.
so $a=b$
then
$$a^2|(2a^2+a)\Longrightarrow a^2|a$$ then we have
$a=1,b=1$
so 
$$k=3$$
case 2: if $a\ge b$,then we consider
$$a^2+(1-kb)a+b^2=0$$
Now Assmue that $a>b$,and $a$ is minimum 
and 
$$a_{1}+a=kb-1\in Z,aa_{1}=b^2$$
then
$$a_{1}=\dfrac{b^2}{a}<b$$
impossible.
so $a=b$,then following is same as case 1
