My question is close to this one except for one term. More specifically:
$$\frac{1}{m}\sum_{i = 1}^m (x_i - \mu)^2$$
If I wanted to find the derivative of this entire term w.r.t. $x_i - \mu$, how would I go about that? Is this even possible?
Edit
I've tried the derivation but I'm not sure if this is correct. I also left out an important detail that in this context $\mu = \frac{1}{m}\sum_{i = 1}^m x_i$ (i.e. the mean of $x$'s).
$$ \begin{align} \frac{\partial \sum}{\partial (x_i - \mu)} \left(\frac{1}{m}\sum_{i = 1}^m(x_i - \mu)^2\right) & = \frac{\partial \sum}{\partial (x_i - \mu)} \frac{1}{m}\left((x_1 - \mu)^2 + \cdots + (x_m - \mu)^2\right) \\ & = \frac{1}{m}\left(2(x_1 - \mu) + \cdots + 2(x_m - \mu)\right) \\ & = \frac{2}{m}\left( (x_1 + \cdots + x_m) - 2m\mu\right) \\ & = 2\left( \dfrac{1}{m} \cdot (x_1 + \cdots + x_m) - \dfrac{1}{m} \cdot 2m\mu \right) \\ & = 2 \cdot \frac{1}{m}\sum_{i = 1}^m x_i - 4\mu \\ & = 2\mu - 4\mu \\ & = -2\mu \end{align} $$
I'm not entirely sure if this derivation is correct...