I'm trying to understand how to use symbolic expressions as arguments. The following example represents my problem:
Q[f_, s0_] := Q[f, s0] = D[f[s0], s0]
Q[Q[f, s0], s0]
where Q is simply first derivative of function f. As a result of the second line, I expect to see second derivative of f. But I'm getting
f'[s0]'[s0] + f''[s0][s0]
Could you help me please find a way to obtain a correct answer?
Thank you in advance!
Q[f_, s0_] := Q[f, s0] = D[f, s0]
in a fresh kernel, and then evaluateQ[Q[f, s0], s0]
again. $\endgroup$