I disagree with the other answers here.
$$\int x^2+2x \,\mathrm{d}x$$
is not correct; the integral needs to be written as
$$\int (x^2+2x) \,\mathrm{d}x$$
instead.
Think of the definite integral, which is really the source of this notation — the definite integral here would be a limit of sums of the form
$$\sum_k (x_k^{\,2}+2x_k) \,\Delta x,$$
not sums of the form
$$\sum_k x_k^{\,2}+2x_k\Delta x.$$
The standard notation works for integrals because you can treat the integral as similar to a summation, and you can treat the part after the integral sign as similar to a product of the integrand and $\mathrm{d}x.$ (Obviously this is just a similarity, not a rigorous definition, but it works in practice.)
Here's an example where it matters: If you want to use a change of variables and apply the substitution rule, you'll get the right answer if you start with
$$\int (x^2+2x) \,\mathrm{d}x$$
and apply the usual laws of algebra, but you will not get the right answer if you start with
$$\int x^2+2x \,\mathrm{d}x$$
instead. (You'll need to add the parentheses back in which should have been there all along.)
For those people who think otherwise, look in published math textbooks or journals and see what kind of usage you find. (If actual usage is different, I would certainly acknowledge that, along with a suggestion then that people should use parentheses when needed to treat this formally as a product of the integrand and $\mathrm{d}x,$ for the reasons I've stated.)
Best Answer
This is a conventional exception. If I were going to write $(f(x)+g(x))\,dx$, with no integral sign (e.g. when a differential equation is written as $a(x,y)\,dx+b(x,y)\,dy=0$ and the expression $a(x,y)$ or $b(x,y)$ has several terms) I would not omit the parentheses. Everything within the parentheses is multiplied by $dx$. If $f(x)+g(x)$ is in meters per second and $dx$ is in seconds, then $(f(x)+g(x))\,dx$. However, in something like $\displaystyle\int x^2+3x+10 \, dx$ it is quite conventional to omit delimeters. It is as if the expression $$ \int \cdots\cdots\cdots\cdots dx $$ acts in some way on whatever is written where "$\cdots\cdots\cdots\cdots$" appears.