I have a system of PDEs, and it contains terms of the form $A^{(n,m)}(x,t)$, which is shorthand for $$\frac{\partial^n}{\partial x^n}\frac{\partial^m}{\partial t^m}A(x,t),$$ (ie Derivative[n,m][A][x,t]) and want to replace output of the form $$A^{(n,m)}(x,t),$$ with $$\partial^n_t(-i\partial_t^2-2\partial_t)^mA(x,t).$$

I think I can take care of the $\partial^n_t$ part by defining a rule for the derivative, i.e. ruleDerF = Derivative[n_, m_][f][x_, t_] -> D[ f[x, t], {t, n}], and then applying this to output in question.

However, I don't know how to take care of the expansion of the next operator. For example, I can define the operator $$-i\partial_t^2-2\partial_t,$$ by, say L_1[x_,t_]=(-I*D[#,{t,2}]-2*D[#,{t,1}] and then applying L_1[x,t][A[x,t]]. I am not sure how to then apply this $m$ times, nor how to set up these replacement rules for this operator.

Any suggestions are appreciated.


1 Answer 1


Is this it?

Derivative[4, 2][a][x, t]
% /. Derivative[n_, m_][f_][x_, t_] :> D[Nest[-I D[#, {t, 2}] - 2 D[#, t] &, f[x, t], m], {t, n}]

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.