In symbolic derivations with Mathematica, one often needs to define an operator with some desired properties, which will be used to stand for a general function or transform.
For example, I would like to define a linear operator myOp[f[x, t]]
, which has the following basic properties:
Linearity:
myOp[a1*f1[x ,t] + a2*f2[x, t]] == a1*myOp[f1[x, t]] + a2*myOp[f2[x, t]]
witha1
anda2
being constant;Commutation with linear differential operators:
myOp[D[f[x, t], {x, n}]] == D[myOp[ f[x,t] ], {x, n}]
;Inversion:
myOp[ myOp[ f[x, t] ] ] == -f[x, t]
,
such that Mathematica can symbolically evaluate and simplify expressions substituted in. By the way, what necessary and/or useful attributes and/or conditions should also be given to the customized operator?
f[x,t]
. $\endgroup$