# Finding the derivative of a function with respect to the derivative of a variable

8 visualizaciones (últimos 30 días)
Aleem Andrew el 15 de En. de 2021
Respondida: Deepak Meena el 20 de En. de 2021
I am trying to derive the expression that contains a dependent variable x with respect to the derivative of x, but although I defined dx as a variable I get the error message
Second argument must be a variable, a symfun or a list of variables and symfuns.
The output should be 2*diff(x,t,1).
syms x(t)
dx = diff(x,t,1);
L = dx^2
functionalDerivative(L,dx)
##### 0 comentariosMostrar -2 comentarios más antiguosOcultar -2 comentarios más antiguos

Iniciar sesión para comentar.

### Respuestas (1)

Deepak Meena el 20 de En. de 2021
Hi Andrew ,
Walter Robinson has beautifully explained why there is problem with using diff(f,diff()) here.
Now to get the desired Output you can do get something like this:
dx = diff (x, t, 1);
>>p
2*diff(x(t), t)
Thanks
Deepak
##### 0 comentariosMostrar -2 comentarios más antiguosOcultar -2 comentarios más antiguos

Iniciar sesión para comentar.

### Categorías

Más información sobre Symbolic Math Toolbox 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