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?
Asked
Active
Viewed 241 times
7
1 Answers
12
Perhaps Internal`DependsOnQ:
h = f[x, g[y]];
Internal`DependsOnQ[h, #] & /@ {x, y, g[y], w}
{True, True, True, False}
kglr
- 394,356
- 18
- 477
- 896
DownValues[f]to find what the function depends on, since theDownValueshas 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– Nasser Sep 06 '18 at 01:50