# Wolfram Function Repository

Instant-use add-on functions for the Wolfram Language

Function Repository Resource:

Compute the directional derivative of a function

Contributed by:
Wolfram Staff (original content by Alfred Gray)

ResourceFunction["DirectionalD"][ computes the derivative of a function |

The directional derivative of a function *f* at the point *p *along an arbitrary vector represents the instantaneous rate of change of the function at that direction.

ResourceFunction["DirectionalD"] is a generalization of a partial derivative in which the rate of change is taken with respect to one of the variables, considering the rest as constant.

The directional derivative is formally defined as , where is the vector that indicates the direction.

An alternative definition of the directional derivative is taken to be with respect to a normalized arbitrary nonzero vector .

Other notations for the directional derivative are , , , , , , and .

Directional derivative of a function of two variables:

In[1]:= |

Out[1]= |

Directional derivative of a function of three variables:

In[2]:= |

Out[2]= |

Directional derivative with a zero component in one direction:

In[3]:= |

Out[3]= |

A unit vector along direction (3/2,1):

In[4]:= |

Out[4]= |

Without normalization:

In[5]:= |

Out[5]= |

Evaluated at the point *p*=(3/2,1):

In[6]:= |

Out[6]= |

Define a function:

In[7]:= |

Compute the directional derivative:

In[8]:= |

Out[8]= |

Directional derivative in the direction (-1,-1/2) evaluated at the point (-1,3/2):

In[9]:= |

Out[9]= |

A plot of the directional derivative:

In[10]:= |

Out[10]= |

Visualize directional derivatives over a surface:

In[11]:= |

Out[12]= |

The directional derivative (red) and the gradient (blue):

In[13]:= |

Out[13]= |

- 2.0.0 – 01 October 2020
- 1.0.0 – 15 June 2020

This work is licensed under a Creative Commons Attribution 4.0 International License