Mathematica Mathematica: take derivative in terms of original function

AI Thread Summary
To express the derivative of a function in terms of the original function in Mathematica, one can first take the derivative using D[f[x,y], x]. To achieve the desired form, such as a*f[x,y], the original function definition must be undefined using Clear[f]. After taking the derivative, backsubstituting can be done with the replacement rule. This method requires careful execution to avoid errors, but it can effectively yield the desired expression. Understanding these steps allows for more flexible manipulation of derivatives in Mathematica.
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
 
Thank you
 

Similar threads

Replies
1
Views
2K
Replies
13
Views
2K
Replies
4
Views
2K
Replies
19
Views
2K
Replies
3
Views
2K
Replies
5
Views
2K
Replies
2
Views
2K
Back
Top