I'd like to define specific partial derivative operators that change based on if the passed expression is a function of, for example, x
vs. xi
. I'm not finding anything in the documentation on how to code a check for the expressions dependence. My question is, if given some function f[x,y]
, how can I check the variables that it depends on?
1 Answer
Perhaps Internal`DependsOnQ
:
h = f[x, g[y]];
Internal`DependsOnQ[h, #] & /@ {x, y, g[y], w}
{True, True, True, False}
DownValues[f]
to find what the function depends on, since theDownValues
has the function signature right there. It just needs to be parsed out and to extract all the symbols from insidef[x_,y_,....]
and this part might be tricky to do.?DownValues
$\endgroup$