I want to calculate sum of derivatives of expression
F = Exp[(x*z - 1) f*b + (x - 1) (1 - f) b]
from n-th to (n-k)-th, say k=4. The dummy way which works is:
der1 = D[F, {x, n}] + D[F, {x, k1}] + D[F, {x, k2}] + D[F, {x, k3}] + D[F, {x, k4}]
der1 = der1 /. {k1 -> n - 1, k2 -> n - 2, k3 -> n - 3, k4 -> n - 4}
However I'd like to do it automatically. I tried as follows:
der2 = Sum[D[F, {x, n - k}], {k, 0, 4}]
but the problem is that it doesn't evaluate derivatives, leaving partial derivative symbol. Whereas the same method works if it is not (n-k)-th derivative but k-th derivative:
der3 = Sum[D[F, {x, k}], {k, 0, 4}]
My question is how to write der2 in order to give the same output as der1 but in the way of der3? Sorry if question is stupid. Please note, I'm rather new to Mathematica.
der2
code works for me when I first defineb
to be an integer, likeb=10
. Did you perhaps meann
instead ofb
? $\endgroup$