I have trouble with symbolic functional derivatives and substitute , for example,
result1 =[D[f[x, y], x]]
$result1 = \frac{\partial f[x,y]}{\partial x} $
next, i want take $f[x,y]=x+y$ substitute into result1
. This is very useful in symbolic computation, especially when substituting functions into expressions after complex computations.
I have try this answer with Inactivate
,this is a very early version, and Inactivate
will deactivate all partial derivatives. It's very inconvenient, for example, When I only care about the properties of f,
result1 = Inactivate[D[f[x, y] Cos[x], x], D]
the output is $\frac{\partial (\cos (x) f(x,y))}{\partial x}$ , is there any better method can able to substitute f into the expression while computing known functions as much as possible?
As the follows example,
result1 =[D[f[x, y] Cos[x], x]]
result2 = result1/.{f[x,y]=x+y}
I want output is $result1 = \frac{\partial ( f(x,y))}{\partial x}\cos (x)-\sin (x) f(x,y), result2 = \cos (x)-(x+y) \sin (x)$
result1 =[D[f[x, y] Cos[x], x]], result2 =Inactivate[[D[f[x, y] Cos[x], x]],D] , result3 = result2/.{f[x,y]=x+y}
and at last,result4 = Activate@ result3
, but this looks clumsy, any advise very be much appreciate! $\endgroup$