PDEtools
dsubs
perform differential substitutions into expressions
Calling Sequence
Parameters
Description
Examples
dsubs(deriv=a, expr)
dsubs(deriv1=a, '...', expr)
a, expr
-
differential expressions
deriv
derivative for which to substitute
deriv1, '...'
equation or sequence of substitution equations
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=x2. 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](..).
The first example compares the results of subs and dsubs.
with⁡PDEtools:
eq1≔diff⁡f⁡x,x=f⁡x
eq1≔ⅆⅆxf⁡x=f⁡x
expr≔diff⁡f⁡x,x,x−f⁡x
expr≔ⅆ2ⅆx2f⁡x−f⁡x
In this case subs returns an expression which contains f', the object being substituted.
subs⁡eq1,expr
ⅆⅆxf⁡x−f⁡x
Here, dsubs completely removes the f', the left hand side of the substitution equation.
dsubs⁡eq1,expr
0
Here is a PDE example.
eq2≔diff⁡f⁡x,y,z,x,z=diff⁡f⁡x,y,z,y,diff⁡f⁡x,y,z,y,y=diff⁡f⁡x,y,z,x,x
eq2≔∂2∂x∂zf⁡x,y,z=∂∂yf⁡x,y,z,∂2∂y2f⁡x,y,z=∂2∂x2f⁡x,y,z
dsubs⁡eq2,diff⁡f⁡x,y,z,x,y,z
∂2∂x2f⁡x,y,z
The dsubs command also works with anticommutative variables, natively, without using the approach explained in PerformOnAnticommutativeSystem.
with⁡Physics
`*`,`.`,Annihilation,AntiCommutator,Antisymmetrize,Assume,Bra,Bracket,Check,Christoffel,Coefficients,Commutator,CompactDisplay,Coordinates,Creation,D_,Dagger,Decompose,Define,Dγ,DiracConjugate,Einstein,EnergyMomentum,Expand,ExteriorDerivative,Factor,FeynmanDiagrams,FeynmanIntegral,Fundiff,Geodesics,GrassmannParity,Gtaylor,Intc,Inverse,Ket,KillingVectors,KroneckerDelta,LagrangeEquations,LeviCivita,Library,LieBracket,LieDerivative,Normal,NumericalRelativity,Parameters,PerformOnAnticommutativeSystem,Projector,Psigma,Redefine,Ricci,Riemann,Setup,Simplify,SortProducts,SpaceTimeVector,StandardModel,Substitute,SubstituteTensor,SubstituteTensorIndices,SumOverRepeatedIndices,Symmetrize,TensorArray,Tetrads,ThreePlusOne,ToContravariant,ToCovariant,ToFieldComponents,ToSuperfields,Trace,TransformCoordinates,Vectors,Weyl,`^`,dAlembertian,d_,diff,g_,gamma_
Set first θ and Q as suffixes for variables of type/anticommutative (see Setup)
Setup⁡anticommutativepre=Q,θ
* Partial match of 'anticommutativepre' against keyword 'anticommutativeprefix'
_______________________________________________________
anticommutativeprefix=Q,θ
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
PDEtools:-declare⁡Q⁡x,y,θ1,θ2
Q⁡x,y,θ1,θ2⁢will now be displayed as⁢Q
q≔PDEtools:-diff_table⁡Q⁡x,y,θ1,θ2:
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
pde1≔qx,y,θ1+qx,y,θ2−qy,θ1,θ2=0
pde1≔Qx,y,θ1+Qx,y,θ2−Qy,θ1,θ2=0
pde2≔qθ1=0
pde2≔Qθ1=0
By inspection, it is clear that the derivatives in pde[2] can be substituted in pde[1] reducing the problem to a simpler one:
dsubs⁡pde2,pde1
Qx,y,θ2=0
pdsolve⁡
Q=f__9⁡x,y⁢_λ1+f__10⁡x,y⁢θ1+f__6⁡x+f__5⁡y⁢θ2+f__8⁡x+f__7⁡y⁢_λ2⁢θ1⁢θ2
Substituting this result for Q back into pde[2], then multiplying by θ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
See Also
DEtools
subs
Download Help Document