Is $\frac{x^2+x}{x+1}$ a polynomial?
Solution 1:
You seem to know well enough how it is with this function: It equals $x$ whenever $x$ is not $-1$, and the expression is not defined for $x=-1$.
Whether it makes sense to care about the missing point depends on what you're doing!
Sometimes it is important to consider this to be a different function from the identity. This is especially the case in school algebra classes where a point is made of teaching the students not to be too cavalier about whether the expressions they manipulate are defined at the points they need to be.
At other times the difference is not really worth caring about. Sometimes it is even explicitly declared not to matter at all -- such as if we're speaking about the field of rational functions in one variable, where $x^2+x$ divided by $x+1$ is simply $x$, no ifs or buts.
It's up to you to know enough about what you're trying to achieve to make an intelligent choice between these two approaches.
Solution 2:
In abstract algebra, within the field $\mathbb{R}(x)$ of formal rational expressions in the variable $x$, with distinguished subring $\mathbb{R}[x]$ of formal polynomial expressions in the variable $x$, the quotient of $x^2+x$ by $x+1$ is indeed just $x$, which is a polynomial expression.
In analysis, one cannot substitute $-1$ in for $x$ into the expression $(x^2+x)/(x+1)$, so at most the domain of the corresponding function can be $\mathbb{R}\setminus\{-1\}$. It does, however, have a removable discontinuity at the point $x=-1$, and the discontinuity may be removed by defining the expression to be $-1$ when $x=-1$. It is sometimes typical to abuse definitions by identifying a function, defined by a symbolic expression and having a restricted domain, with a function on a larger domain obtained by removing all removable discontinuities. While in the process of this abuse, we may say that $(x^2+x)/(x+1)$ is $x$.
Solution 3:
At a primary school level the function is a rational function, not a polynomial.
For an academic level answer, other answers are good and correct, but I think there is another interesting context. If you are using the Lebesgue measure (or any non-atomic measure) on $\mathbb{R}$ then $\frac{x^2+x}{x+1}$ is the same as $x$ as they are in the same equivalence class, as they differ on a set of measure zero.