Hi guys,
I have problems to compute the second functional derivative of a general function. The following lines generate the first derivative:
Needs["VariationalMethods`"]
r = {x, y, z}
ra[x,y,z]
rb[x,y,z]
dra[x,y,z]=D[ra[x,y,z],{r}]
drb[x,y,z]=D[rb[x,y,z],{r}]
gaa[x,y,z]=dra[x,y,z].dra[x,y,z]
gab[x,y,z]=dra[x,y,z].drb[x,y,z]
gbb[x,y,z]=drb[x,y,z].drb[x,y,z]
exc[ra[x,y,z],rb[x,y,z],gaa[x,y,z],gab[x,y,z],gbb[x,y,z]]
nuxc[x,y,z]=VariationalD[ exc[ra[x,y,z],rb[x,y,z],gaa[x,y,z],gab[x,y,z],gbb[x,y,z]],ra[x,y,z],r]
This gives the correct result. VariationalD realizes that exc[...] depends not only on ra[x,y,z] , but also on it's gradient. The resulting function nuxc[x,y,z] now depends on the gradient and the Laplacian of ra[x,y,z]. Now, I want to repeat the procedure and take again the functional derivative w.r.t. ra[x,y,z].
fxcaa=VariationalD[nuxc[x,y,z],ra[x,y,z],r]
However, the result is not correct. VariationalD does not realize that nuxc[x,y,z] depends on the gradient and Laplacian of pa[x,y,z]. This problem remains, if I explicitly write the gradient and Laplacian of pa[x,y,z] as argument of nuxc. How can I let VariationalD know, that nuxc[x,y,z] also depends on the gradient and laplacian of ra[x,y,z]?