6.7. Directional derivatives

From the mathematical point of view, the simplest concept of a derivative is that of a "derivation", a mapping from scalar fields to scalar fields. In fact, the concept of tanget space at a point is constructed as the space of derivations at that point. We can work with operators acting as derivations (or "directional derivatives") using the Dir head.

The object PD[Dir[v[a]]] can be interpreted as the directional derivative along the vector v[a]:

In[503]:=

PD[Dir[w[a]]][r[]]

Out[503]=

∂_w^ r_^

and it has all the expected properties:

In[504]:=

PD[Dir[ 3S[a, Dir[v[-b]]] + w[a] ]][ 1/r[]^2 ]

Out[504]=

-(2 (3 ∂_#^ r_^ + ∂_w^ r_^))/r_^^3

Actually, it is possible to work directly with the derivations acting on scalars, saving 6 brackets (!) in the notation. For example we define the derivation wder associated to the vector w[a]:

In[505]:=

wder := PD[Dir[w[a]]]

In[506]:=

wder[ r[] ]

Out[506]=

∂_w^ r_^

Or even better, in prefix notation:

In[507]:=

wder @ r[]

Out[507]=

∂_w^ r_^

In[508]:=

ScalarQ[%]

Out[508]=

True


Created by Mathematica  (May 16, 2008) Valid XHTML 1.1!