
Calling Sequence


D_Dx(expression, x, ... , DepVars, 'options'='value')


Parameters


expression



any algebraic expression or algebraic equation

x, ...



differentiation variables, can include functions of the jet spece (dependent variables) or their derivatives

DepVars



a function or a list of them indicating the dependent variables of the problem

jetnotation = ...



(optional) can be true (default, the notation found in expression), false (function notation), jetvariables, jetvariableswithbrackets, jetnumbers or jetODE; to respectively return or not using the different jet notations available





Description


•

The D_Dx command computes total derivatives, as diff does, but for D_Dx the input and/or the output can be in jet notation. Also, D_Dx can compute partial derivatives with respect to dependent variables of the jet space (functions in DepVars) or their derivatives. D_Dx also works with anticommutative variables set using the Physics package.

•

The first argument, expression, is the object being differentiated, followed by the differentiation variables, and then the last argument, $\mathrm{DepVars}$, is always an indication of the dependent variables of the problem, either as a function (could be that way when there is only one) or as a list of them.

•

The differentiation variables can include any name but also functions of the jet space, that is, functions in DepVars or their partial derivatives. When the differentiation variable is a name the total derivative is computed, so for instance $x$, $f\left(x\right)$ and $\mathrm{f\text{'}}\left(x\right)$ are all considered functions of $x$. When the differentiation variable is a function, however, a partial derivative is computed in that, for instance, $f\left(x\right)$ and $\mathrm{f\text{'}}\left(x\right)$ are considered independent objects. This permits computing in a natural way objects like

$\frac{\ⅆ}{\ⅆt}\left(\frac{\partial}{\partial \stackrel{\mathbf{.}}{x}}L\left(x\left(t\right),\stackrel{\mathbf{.}}{x}\left(t\right)\right)\right)=\mathrm{D\_Dx}\left(L\left(x\left(t\right),\stackrel{\mathbf{.}}{x}\left(t\right)\right),\stackrel{\mathbf{.}}{x}\left(t\right),t,\left[x\left(t\right)\right]\right)$

where the righthandside is entered as D_Dx(L(x(t), diff(x(t), t)), diff(x(t), t), t, [x(t)]) and means to differentiate $L\left(x\left(t\right),\stackrel{\mathbf{.}}{x}\left(t\right)\right)$ with respect to $\stackrel{\mathbf{.}}{x}\left(t\right)$ followed by taking the total derivative with respect to $t$, taking $\left[x\left(t\right)\right]$ as the dependent variable defining the jet space.

•

The output is by default expressed in the jetnotation found in the input expression, whenever expression is written using jetnotation, or otherwise it is expressed in jetvariables notation when expression is passed in standard function notation. This default can be changed by passing the optional argument jetnotation = ..., where the right hand side can be false (to return in function notation), jetnumbers, jetvariables, jetvariableswithbrackets or jetODE; see the jet notations available.



Examples


Consider a PDE problem with three dependent variables
>

with(PDEtools, D_Dx, ToJet, FromJet);

$\left[{\mathrm{D\_Dx}}{\,}{\mathrm{ToJet}}{\,}{\mathrm{FromJet}}\right]$
 (1) 
>

DepVars := [u(x,t), v(t), w(y)];

${\mathrm{DepVars}}{\u2254}\left[{u}{}\left({x}{\,}{t}\right){\,}{v}{}\left({t}\right){\,}{w}{}\left({y}\right)\right]$
 (2) 
>

PDE := diff(u(x,t)*v(t)*w(y),x) + diff(u(x,t)*v(t)*w(y),t,y);

${\mathrm{PDE}}{\u2254}\left(\frac{{\partial}}{{\partial}{x}}\phantom{\rule[0.0ex]{0.4em}{0.0ex}}{u}{}\left({x}{\,}{t}\right)\right){}{v}{}\left({t}\right){}{w}{}\left({y}\right){+}\left(\frac{{\partial}}{{\partial}{t}}\phantom{\rule[0.0ex]{0.4em}{0.0ex}}{u}{}\left({x}{\,}{t}\right)\right){}{v}{}\left({t}\right){}\left(\frac{{\ⅆ}}{{\ⅆ}{y}}\phantom{\rule[0.0ex]{0.4em}{0.0ex}}{w}{}\left({y}\right)\right){+}{u}{}\left({x}{\,}{t}\right){}\left(\frac{{\ⅆ}}{{\ⅆ}{t}}\phantom{\rule[0.0ex]{0.4em}{0.0ex}}{v}{}\left({t}\right)\right){}\left(\frac{{\ⅆ}}{{\ⅆ}{y}}\phantom{\rule[0.0ex]{0.4em}{0.0ex}}{w}{}\left({y}\right)\right)$
 (3) 
Using the standard diff command you can compute the total derivative of this expression with respect to $x,t$ or $y$. It is not possible, however, to differentiate $\mathrm{PDE}$ with respect to any of the functions in $\mathrm{DepVars}$ or its partial derivatives. For that purpose you can use D_Dx
>

D_Dx(PDE, w(y), DepVars);

Note that the result is presented in jetvariables jet notation, a compact mathematical notation understood by all the symmetry commands of PDEtools. To have this result expressed in function notation use FromJet or directly call D_Dx with the option jetnotation = false
${v}{}\left({t}\right){}\left(\frac{{\partial}}{{\partial}{x}}\phantom{\rule[0.0ex]{0.4em}{0.0ex}}{u}{}\left({x}{\,}{t}\right)\right)$
 (5) 
>

D_Dx(PDE, w(y), DepVars, jetnotation = false);

${v}{}\left({t}\right){}\left(\frac{{\partial}}{{\partial}{x}}\phantom{\rule[0.0ex]{0.4em}{0.0ex}}{u}{}\left({x}{\,}{t}\right)\right)$
 (6) 
In this other example it is computed the partial derivative with respect to $\frac{\partial}{\partial x}\phantom{\rule[0.0ex]{0.4em}{0.0ex}}u\left(x\,t\right)$ followed by the total derivative with respect to $t$
>

D_Dx(PDE, u[x], t, DepVars);

In the input above, instead of u[x] you can write diff(u(x,t), x) (function notation) or u[1] (this is the jetnumbers jetnotation), all of them representing the same mathematical object.
You can also work with $\mathrm{PDE}$ directly in more compact jetnotation; compare with (4.3)
>

JPDE := ToJet(PDE, DepVars);

${\mathrm{JPDE}}{\u2254}{u}{}{{v}}_{{t}}{}{{w}}_{{y}}{+}{v}{}{w}{}{{u}}_{{x}}{+}{v}{}{{u}}_{{t}}{}{{w}}_{{y}}$
 (8) 
Compute now the total derivative with respect to $t$ comparing the results of differentiating $\mathrm{PDE}$ and its jet version $\mathrm{JPDE}$
${u}{}{{v}}_{{t}{,}{t}}{}{{w}}_{{y}}{+}{v}{}{w}{}{{u}}_{{x}{,}{t}}{+}{v}{}{{u}}_{{t}{,}{t}}{}{{w}}_{{y}}{+}{w}{}{{u}}_{{x}}{}{{v}}_{{t}}{+}{2}{}{{u}}_{{t}}{}{{v}}_{{t}}{}{{w}}_{{y}}$
 (9) 
>

D_Dx(JPDE, t, DepVars);

${u}{}{{v}}_{{t}{,}{t}}{}{{w}}_{{y}}{+}{v}{}{w}{}{{u}}_{{x}{,}{t}}{+}{v}{}{{u}}_{{t}{,}{t}}{}{{w}}_{{y}}{+}{w}{}{{u}}_{{x}}{}{{v}}_{{t}}{+}{2}{}{{u}}_{{t}}{}{{v}}_{{t}}{}{{w}}_{{y}}$
 (10) 


