This is documentation for Mathematica 5, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.1)

Documentation / Mathematica / The Mathematica Book / Advanced Mathematics in Mathematica / Calculus /

3.5.1 Differentiation

Partial differentiation operations.

This gives .

In[1]:= D[x^n, x]

Out[1]=

This gives the third derivative.

In[2]:= D[x^n, {x, 3}]

Out[2]=

You can differentiate with respect to any expression that does not involve explicit mathematical operations.

In[3]:= D[ x[1]^2 + x[2]^2, x[1] ]

Out[3]=

D does partial differentiation. It assumes here that y is independent of x.

In[4]:= D[x^2 + y^2, x]

Out[4]=

If y does in fact depend on x, you can use the explicit functional form y[x]. Section 3.5.4 describes how objects like y'[x] work.

In[5]:= D[x^2 + y[x]^2, x]

Out[5]=

Instead of giving an explicit function y[x], you can tell D that y implicitly depends on x. D[y, x, NonConstants->{y}] then represents , with y implicitly depending on x.

In[6]:= D[x^2 + y^2, x, NonConstants -> {y}]

Out[6]=