# Defining Derivatives

You can define the derivative in *Mathematica* of a function of one argument simply by an assignment like .

This defines the derivative of

to be

. In this case, you could have used

instead of

.

The rule for

is used to evaluate this derivative.

Out[2]= | |

Differentiating again gives derivatives of

.

Out[3]= | |

This defines a value for the derivative of

at the origin.

Out[4]= | |

The value for

is used.

Out[5]= | |

This defines the second derivative of

, with any argument.

Out[6]= | |

The value defined for the second derivative is used.

Out[7]= | |

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

f'[x_]:=rhs | define the first derivative of f |

Derivative[n][f][x_]:=rhs | define the n derivative of f |

Derivative[m,n,...][g][x_,_,...]:=rhs |

| define derivatives of g with respect to various arguments |

Defining derivatives.

This defines the second derivative of

with respect to its second argument.

This uses the definition just given.

Out[9]= | |