\(\displaystyle (5x^2+4x+1)/(x^2)\)

My book manages to simplify it to:

\(\displaystyle 5+(4/x)+(1/x^2)\)

How did it do this? I see that x^2 is in the denominator, I understand that it would cancel out \(\displaystyle 5x^2\) and leave us with 5. But I assumed that after that, the equation would look like this:

\(\displaystyle (5+4x+1)/1\) which equals \(\displaystyle (5+4x+1)\)

Which is incorrect. But I don't see why...