 dsubs - Maple Help

PDEtools

 dsubs
 perform differential substitutions into expressions Calling Sequence dsubs(deriv=a, expr) dsubs(deriv1=a, '...', expr) Parameters

 a, expr - differential expressions deriv - derivative for which to substitute deriv1, '...' - equation or sequence of substitution equations Description

 • dsubs substitutes the given sequence of equations into expr from left to right, the same way subs does. However, unlike subs, dsubs will substitute the left hand side of each substitution equation until this derivative is eliminated from the target (when this is possible). When many substitution equations are given, they are applied sequentially, as in subs. dsubs also works with anticommutative variables set using the Physics package.
 • The exception to this rule occurs when a substitution cannot be applied successively, like the algebraic substitution $x={x}^{2}$. In this case the result returned is the one obtained by performing a single substitution.
 • All substitution equations must be in solved form.
 • This function is part of the PDEtools package, and so it can be used in the form dsubs(..) only after executing the command with(PDEtools). However, it can always be accessed through the long form of the command by using PDEtools[dsubs](..). Examples

The first example compares the results of subs and dsubs.

 > $\mathrm{with}\left(\mathrm{PDEtools}\right):$
 > $\mathrm{eq1}≔\mathrm{diff}\left(f\left(x\right),x\right)=f\left(x\right)$
 ${\mathrm{eq1}}{≔}\frac{{ⅆ}}{{ⅆ}{x}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{f}{}\left({x}\right){=}{f}{}\left({x}\right)$ (1)
 > $\mathrm{expr}≔\mathrm{diff}\left(f\left(x\right),x,x\right)-f\left(x\right)$
 ${\mathrm{expr}}{≔}\frac{{{ⅆ}}^{{2}}}{{ⅆ}{{x}}^{{2}}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{f}{}\left({x}\right){-}{f}{}\left({x}\right)$ (2)

In this case subs returns an expression which contains f', the object being substituted.

 > $\mathrm{subs}\left(\mathrm{eq1},\mathrm{expr}\right)$
 $\frac{{ⅆ}}{{ⅆ}{x}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{f}{}\left({x}\right){-}{f}{}\left({x}\right)$ (3)

Here, dsubs completely removes the f', the left hand side of the substitution equation.

 > $\mathrm{dsubs}\left(\mathrm{eq1},\mathrm{expr}\right)$
 ${0}$ (4)

Here is a PDE example.

 > $\mathrm{eq2}≔\mathrm{diff}\left(f\left(x,y,z\right),x,z\right)=\mathrm{diff}\left(f\left(x,y,z\right),y\right),\mathrm{diff}\left(f\left(x,y,z\right),y,y\right)=\mathrm{diff}\left(f\left(x,y,z\right),x,x\right)$
 ${\mathrm{eq2}}{≔}\frac{{{\partial }}^{{2}}}{{\partial }{x}{\partial }{z}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{f}{}\left({x}{,}{y}{,}{z}\right){=}\frac{{\partial }}{{\partial }{y}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{f}{}\left({x}{,}{y}{,}{z}\right){,}\frac{{{\partial }}^{{2}}}{{\partial }{{y}}^{{2}}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{f}{}\left({x}{,}{y}{,}{z}\right){=}\frac{{{\partial }}^{{2}}}{{\partial }{{x}}^{{2}}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{f}{}\left({x}{,}{y}{,}{z}\right)$ (5)
 > $\mathrm{dsubs}\left(\mathrm{eq2},\mathrm{diff}\left(f\left(x,y,z\right),x,y,z\right)\right)$
 $\frac{{{\partial }}^{{2}}}{{\partial }{{x}}^{{2}}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{f}{}\left({x}{,}{y}{,}{z}\right)$ (6)

The dsubs command also works with anticommutative variables, natively, without using the approach explained in PerformOnAnticommutativeSystem.

 > $\mathrm{with}\left(\mathrm{Physics}\right)$
 $\left[{\mathrm{*}}{,}{\mathrm{.}}{,}{\mathrm{Annihilation}}{,}{\mathrm{AntiCommutator}}{,}{\mathrm{Antisymmetrize}}{,}{\mathrm{Assume}}{,}{\mathrm{Bra}}{,}{\mathrm{Bracket}}{,}{\mathrm{Check}}{,}{\mathrm{Christoffel}}{,}{\mathrm{Coefficients}}{,}{\mathrm{Commutator}}{,}{\mathrm{CompactDisplay}}{,}{\mathrm{Coordinates}}{,}{\mathrm{Creation}}{,}{\mathrm{D_}}{,}{\mathrm{Dagger}}{,}{\mathrm{Decompose}}{,}{\mathrm{Define}}{,}{\mathrm{Dγ}}{,}{\mathrm{Einstein}}{,}{\mathrm{EnergyMomentum}}{,}{\mathrm{Expand}}{,}{\mathrm{ExteriorDerivative}}{,}{\mathrm{Factor}}{,}{\mathrm{FeynmanDiagrams}}{,}{\mathrm{FeynmanIntegral}}{,}{\mathrm{Fundiff}}{,}{\mathrm{Geodesics}}{,}{\mathrm{GrassmannParity}}{,}{\mathrm{Gtaylor}}{,}{\mathrm{Intc}}{,}{\mathrm{Inverse}}{,}{\mathrm{Ket}}{,}{\mathrm{KillingVectors}}{,}{\mathrm{KroneckerDelta}}{,}{\mathrm{LeviCivita}}{,}{\mathrm{Library}}{,}{\mathrm{LieBracket}}{,}{\mathrm{LieDerivative}}{,}{\mathrm{Normal}}{,}{\mathrm{NumericalRelativity}}{,}{\mathrm{Parameters}}{,}{\mathrm{PerformOnAnticommutativeSystem}}{,}{\mathrm{Projector}}{,}{\mathrm{Psigma}}{,}{\mathrm{Redefine}}{,}{\mathrm{Ricci}}{,}{\mathrm{Riemann}}{,}{\mathrm{Setup}}{,}{\mathrm{Simplify}}{,}{\mathrm{SortProducts}}{,}{\mathrm{SpaceTimeVector}}{,}{\mathrm{StandardModel}}{,}{\mathrm{SubstituteTensor}}{,}{\mathrm{SubstituteTensorIndices}}{,}{\mathrm{SumOverRepeatedIndices}}{,}{\mathrm{Symmetrize}}{,}{\mathrm{TensorArray}}{,}{\mathrm{Tetrads}}{,}{\mathrm{ThreePlusOne}}{,}{\mathrm{ToContravariant}}{,}{\mathrm{ToCovariant}}{,}{\mathrm{ToFieldComponents}}{,}{\mathrm{ToSuperfields}}{,}{\mathrm{Trace}}{,}{\mathrm{TransformCoordinates}}{,}{\mathrm{Vectors}}{,}{\mathrm{Weyl}}{,}{\mathrm{^}}{,}{\mathrm{dAlembertian}}{,}{\mathrm{d_}}{,}{\mathrm{diff}}{,}{\mathrm{g_}}{,}{\mathrm{gamma_}}\right]$ (7)

Set first $\mathrm{\theta }$ and $Q$ as suffixes for variables of type/anticommutative (see Setup)

 > $\mathrm{Setup}\left(\mathrm{anticommutativepre}=\left\{Q,\mathrm{\theta }\right\}\right)$
 $\mathrm{* Partial match of \text{'}}{}\mathrm{anticommutativepre}{}\mathrm{\text{'} against keyword \text{'}}{}\mathrm{anticommutativeprefix}{}\text{'}$
 $\mathrm{_______________________________________________________}$
 $\left[{\mathrm{anticommutativeprefix}}{=}\left\{{Q}{,}{\mathrm{\theta }}\right\}\right]$ (8)

A PDE system example with two unknown anticommutative functions of four variables, two commutative and two anticommutative; to avoid redundant typing in the input that follows and redundant display of information on the screen let's use PDEtools:-diff_table PDEtools:-declare

 > $\mathrm{PDEtools}:-\mathrm{declare}\left(Q\left(x,y,\mathrm{\theta }\left[1\right],\mathrm{\theta }\left[2\right]\right)\right)$
 ${Q}{}\left({x}{,}{y}{,}{{\mathrm{\theta }}}_{{1}}{,}{{\mathrm{\theta }}}_{{2}}\right){}{\mathrm{will now be displayed as}}{}{Q}$ (9)
 > $q≔\mathrm{PDEtools}:-\mathrm{diff_table}\left(Q\left(x,y,\mathrm{\theta }\left[1\right],\mathrm{\theta }\left[2\right]\right)\right):$

Now we can enter derivatives directly as the function's name indexed by the differentiation variables and see the display the same way; two PDEs

 > $\mathrm{pde}\left[1\right]≔q\left[x,y,\mathrm{\theta }\left[1\right]\right]+q\left[x,y,\mathrm{\theta }\left[2\right]\right]-q\left[y,\mathrm{\theta }\left[1\right],\mathrm{\theta }\left[2\right]\right]=0$
 ${\mathrm{diff}}{}\left({\mathrm{diff}}{}\left({\mathrm{diff}}{}\left({Q}{}\left({x}{,}{y}{,}{{\mathrm{θ}}}_{{1}}{,}{{\mathrm{θ}}}_{{2}}\right){,}{x}\right){,}{y}\right){,}{{\mathrm{θ}}}_{{1}}\right){+}{\mathrm{diff}}{}\left({\mathrm{diff}}{}\left({\mathrm{diff}}{}\left({Q}{}\left({x}{,}{y}{,}{{\mathrm{θ}}}_{{1}}{,}{{\mathrm{θ}}}_{{2}}\right){,}{x}\right){,}{y}\right){,}{{\mathrm{θ}}}_{{2}}\right){-}{\mathrm{diff}}{}\left({\mathrm{diff}}{}\left({\mathrm{diff}}{}\left({Q}{}\left({x}{,}{y}{,}{{\mathrm{θ}}}_{{1}}{,}{{\mathrm{θ}}}_{{2}}\right){,}{y}\right){,}{{\mathrm{θ}}}_{{1}}\right){,}{{\mathrm{θ}}}_{{2}}\right){=}{0}$ (10)
 > $\mathrm{pde}\left[2\right]≔q\left[\mathrm{\theta }\left[1\right]\right]=0$
 ${\mathrm{diff}}{}\left({Q}{}\left({x}{,}{y}{,}{{\mathrm{θ}}}_{{1}}{,}{{\mathrm{θ}}}_{{2}}\right){,}{{\mathrm{θ}}}_{{1}}\right){=}{0}$ (11)

By inspection, it is clear that the derivatives in pde can be substituted in pde reducing the problem to a simpler one:

 > $\mathrm{dsubs}\left(\mathrm{pde}\left[2\right],\mathrm{pde}\left[1\right]\right)$
 ${\mathrm{diff}}{}\left({\mathrm{diff}}{}\left({\mathrm{diff}}{}\left({Q}{}\left({x}{,}{y}{,}{{\mathrm{θ}}}_{{1}}{,}{{\mathrm{θ}}}_{{2}}\right){,}{x}\right){,}{y}\right){,}{{\mathrm{θ}}}_{{2}}\right){=}{0}$ (12)
 > $\mathrm{pdsolve}\left(\right)$
 ${Q}{}\left({x}{,}{y}{,}{{\mathrm{θ}}}_{{1}}{,}{{\mathrm{θ}}}_{{2}}\right){=}{\mathrm{_F1}}{}\left({x}{,}{y}\right){}{\mathrm{_λ1}}{+}{\mathrm{_F2}}{}\left({x}{,}{y}\right){}{{\mathrm{θ}}}_{{1}}{+}\left({\mathrm{_F6}}{}\left({x}\right){+}{\mathrm{_F5}}{}\left({y}\right)\right){}{{\mathrm{θ}}}_{{2}}{+}\left({\mathrm{_F8}}{}\left({x}\right){+}{\mathrm{_F7}}{}\left({y}\right)\right){}{\mathrm{*}}{}\left({\mathrm{_λ2}}{,}{{\mathrm{θ}}}_{{1}}{,}{{\mathrm{θ}}}_{{2}}\right)$ (13)
 > 

Substituting this result for $Q$ back into pde, then multiplying by ${\mathrm{\theta }}_{1}$ and subtracting from the above also leads to the PDE system solution, that in this case can also be obtained using a different technique passing the whole system directly to pdsolve