Notation of the differential operator I see the differential operator both with upright and italic d in different books/articles. So I'm curious about
$$ \int x^2 \, dx \quad \text{vs.} \quad \int x^2\, \mathrm{d}x,$$
and
$$\frac{d}{dx}f(x) \quad \text{vs.} \quad \frac{\mathrm{d}}{\mathrm{d}x}f(x).$$
Is there a convention which of these notations should be used?
 A: There is no difference between them. It merely comes as a result of a choice in LaTeX formatting; specifically, some people write "\text{d}" (or some equivalent) for the upright formatting, but many other people don't do this for the sake of speed, and instead just write "d".
A: In Germany, there is the DIN 1338 standard, according to which the differntial operator d, as, e.g., e for the Euler number, should be typeset as an upright letter.
According to Wikipedia, these letters are typeset in italic if AMS conventions are used.
A: This is more of an extended comment than an answer, but with regards to typesetting in $\LaTeX$, let me point out that typing \mathrm{d} should not take longer than typing d, as you shouldn't be doing either throughout your paper!
The semantically correct thing to do is to define a macro representing your desired differential operator, for example, \newcommand{\dv}[1]{\frac{\mathrm{d}}{\mathrm{d} #1}}. Then, whenever you need to typeset $\frac{\mathrm{d}}{\mathrm{d}x}$ or $\frac{\mathrm{d}}{\mathrm{d}t}$, you simply use \dv{x} or \dv{t}, which is even easier than the non-standards-conforming \frac{d}{dx}.
This has the added benefit that, should you find yourself submitting to a publisher whose house style requires italic $d$'s, you need only change the definition of your macro instead of modifying every differential operator by hand.
A: Many excellent journals and books use $d$ in the italics form, such as the Journal of the American Mathematical Society (e.g., recent article by Terence Tao), London Mathematical Society Proceedings (e.g., equations 74 and 75 of this recent paper) and Spivak's Calculus.
Given that reference quality publications use $d$--and that it is faster and cleaner to typeset it that way--the italics form is more than respectable. 
A: Quick answer: there is a standard to follow.
Longer answer: while physicists write differential operators in upright fonts (because they follow the standards), mathematicians tend to typeset differential operators as variables (because we are lazy). I am joking, but it should be clear that $dx$ is not $d \cdot x$, and that $d$ is essentially an operator: therefore it is always preferable to write $\mathrm{d}x$ instead. Many journals change $dx$ to $\mathrm{d}x$ after accepting a manuscript for publications.
A: By logic I think that is a good idea differentiate the symbol with the roman notation but there isnt a "standard", you can use any of them.
In the same sense doesnt exist any kind of "standard" mathematical notation. I read a lot of books of many mathematical topics, everyone with different notations, not only just the infinitesimal symbol.
The problem, writing on LATEX, is that it take more time to write $\color{red}{\mathrm d}$ instead of just $\color{red}{d}$.
A: The AMS Style Guide (October 2017) appears to use italics, ex. pages 102, 115, though interestingly there is an example of upright d on p. 32.
In a discussion on Wikipedia from 2005, Toby Bartels brought up a possibility that it is a US/UK difference, though personally I haven't seen evidence of this.
Another wikipedia discussion with an anonymous answer that sampled a bunch of books and found different styles: https://en.wikipedia.org/wiki/Talk:Differential_(infinitesimal)#d_versus_d
