How do derivatives of operators work? Do they act on the terms in the derivative or do they just get "added to the tail"? Is there a conceptual way to understand this?
For example: say you had the operator $\hat{X} = x$. Would $\frac{\mathrm{d}}{\mathrm{d}x}\hat{X}$ be $1$ or $\frac{\mathrm{d}}{\mathrm{d}x}x$? The difference being when taking the expectation value, would the integrand be $\psi^*\psi$ or $\psi^*(\psi+x\frac{\mathrm{d}\psi}{\mathrm{d}x})$?
My specific question is about the band effect in solids. To get a better understanding of the system, we've used Bloch's theorem to express the wavefunction in the form $\psi = e^{iKx}u_K(x)$ where $u_K(x)$ is some periodic function. With the fact that $\psi$ solves the Schrodinger equation, we've been able to derive an "effective Hamiltonian" that $u_K$ is an eigenfunction of, $H_K = -\frac{\hbar^2}{2m}(\frac{\mathrm{d}}{\mathrm{d}x}+iK)^2+V$. My next problem is to find $\left\langle\frac{\mathrm{d}H_z}{\mathrm{d}K}\right\rangle$, which led to this question.
Some of my reasoning: An operator is a function on functions, so like all other functions we can write it as $f(g(x))$. When you take the derivative of this function, you get $f'(g(x))*g'(x)$. So looking at the operator, $\hat{X}$, we can say that it is a function on $\psi(x)$, $\hat{X}(\psi)= x\psi$. So taking the derivative gives us: $$\frac{\mathrm{d}\hat{X}}{\mathrm{d}x} = \psi+ x\frac{\mathrm{d}\psi}{\mathrm{d}x}$$ but you could also say that $\hat{X}=x$ (not a function), so $$\frac{\mathrm{d}\hat{X}}{\mathrm{d}x} = \frac{\mathrm{d}}{\mathrm{d}x}x = 1$$ Now I'm inclined to say that $\hat{X}$ is a function, but it seems like for this question, it is better to just treat is as a constant and naively (in my opinion) take its derivative. So which way do I do it?