I have a sequence of differential operators given by

$H_n = x \frac{d}{dx} + n$

where $n=1,2,...$ and I would like to construct the operator

$\hat{O}(n) = \frac{1}{n!}H_nH_{n-1}...H_2H_1$

as a function of the integer $n$. I know how to compose operators, and in particular how to compose the same operator $n$ times using, say, the Nest function, e.g. for $nH_1$ n-times I'd write

h[x_, n_] := x D[#, x] + n # &

ohat1[n_] := 1/n! Nest[h[x, 1], #, n] &

which would give me $\hat{O}_1(n) = (H_1)^n/n!$, but I haven't been able to generalise this to the case I'm interested in.

Aside: if this is even possible would mathematica then be able to deal with the case $n=\infty$ when acting on a specific function?

  • $\begingroup$ Welcome to mathematica.SE, please post what relevant code you have in your question, and format it with the {} button (or indentation of every line of code with four spaces). $\endgroup$ – Feyre Sep 1 '16 at 8:28
  • $\begingroup$ EDIT: Instead of "e.g. for n=1" it should read "e.g. for H_1 n-times I'd write" (when i tried to edit I got the message that the changes are not substantive enough to warrant a change...) $\endgroup$ – Dionigi Benincasa Sep 1 '16 at 8:43
  • 1
    $\begingroup$ You just want Product don't you? Try 1/n! Product[h[x, i], {i, 1, n}] $\endgroup$ – Quantum_Oli Sep 1 '16 at 8:56
ohat1[n_] := 
 Function[expr, 1/n! Fold[x D[#1, x] + #2 #1 &, expr, Range[n]]]
(*1/2 (2 (f[x]+x f'[x])+x (2 f'[x]+x f''[x]))*)
  • 1
    $\begingroup$ this is nice. However, I believe the function should be x D[#1, x] + #2 #1 &]. $\endgroup$ – ubpdqn Sep 1 '16 at 9:24
  • $\begingroup$ Thanks. I agree with @ubpdqn. Can you edit your answer or should I do it myself? $\endgroup$ – Dionigi Benincasa Sep 1 '16 at 9:30
  • $\begingroup$ Oh I'm sorry for that misunderstanding, it has been edited. $\endgroup$ – wuyingddg Sep 1 '16 at 12:36

Perhaps a start (factorial absorbed):

h[x_, n_] := x D[#, x]/n + # &
o[n_] := Composition @@ Table[h[x, j], {j, n}]
ol[n_][f_] := ComposeList[Table[h[x, j], {j, n}], f]


Grid[{#, o[3][#], ol[3][#]} & /@ {x, x^2, x^3, x + 1}]

Comparing with a modification of wuyongddg's answer (I like the approach

ohat[n_] := 
  Function[expr, 1/n! Fold[x D[#1, x] + #2 #1 &, expr, Range[n]]];

So, Expand[ohat[2][g[x]]] and o[2][g[x]] both yield:

g[x] + 2 x Derivative[1][g][x] + 1/2 x^2 (g^′′)[x]
  • $\begingroup$ Nice thanks. Is it possible to have it compute o[n][g[x]] for $n$ an unspecified positive integer? $\endgroup$ – Dionigi Benincasa Sep 1 '16 at 9:44
  • $\begingroup$ @DionigiBenincasa if you are searching for general form you should look at the various Find_. ,e.g. FindSequenceFunction and apply to first few 'values'. $\endgroup$ – ubpdqn Sep 1 '16 at 9:56

Not the answer you're looking for? Browse other questions tagged or ask your own question.