0
$\begingroup$

Is there a way in Mathematica for defining rules for derivatives on undefined functions? For example, I would like to define a rule such that for any function $f(x,y)$, when I take the $x$-derivative it gives me a function $\delta f$:

D[f[x,y],x] -> δf[x,y]
D[g[x,y],x] -> δg[x,y]

etc.

EDIT: I should clarify that I am looking for a rule that could act on functions of any type, so not just $f$, $g$, but any function of $(x,y)$.

$\endgroup$
1
  • $\begingroup$ Do you really want to create a new symbol with a $\delta$ in front, or do you just want to display $f^{(1,0)}$ as $\delta f$? $\endgroup$
    – Lukas Lang
    Aug 5, 2019 at 10:14

1 Answer 1

3
$\begingroup$

Just use Derivative:

f /: Derivative[1,0][f] = 𝛿f;
f /: Derivative[0,1][f] = 𝛿g;

Then:

D[f[x, y], x]
D[f[x, y], y]

𝛿f[x, y]

𝛿g[x, y]

$\endgroup$
1
  • $\begingroup$ I should clarify that I am looking for a rule that could act on functions of any type, so not just f,g, but any function of [x,y]. So the rule would append $\delta$ to any function where I take $\partial_x$. $\endgroup$ Aug 3, 2019 at 16:41

Your Answer

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

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