# Time dependence of a function of an operator

Suppose I know the time evolution of an operator is given by $\dot{\hat{O}} = \frac{i}{\hbar}[\hat{H}(t), \hat{O}(t)]$. Now I want to look at a function $\hat{f}(\hat{O}$, and I want to know the time evolution of the "values" of this function. I assume that I can expand $\hat{f}$ in a taylor series: Since $\hat{O}$ has an Unitary time evolution $U$, I can write: $$\hat{f}(\hat{O}(t)) = \Sigma_i c_i \hat{O}^i(t) = \\ \Sigma_i c_i (\hat{U}_{t, t_0} \hat{O}(t_0) \hat{U}_{t_0, t})^i = \\ \Sigma_i c_i \hat{U}_{t, t_0} \hat{O}(t_0)^i \hat{U}_{t_0, t} = \\ \hat{U}_{t, t_0} \hat{f}(\hat{O}(t_0)) \hat{U}_{t_0, t}$$ Then computing the time derivative will yield: $$\frac{d}{dt} \hat{f}(\hat{O}(t)) = \frac{i}{\hbar}[\hat{H}, \hat{f}(\hat{O}(t))]$$

However, I fail to arrive at this same result, if I try to compute the derivative directly: $$\frac{d}{dt} \hat{f}(\hat{O}(t)) = \Sigma_{j=1} c_j j \hat{O}^{j-1}(t) \dot{\hat{O}}\\ = \Sigma_{j=1} c_j j \hat{O}^{j-1}(t) \frac{i}{\hbar}[\hat{H}(t), \hat{O}(t)]$$ To arrive at the same result, I would have to permute the Hamiltonian $\hat{H}$ through the whole product $(\hat{O}(t))^{j-1}$. I'm stuck here. Am I making a mistake somewhere?

$$\frac{d}{dt}(A(t)B(t))=(\frac{d}{dt}A(t))B(t)+A(t)(\frac{d}{dt}B(t)).$$
What user Sunyam said about a non-commutative Leibniz rule is precisely right. Therefore OP's last step for the $$j$$'th power should be
$$\frac{d}{dt} O^j~\stackrel{\text{Leibniz}}{=}~\sum_{i=0}^{j-1} O^i \dot{O} O^{j-1-i}~=~\frac{i}{\hbar} \sum_{i=0}^{j-1} O^i [H,O] O^{j-1-i}~=~\frac{i}{\hbar} [H,O^j] .$$