0
$\begingroup$

Is there a way to define in Mathematica a generic differentiable function $g:\mathbb{R}^2\rightarrow \mathbb{R}$ in such a way that when it computes the derivatives of a composed function involving $g$ it leaves indicated the derivatives of $g$ instead of actually computing them?

I'll explain myself better with an example:

Suppose we have defined this "generic" $g:\mathbb{R}^2\rightarrow \mathbb{R}$ and we have defined $F:\mathbb{R}\rightarrow \mathbb{R}$, $F(x)=7Log[x]$. When given the command $D(F(g(x,y)),x)$ I would like to have the output $7\partial_x(g)/g$. Is it possible?

$\endgroup$

closed as off-topic by march, Feyre, m_goldberg, Michael E2, happy fish Oct 26 '16 at 6:32

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question arises due to a simple mistake such as a trivial syntax error, incorrect capitalization, spelling mistake, or other typographical error and is unlikely to help any future visitors, or else it is easily found in the documentation." – march, Feyre, m_goldberg, Michael E2, happy fish
If this question can be reworded to fit the rules in the help center, please edit the question.

  • $\begingroup$ Welcome to Mathematica.SE! 1) As you receive help, try to give it too, by answering questions in your area of expertise. 2) Take the tour and check the faqs! 3) When you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge. Remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign! $\endgroup$ – user9660 Oct 25 '16 at 15:11
2
$\begingroup$

It is not only possible, it is actually quite straightforward. Define f in the usual way:

f[x_] := 7 Log[x]

Then take the derivative of the composition with g[x,y] (being an "undefined" generic function). The answer is as you expect:

D[f[g[x, y]], x]

enter image description here

So there is no need to specially define the function g[x,y].

$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.