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.

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
