I need to calculate the Gâteaux derivatives of some functional, and I started playing a bit with very simple cases. I know there's the VariationalMethods package that's required, but I don't know how to make things work in higher dimensions.
Let's say I want to calculate the derivative with respect to $u$ of
$$ J(u) = \frac{1}{2} \int |\nabla u|^2 dx.$$
If I am in dimension 1, I type VariationalD[1/2 u'[x]^2 , u[x], x]
and it gives me -u''[x]
as it's supposed to be, but I can't seem to make it work in higher dimensions. How should I write that?
I tried using Norm[Grad[u[x], {x}]^2
but it doesn't work, I'm doing some mistake with the syntax.
Grad[3 x^2 y, {x, y}] . {1, 1}/Sqrt[2]
$\endgroup$