Mathematica: take derivative in terms of original function

Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
5 replies · 3K views
PlasticOh-No
Messages
18
Reaction score
0
Hello,

Let's say we have

f[x_,y_]:= whatever

then we say

expr1 = D[f[x,y],x]

which is some complicated expression.

How can we get the answer in terms of f[x,y]? That is, how can we get expr1 to look like:

expr1 = f[x,y]*this term + pi*Sqrt[f[x,y]] + et cetera?

Thanks Gurus
 
Physics news on Phys.org
Ok let me make this a little clearer.
Let's say we have
f[x_,y_]:=Exp[a*(x+y)]
where a is some real parameter.
Now we take
D[f[x,y],x]
which is equal to
a*Exp[a*(x+y)].
How can I get Mathematica to give a result like
a*f[x,y]

Thank you in advance for you attention on this.
 
Try this and see if it will do what you want.
After you have taken the derivative then Undefine f[x,y] and then try
yourResult/.Exp[a*(x+y)]->f[x,y]
and see if you can get it to backsubstitute into the form you desire.

The reason you need to undefine f[] is to keep Mathematica from immediately expanding back to the definition.

This is a somewhat error prone method, but if used with care and checking can often work.
 
Thanks for your reply. Just one thing - how do I undefine the original definition of f[x_,y_] ??

Thanks again