Example 1
Typing d/dx by hand does not create a differential expression. Instead, the d is simply a variable (and the same with dx).
>

$\frac{d}{\mathrm{dx}}{x}^{2}$

$\frac{{d}{}{{x}}^{{2}}}{{\mathrm{dx}}}$
 (2.1) 
Solution 1  Use the command completion
Use command completion to enter a differential expression. Start by typing 'diff', then press Esc. From the popup list, select the desired template.
In this case, we select
. It is inserted with the placeholder x selected. Type x (or whatever your variable is). Use the right arrow to exit the denominator, then type x^2.
>

$\frac{\ⅆ}{\ⅆx}{x}^{2}$

Tip: If you only need the $\ⅆ$ symbol and not the full template, type d and press Esc, and then select Differential 'd' from the popup list.
Solution 2  Use the Calculus palette
The Calculus palette (along with the Expression palette) provide templates for entering differential expressions.
Place your cursor in your document, then click the
template. Press Tab to go to the first placeholder ${x}$. Type x. Press Tab to go to the second placeholder. Type x^2. Press enter to execute. You can see this is now an expression for the derivative of ${x}^{2}$ with respect to $x$.
>

$\frac{\ⅆ}{\ⅆx}\left({x}^{2}\right)$

Note the parentheses around the expression that is being differentiated. In this case it works with or without the parenthesis, but for another expression, for example the polynomial ${x}^{2}40x6$, you must use parentheses:
>

$\frac{\ⅆ}{\ⅆx}\left({x}^{2}40x6\right)$

Solution 3  The diff command
You can also use the diff command to perform differentiation:
>

$\mathrm{diff}\left({x}^{2}\,x\right)$

See the diff help page for additional information.
Example 2  Prevent this warning from appearing
Suppose do you want to use d as a name (a variable), and did not intend it to mean the differential symbol
>

$\mathrm{dt}\u22540.01$

${\mathrm{dt}}{\u2254}{0.01}$
 (2.6) 
>

$\frac{d}{\mathrm{dt}}$

Solution
You can control whether parse warning messages appear via Typesetting:Settings.
>

$\mathrm{Typesetting}:\mathrm{Settings}\left(\mathrm{parserwarnings}\=\mathrm{false}\right)\:$

>

$\frac{d}{\mathrm{dt}}$

Now you do not see the warning message.