It is required to prove that for positive integers $a$,$b$ if $$1+ab|a^2+b^2$$ then the integer
$$\frac{a^2+b^2}{1+ab}$$
is a perfect square. The proof is easily beyond me as I have only recently started studying number theory or maybe I'm not intelligent enough. Help will be highly appreciated.