Background, this seems to work (This is manually transcribed from the program, beware of errors):
J1[f_, i_] := DifferenceDelta[f[i], i]^2 D[J1[f + t v, i], t]
2 (-v[i] + v[i+1]) (-(f + t v)[i] + (f + t v)[i+1])
What I would like to do is replace the
()^2 with a generic function
JJ, and later specify
JJ[x_] := ...
Here's what happens with the generic
J2[f_, i_] := JJ[DifferenceDelta[f[i], i]] D[J2[f + t v, i],t]
Why can't it return a derivative expression in terms of a generic derivative
JJ', and how could I modify my code to make it work?