 DirectionalDiff - Maple Help

Home : Support : Online Help : Physics : Vectors : DirectionalDiff

Physics[Vectors][DirectionalDiff] - the directional derivative Calling Sequence DirectionalDiff(A, B_) Parameters

 A - any algebraic (vectorial or scalar) expression B_ - a vector Description

 • DirectionalDiff(A, B_) computes the directional derivative of $A$ in the direction of $\mathrm{B_}$, that is, the scalar product of a unitary vector in the direction of $\mathrm{B_}$ times Nabla - the differential operator - applied to the function A. Two cases can happen:
 1 $A$ is not a vector. Hence $\mathrm{DirectionalDiff}\left(A,\mathrm{B_}\right)=\left(\frac{\mathrm{B_}}{\mathrm{Norm}\left(\mathrm{B_}\right)}\right)·\nabla \left(A\right)$
 2 $\mathrm{A_}$ is a vector. Hence $\mathrm{DirectionalDiff}\left(\mathrm{A_},\mathrm{B_}\right)=\frac{\left(\mathrm{B_}·\nabla \right)·\mathrm{A_}}{\mathrm{Norm}\left(\mathrm{B_}\right)}$
 • The %DirectionalDiff is the inert form of DirectionalDiff, that is: it represents the same mathematical operation while holding the operation unperformed. To activate the operation use value. Examples

 > $\mathrm{with}\left(\mathrm{Physics}\left[\mathrm{Vectors}\right]\right)$
 $\left[{\mathrm{&x}}{,}{\mathrm{+}}{,}{\mathrm{.}}{,}{\mathrm{ChangeBasis}}{,}{\mathrm{ChangeCoordinates}}{,}{\mathrm{Component}}{,}{\mathrm{Curl}}{,}{\mathrm{DirectionalDiff}}{,}{\mathrm{Divergence}}{,}{\mathrm{Gradient}}{,}{\mathrm{Identify}}{,}{\mathrm{Laplacian}}{,}{\nabla }{,}{\mathrm{Norm}}{,}{\mathrm{Setup}}{,}{\mathrm{diff}}\right]$ (1)
 > $\mathrm{Setup}\left(\mathrm{mathematicalnotation}=\mathrm{true}\right)$
 $\left[{\mathrm{mathematicalnotation}}{=}{\mathrm{true}}\right]$ (2)

The definition of directional derivative

 > $\mathrm{DirectionalDiff}\left(a\left(x,y,z\right),\mathrm{_i}\right)=\left(\mathrm{_i}·\nabla \right)\left(a\left(x,y,z\right)\right)$
 $\frac{{\partial }}{{\partial }{x}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{a}{}\left({x}{,}{y}{,}{z}\right){=}\frac{{\partial }}{{\partial }{x}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{a}{}\left({x}{,}{y}{,}{z}\right)$ (3)

Directional derivative in spherical coordinates

 > $\mathrm{DirectionalDiff}\left(a\left(r,\mathrm{\theta },\mathrm{\phi }\right),\mathrm{_θ}\right)=\left(\mathrm{_θ}·\nabla \right)\left(a\left(r,\mathrm{\theta },\mathrm{\phi }\right)\right)$
 $\frac{\frac{{\partial }}{{\partial }{\mathrm{\theta }}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{a}{}\left({r}{,}{\mathrm{\theta }}{,}{\mathrm{\phi }}\right)}{{r}}{=}\frac{\frac{{\partial }}{{\partial }{\mathrm{\theta }}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{a}{}\left({r}{,}{\mathrm{\theta }}{,}{\mathrm{\phi }}\right)}{{r}}$ (4)

Directional derivative of a vector function

 > $R≔a\left(x,y,z\right)\mathrm{_i}+b\left(x,y,z\right)\mathrm{_j}+c\left(x,y,z\right)\mathrm{_k}$
 ${R}{≔}{a}{}\left({x}{,}{y}{,}{z}\right){}\stackrel{{\wedge }}{{i}}{+}{b}{}\left({x}{,}{y}{,}{z}\right){}\stackrel{{\wedge }}{{j}}{+}{c}{}\left({x}{,}{y}{,}{z}\right){}\stackrel{{\wedge }}{{k}}$ (5)
 > $\mathrm{DirectionalDiff}\left(R,\mathrm{_i}\right)=\left(\mathrm{_i}·\nabla \right)\left(R\right)$
 $\left(\frac{{\partial }}{{\partial }{x}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{a}{}\left({x}{,}{y}{,}{z}\right)\right){}\stackrel{{\wedge }}{{i}}{+}\left(\frac{{\partial }}{{\partial }{x}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{b}{}\left({x}{,}{y}{,}{z}\right)\right){}\stackrel{{\wedge }}{{j}}{+}\left(\frac{{\partial }}{{\partial }{x}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{c}{}\left({x}{,}{y}{,}{z}\right)\right){}\stackrel{{\wedge }}{{k}}{=}\left(\frac{{\partial }}{{\partial }{x}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{a}{}\left({x}{,}{y}{,}{z}\right)\right){}\stackrel{{\wedge }}{{i}}{+}\left(\frac{{\partial }}{{\partial }{x}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{b}{}\left({x}{,}{y}{,}{z}\right)\right){}\stackrel{{\wedge }}{{j}}{+}\left(\frac{{\partial }}{{\partial }{x}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{c}{}\left({x}{,}{y}{,}{z}\right)\right){}\stackrel{{\wedge }}{{k}}$ (6)

Note that, when the vector which defines the direction (the second argument) is projected over one coordinate system, the function being differentiated is expected to be expressed using the same coordinate system; otherwise an error interruption happens and a corresponding message is displayed

 > $\mathrm{DirectionalDiff}\left(a\left(x,y,z\right),\mathrm{_r}\right)$

For this example, correct input could be

 > $\mathrm{DirectionalDiff}\left(a\left(x,y,z\right),\mathrm{ChangeBasis}\left(\mathrm{_r},1\right)\right)$
 $\frac{\left(\frac{{\partial }}{{\partial }{x}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{a}{}\left({x}{,}{y}{,}{z}\right)\right){}{\mathrm{sin}}{}\left({\mathrm{\theta }}\right){}{\mathrm{cos}}{}\left({\mathrm{\phi }}\right){+}\left(\frac{{\partial }}{{\partial }{y}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{a}{}\left({x}{,}{y}{,}{z}\right)\right){}{\mathrm{sin}}{}\left({\mathrm{\theta }}\right){}{\mathrm{sin}}{}\left({\mathrm{\phi }}\right){+}\left(\frac{{\partial }}{{\partial }{z}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{a}{}\left({x}{,}{y}{,}{z}\right)\right){}{\mathrm{cos}}{}\left({\mathrm{\theta }}\right)}{\sqrt{{{\mathrm{cos}}{}\left({\mathrm{\phi }}\right)}^{{2}}{}{{\mathrm{sin}}{}\left({\mathrm{\theta }}\right)}^{{2}}{+}{{\mathrm{sin}}{}\left({\mathrm{\phi }}\right)}^{{2}}{}{{\mathrm{sin}}{}\left({\mathrm{\theta }}\right)}^{{2}}{+}{{\mathrm{cos}}{}\left({\mathrm{\theta }}\right)}^{{2}}}}$ (7)
 > See Also