# Differentiation symbol

Generally, I use mathrm{d} for the differentiation symbol in math mode, x\,\mathrm{d}x? However, I sometimes feel that the spacing is not accurate. What is best practice, theoretical computer science and pure mathematics.