\(\displaystyle \frac{x^2+3x+1}{x+1}=\frac{x^2+3x+2-1}{x+1}=\frac{(x+2)(x+1)-1}{x+1}=x+2-\frac{1}{x+1}\)

But yeah, division is more general:

\(\displaystyle \begin{array}{c|rr}& 1 & 3 & 1 \\ -1 & & -1 & -2 \\ \hline & 1 & 2 & -1 \end{array}\)

This tells us:

\(\displaystyle \frac{x^2+3x+1}{x+1}=x+2-\frac{1}{x+1}\)