x\ne 2 \quad \Rightarrow\quad f(x)=\frac{x(x-1)}{x+2}