Hello everyone

I am asked to find the asymptotes of $\displaystyle f(x)=\frac{x^2+1}{x+2} $

One of these is x=-2 , but when I try to arrive at the other asymptote, I get differing answers depending on the method I use.

First I tried to simplify the function

$\displaystyle

\frac{x^2 (1-\frac{1}{x^2})}{x(1+\frac{2}{x})}$

Looking at this it seems that when x approaches infinity, the function f(x) approaches the asymptote y=x.

However, if I use long division of polynomials of nested synthetic division I always get that the function will approach y=x-2.

Can someone please help me figure out what I'm doing wrong?