I have some complicated expression, let's call it $X_n$, for which I don't have a closed form, but I do have a recurrence relation. It is given in terms of some functions $u(x,y),$ $v(x,y),$ and derivatives.

What I want to do is find

$$\frac{\delta X_n}{\delta v},$$

given $X_n,$ for a good few values of $n.$ Is there a way to do this so that I can get Mathematica to think of $u$ and $v$ as 'variables' and then just differentiate with respect to them, even though they're technically functions?

So if I take an example, where $X=\int uv_xdx,$ so I set


and I want to differentiate this w.r.t. $v$, so that I get the answer $u_{xx}+2u^2v,$ then what I want it to do is something like


which obviously doesn't make sense to Mathematica. I could try using the Euler-Lagrange equations, but this still requires me to actually differentiate with respect to a function, which is what I need to know.

I'm not exactly a computer-minded person, and only really require this code due to the large size of the expressions involved making them too tedious to do by hand, so I'd really appreciate assistance understandable to a beginner (i.e. the simpler the code I could implement, the better). Thanks.

  • $\begingroup$ Have you seen this? $\endgroup$ – J. M.'s torpor Feb 25 '19 at 9:35
  • $\begingroup$ How about VariationalMethods`VariationalD? $\endgroup$ – Αλέξανδρος Ζεγγ Feb 25 '19 at 11:46
  • 1
    $\begingroup$ It would be easier to respond if there was an explicit example, in Mathematica input form. $\endgroup$ – Daniel Lichtblau Feb 25 '19 at 15:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.