Mathematica: take derivative in terms of original function

In summary, the conversation discusses how to manipulate an expression in order to get the answer in terms of a specific function. The suggested method involves taking the derivative, undefining the function, and then backsubstituting the result into the desired form. The Wolfram Mathematica function "Clear" is recommended for undefining the function.
  • #1
PlasticOh-No
18
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
  • #2
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.
 
  • #3
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.
 
  • #4
Thanks for your reply. Just one thing - how do I undefine the original definition of f[x_,y_] ??

Thanks again
 
  • #6
Thank you
 

1. How do I take the derivative of a function in Mathematica?

To take the derivative of a function in Mathematica, use the D function followed by the function you want to differentiate and the variable with respect to which you want to take the derivative. For example, to find the derivative of f(x) = x^2 with respect to x, you would use the command D[f[x],x].

2. Can I take the derivative in terms of the original function in Mathematica?

Yes, you can take the derivative in terms of the original function in Mathematica by using the D function with the option Assumptions -> f[x]. This will give you the derivative of the function in terms of f[x] rather than x.

3. How can I specify higher order derivatives in Mathematica?

To specify a higher order derivative in Mathematica, use the D function with the variable and the order of the derivative as the second argument. For example, to find the second derivative of f(x) = x^3 with respect to x, you would use the command D[f[x],{x,2}].

4. Can Mathematica handle implicit differentiation?

Yes, Mathematica can handle implicit differentiation. To use implicit differentiation, use the D function with the function you want to differentiate and the variable with respect to which you want to take the derivative. For example, to find the derivative of x^2 + y^2 = 25 with respect to x, you would use the command D[x^2 + y^2 == 25, x].

5. How do I take the derivative of a multivariable function in Mathematica?

To take the derivative of a multivariable function in Mathematica, use the D function with the function and the variables with respect to which you want to take the derivative as the second and third arguments, respectively. For example, to find the derivative of f(x,y) = x^2 + y^2 with respect to x, you would use the command D[f[x,y],x].

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
8
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
13
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
765
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
6
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
2K
Back
Top