# How to create a general expression for an integer derivative?

I need MMa to return a general expression for the jth derivative wrt v of v^n.

This didn't work:

expr = Series[E^(x/v), {v, Infinity, 3}] // Normal;
Assuming[j \[Element] Integers, D[expr, {v, j}]]


And this didn't help either:

Derivative[x_, m_][Power][x_, n_] := Product[k, {k, n, n - m + 1}];
D[expr, {v, j}]


So I am stumped.

In this particular example, the result should be:

(* (-1)^j * (j!x + (j+1)!(x^2)/2 + (j+2)!*(x^3)/12 *)

• @belisarius I'm not trying to get a Series for E^(x/v), I'm trying to get the jth deriv wrt an expression in v. Mar 1, 2015 at 22:00
• @MichaelE2 Nope, same problem. Mar 2, 2015 at 2:18

expr = Series[E^(x/v), {v, Infinity, 3}] // Normal;

(* gen some Ds *)
t = Table[Assuming[j ∈ Integers, D[expr, {v, j}]], {j, 1, 10}];

(* get the pattern...*)
seq = FindSequenceFunction[t /. v -> 1, FunctionSpace -> All]

(* spot check some results...*)
yours = (-1)^j*(j! x + (j + 1)! (x^2)/2 + (j + 2)!*(x^3)/12);
SameQ @@@ Table[{yours /. j -> z, seq[z] // Expand}, {z, {0, 1, 5, 20}}]

(*

1/12 (-1)^#1 x Pochhammer[1, #1] (12 + 6 x + 2 x^2 + 6 x #1 + 3 x^2 #1 + x^2 #1^2) &

{True, True, True, True}

*)

expr = Series[E^(x/v), {v, Infinity, 3}] // Normal;
deriv[n_]:= n! SeriesCoefficient[expr, {v, 1, n}]

deriv[10] // Distribute
(* 3628800 x + 19958400 x^2 + 39916800 x^3 *)

deriv[n]// InputForm
(* n! Piecewise[{{((-1)^n*x*(12 + 6*(1 + n)*x + (2 + 3*n + n^2)*x^2))/12,  n > 0},
{(6 + x*(6 + 3*x + x^2))/6, n == 0}},
0]
*)


Maybe this?

Derivative[j_, 0][Power][x_, n_] := Pochhammer[n - j + 1, j] x^(n - j);
D[v^n, {v, j}]
(*  v^(-j + n) Pochhammer[1 - j + n, j]  *)

% /. {n -> 5, j -> 2}
%% /. {n -> 5, j -> 7}
(*
20 v^3
0
*)


In M11.1+, D can take symbolic $n^{\text{th}}$ derivatives. So:

expr = Series[E^(x/v), {v, Infinity, 3}] //Normal

res = D[expr, {v, j}] /. v->1


1 + x/v + x^2/(2 v^2) + x^3/(6 v^3)

1/6 x^3 FactorialPower[-3, j] + 1/2 x^2 FactorialPower[-2, j] + x FactorialPower[-1, j]

FullSimplify[