Infinitesimally change a operator in QM Reading Balian, "From Microphysics to Macrophysics", I've found the following identity:
If we change the operator $\hat{{\mathbf{X}}}$ infinitesimally by $\hat{{\delta\mathbf{X}}}$, the trace of an operator function $f(\hat{{\mathbf{X}}})$ can be differentiated as if $\hat{{\mathbf{X}}}$ and $\delta\hat{{\mathbf{X}}}$ comutted:
$$\delta\operatorname{Tr}f(\hat{{\mathbf{X}}})=\operatorname{Tr}\left(\delta \hat{{\mathbf{X}}}f'(\hat{{\mathbf{X}}})\right).$$
What does "change an operator by $\delta \hat{{\mathbf{X}}}$" mean mathematically in this context? How I can prove that identity?
 A: Consider a one-parameter family of operators $X + \epsilon Y$, and let $f$ be an analytic function. Then we formally use linearity of the trace to obtain
\begin{align}
  \mathrm{tr}[f(X + \epsilon Y)] = \mathrm{tr}\left[\sum_{n=0}^\infty c_n(X+\epsilon Y)^n\right] = \sum_{n=0}^\infty c_n\mathrm{tr}[(X+\epsilon Y)^n]
\end{align}
But notice that
\begin{align}
  (X+\epsilon Y)^n = X^n + \epsilon (YX^{n-1} + XYX^{n-2} + \cdots + X^{n-1}Y) + O(\epsilon^2)
\end{align}
so by the cyclicity and linearity of the trace we have
\begin{align}
  \mathrm{tr}[(X+\epsilon Y)^n] = \mathrm{tr}(X^n) + n\cdot\mathrm{tr}(\epsilon YX^{n-1}) + O(\epsilon^2)
\end{align}
Plugging this back into the power series for $\mathrm{tr}[f(X+\epsilon Y)]$ gives
\begin{align}
  \mathrm{tr}[f(X+\epsilon Y)] 
&= \sum_{n=0}^\infty c_n\mathrm{tr}(X^n) + \sum_{n=0}^\infty c_n n\,\mathrm{tr}(\epsilon Y X^{n-1}) + O(\epsilon^2) \\
&= \sum_{n=0}^\infty c_n\mathrm{tr}(X^n) + \epsilon\cdot\mathrm{tr}\left(Y\cdot \sum_{n=0}^\infty c_n n\, X^{n-1}\right) + O(\epsilon^2)\\
&= \sum_{n=0}^\infty c_n\mathrm{tr}(X^n) + \epsilon\cdot\mathrm{tr}\left(Y f'(X)\right) + O(\epsilon^2)
\end{align}
It follows that
\begin{align}
  \frac{d}{d\epsilon}\bigg|_{\epsilon = 0}\mathrm{tr}[f(X+\epsilon Y)] = \mathrm{tr}\left(Y f'(X)\right)
\end{align}
Now simply make the the notational identifications $Y = \delta X$ and 
\begin{align}
   \frac{d}{d\epsilon}\bigg|_{\epsilon = 0} \mathrm{tr}[f(X+\epsilon Y)] = \delta \,\mathrm{tr}[f(X)]
\end{align}
and, the desired result is now immediate.
A: $f(\hat{X})$ usually "means" $\sum a_n \hat{X}^n$. So, big hint: Let $y$ be your infinitesimal and let $\hat{Y}$ be some operator.
 \begin{align*}
&\mathrm{Tr}f(\hat{X}+y\hat{Y})-\mathrm{Tr}f(\hat{X})=\\
&\int \langle q| \sum a_n (\hat{X}+y \hat{Y})^n|q\rangle \mathrm{d}q-\int \langle q| \sum a_n \hat{X}|q\rangle \mathrm{d}q
\end{align*}
expand ignoring higher powers of $y$ ($(\hat{X}+y \hat{Y})^n\approx \hat{X}^n+n y \hat{Y}\hat{X}^{n-1}$ isn't true, but you use cyclicity of the trace to do the same thing)
obviously there are huge mathematical problems here (with the integral of an infinite sum) but those should be ignored :)
