# How to compute the functional derivative with respect to 'f(x)'?

4 visualizaciones (últimos 30 días)
Ralf Juenling el 16 de Abr. de 2015
Respondida: Philip Caplan el 17 de Abr. de 2015
The function 'functionalDerivative' that is new in version 6.2 of the Symbolic Math Toolbox fails with the following simple input
>> u = sym('u');
>> fu = symfun(sym('f(u)'), [u]);
>> x = sym('x');
>> fx = symfun(sym('f(x)'), [x]);
>> functionalDerivative(fu, fx)
Error using symfun/privResolveArgs (line 187)
Symbolic function inputs must match.
The result I am expecting in this case is dirac shifted to x (i.e., g(s)=dirac(s - x)).
Am I not using functionalDerivative correctly, or is it not able to generate this result?
##### 0 comentariosMostrar -2 comentarios más antiguosOcultar -2 comentarios más antiguos

Iniciar sesión para comentar.

### Respuestas (1)

Philip Caplan el 17 de Abr. de 2015
The error you are receiving is due to the fact that "fu" and "fx" need to be functions of the same independent variable, otherwise there is nothing to link the two functions and, hence, compute the functional derivative.
For example, assume the second argument passed to "functionalDerivative" is "f(x)" as you have it. Then, a valid first argument would be an expression of "x", "f(x)", "diff(f(x),x)", "diff(f(x),x,x)", etc. Here is an example:
>> syms f(x)
>> g(x) = f(x)^3 + diff(f(x),x,x,x)*diff(f(x), x);
>> functionalDerivative(g(x), f(x))
Hope this helps!
##### 0 comentariosMostrar -2 comentarios más antiguosOcultar -2 comentarios más antiguos

Iniciar sesión para comentar.

### Categorías

Más información sobre Assumptions en Help Center y File Exchange.

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by