I have a function $$g(\hat{\vec{x}}) = e^{-(\hat{\vec{x}} - \vec{r})^2 / 2r_c^2}$$ Here, $\hat{\vec{x}}$ is the position operator, $r_c$ is parameter and $\vec{r}$ denotes a classical position. I want to expand this around $\hat{\vec{x}}$, which I assume to be valid if $||\hat{\vec{x}}_{\alpha}|| \ll |\vec{x}|, |r|$, where $||*||$ is an operator norm. Is this assumption correct, or am I on the wrong track here?
The expansion up to first order is given then by $$g(\hat{\vec{x}}) \approx g(0) + \nabla g(\hat{\vec{x}})|_{\hat{\vec{x}} = 0} * \hat{\vec{x}}$$
I evaluate the gradient by first doing the outer derivatives $$\nabla g(\hat{\vec{x}})|_{\hat{\vec{x}} = 0} = e^{\vec{r}^2 / 2r_c^2} \frac{\vec{r}}{r_c^2}\nabla (\hat{\vec{x}} - \vec{r})|_{\hat{\vec{x}} = 0}$$ Now, I do get stuck on the last factor in the above expression $$\nabla (\hat{\vec{x}} - \vec{r})|_{\hat{\vec{x}}$$
In particular, I do not understand how to take the derivative of an operator which isn't given in any basis. Is that even possible? Is there any intuition on how to understand the derivative of the position operator?
I would be very grateful for any hints on how to solve this.
Thanks!