I need to define a sequence of functions $$ F_0(x), F_1(x), \dots $$ where each function $F_{k+1}(x)$ is defined using $F_k'(x)$. For simplicity let's assume that $$ F_{k+1}(x) = F_k'(x). $$
I'm using the following (not working) Mathematica code:
F[0, x_] = Sin[x]
F[kp1_, x_] := F[kp1_, x_] = With[{k = kp1 - 1},
Derivative[0, 1][F][k, x]
]
F[1, s^2]
The code gives $RecursionLimit::reclim
due to
Derivative[0, 1][F][0, x]
is not evaluating and I have no idea how to fix that.
Actually I can introduce dummy variable and use D
instead of Derivative
F[0, x_] = Sin[x]
F[kp1_, x_] := F[kp1_, x_] = With[{k = kp1 - 1},
D[F[k, y], y] /. y -> x
]
F[1, s^2]
This code works flawlessly, but in my actual problem there's a lot of variables and introducing new variables will make a huge mess, so I would like to stick with Derivative
operator.