Is it possible to simplify this operator? Special case of Hadamard's formula Let $D=\frac{d}{dx}$ be the derivative operator and $f(x)$ be a cubic polynomial. Is it possible to simplify the following differential operator? $T=e^{D^2}f(x)e^{-D^2}$.
I tried to use Hadamard's formula:
$$\begin{equation}
T=e^{D^2}f(x)e^{-D^2}=f(x)+[D^2,f(x)]+\frac{1}{2}[D^2,[D^2,f(x)]]+...
\end{equation}\tag{1}$$
where $$[D^2,f(x)]=\frac{d^2f}{dx^2}-f(x)\frac{d^2}{dx^2}.\tag{2}$$ Since $f(x)$ is a cubic polynomial, $$[D^2,[D^2,f(x)]]=\frac{d^4f}{dx^4}-\frac{d^2}{dx^2}(f(x)\frac{d^2}{dx^2})-\frac{d^2f}{dx^2}\frac{d^2}{dx^2}-f(x)\frac{d^4}{dx^4}=0-\frac{d^2}{dx^2}(f(x)\frac{d^2}{dx^2})-\frac{d^2f}{dx^2}\frac{d^2}{dx^2}+f(x)\frac{d^4}{dx^4}.\tag{3}$$
Continuting this approach will just add more terms which do not cancel out each other. Any hint in what other approach that I can try?
 A: Since $f$ is a polynomial it is easy to write down a closed form for the operator $T$ which is a perturbation of the multiplicative operator $f(x)$ with a polynomial of derivatives and the variable x.
Let us pass to the Fourier transforms of functions:
$$T\psi = F^{-1}\circ (F \circ T \circ F^{-1}) \hat\psi$$
where $(\hat \psi) (k) := (F\psi)(k)$. Now
$$F \circ T \circ F^{-1} = e^{k^2} \circ f(-i\frac{d}{dk}) \circ e^{-k^2} = g_f(k, -i\frac{d}{dk})+  f(-i\frac{d}{dk}) $$
The circle in the right-hand side remarks that the involved objects are operators, in particular $e^{-k^2}$ is a multiplicative operator. Therefore, in particular
$$g_f(k, -i\frac{d}{dk}) =  e^{k^2} \circ\left( f(-i\frac{d}{dk}) \circ e^{-k^2} - e^{-k^2}  \circ f(-i\frac{d}{dk}) \right)\:,\tag{1}
$$
$g_f(k, -i\frac{d}{dk})$ is  polynomial in $k$ and $-i\frac{d}{dk}$ because at the end of computation the factors $e^{k^2}$ and $e^{-k^2}$ cancel each other. When the third order polynomial $f$ is given, it can be explicitly computed with a finite number of terms just by computing a finite number of commutators.
Referring to functions $\psi(x)$ instead of their Fourier transforms $\hat {\psi}(x)$, we have found the following closed formula
$$(T\psi)(x) = f(x)\psi(x) + g_f(i\frac{d}{dx}, x)\psi(x)\:.\tag{1}$$
where the polynomial $g_f(k,x)$ (where we have to eventually replace $k$ for $i\frac{d}{dx}$) is defined in (1) out of $f$ itself.
ADDENDUM. The polynomial $g_f$ is the one which arises in  really beautuful  @Cosmas Zachos' answer when subtracting the first addends. For homogeneous monomials and where $D:= \frac{d}{dx}$,
$$g_1 =0, \quad g_x = 2D, \quad g_{x^2} = 2 + 4xD +4D^2, \quad g_{x^3}= 6x+6x^2D+12xD^2 +12D + 8D^3\cdots$$
To treat polynomials in $x$, it is sufficient to use the linearity of the map
$$f \to g_f\:.$$
For a generic third order polynomial $f(x)= ax^3+bx^2+cx+d$, we have
$$g_{ax^3+bx^2+cx+d} = a(6x+6x^2D+12xD^2 +12D + 8D^3) + b( 2 + 4xD +4D^2) + c(2D)\:.$$
Namely (up to typos) from (1), but this result directly arises from  Cosmas' answer,
$$T =  (ax^3+bx^2+cx+d) +   8aD^3 + (4b +12ax)D^2 + (12+2c + 4bx + 6ax^2) D + 6ax\:.$$
A: My apologies for the original answer, now deleted, misinterpreting your question, assuming it was linked to this one. Here is the proper answer for purely associative strings of operators, based on your Hadamard identity. The crucial principle is the underlying operator similarity transformation.
Appreciate that, for $T[f]=e^{D^2}f(x)e^{-D^2}= f(e^{D^2}xe^{-D^2} )$,
$$
T[1]=1,\\
T[x]=x+ [D^2,x] +0=x+2D,\\
T[x^2]=T[x]T[x]=  (x+2D)^2= x^2+ 2+4xD + 4D^2, \\
T[x^3]=T[x^2]T[x]=(x+2D)^3=x^3+6x+6x^2D+12xD^2 +12D + 8D^3, 
$$
... so forth. But T is linear in f, so you have your explicit answer.
A: You just need to find the answer for the special case $f(x)=x$ which can be found by defining:
$$T_\lambda=e^{\lambda D^2}xe^{-\lambda D^2}$$
You can find $\frac{dT}{d\lambda}$ and it has a simple expression and then you can integrate it to find $T_\lambda$ and therefore $T_{\lambda=1}$.
A: You have to be warry with the commutators when you don't apply them to some test function. Since
\begin{align*}
[D^2, f(x)] g(x) &= \Big(D^2 f - f D^2\Big) g = D^2(fg) - f D^2(g) = D \big(f D(g) + g D(f) \big) - f D^2(g) \\
&= D(f)D(g) + f D^2(g) + D(g) D(f) + g D^2(f) - f D^2(g) \\
&= g D^2(f) + 2 D(f) D(g) 
\end{align*}
so actually the commutator is $[D^2, f(x)] = D^2(f) + 2 D(f) D$. Continuing this you should find that the series terminates (for cubic $f(x)$). Basically since the commutator is still an operator, you have to remember that you have to apply product rules to every derivatives, since they can still act on the test function.
Spelling it out completely for a first derivative the commutator would look like
\begin{align*}
[D, f(x)] g(x) = \Big(D f - f D\Big) g(x) = D f g - f D(g) = D(f) g + f D(g) - f D(g) = D(f) g
\end{align*}
and since $g(x)$ is arbitrary we see that $[D, f] = D(f)$.
