Defining Derivatives

You can define the derivative in the Wolfram Language of a function f of one argument simply by an assignment like f'[x_]=fp[x].

This defines the derivative of f(x) to be fp(x). In this case, you could have used = instead of :=:

f'[x_]:=fp[x]

The rule for f'[x_] is used to evaluate this derivative:

D[f[x^2],x]

Differentiating again gives derivatives of fp:

D[%,x]

This defines a value for the derivative of g at the origin:

g'[0]=g0

The value for g'[0] is used:

D[g[x]^2,x]/.x->0

This defines the second derivative of g, with any argument:

g''[x_]=gpp[x]

The value defined for the second derivative is used:

D[g[x]^2,{x,2}]

To define derivatives of functions with several arguments, you have to use the general representation of derivatives in the Wolfram Language.

Defining derivatives.

This defines the second derivative of g with respect to its second argument:

Derivative[0,2][g][x_,y_]:=g2p[x,y]

This uses the definition just given:

D[g[a^2,x^2],x,x]