Historically, by which I mean professional typeset documents in early 20th century, it was upright d in both. It's often italic dx in maths now probably just because doing it right is tricky (at least non-zero effort) in LaTeX.
In many articles, there isn't even spacing around differentials. That doesn't mean that is correct too. It just means that, like upright d, the author has more pressing issues than small details of typesetting.
It similar to how vectors (in physics / applied maths) are represented by upright bold letter. Historically, these were bold-italic - the same as how most variables are italic. But early versions of TeX only supported fonts in regular, italic and bold - no bold italic variants existed (even now, bold italics are not universally available for Greek characters). So people used upright bold for vectors, and now it's assumed that it was deliberate.
In many articles, there isn't even spacing around differentials. That doesn't mean that is correct too. It just means that, like upright d, the author has more pressing issues than small details of typesetting.
It similar to how vectors (in physics / applied maths) are represented by upright bold letter. Historically, these were bold-italic - the same as how most variables are italic. But early versions of TeX only supported fonts in regular, italic and bold - no bold italic variants existed (even now, bold italics are not universally available for Greek characters). So people used upright bold for vectors, and now it's assumed that it was deliberate.