Here are three equations for some basic parameters.
Average of deviations:
$$\lim_{N\to \infty} \bar{d} = \lim_{N\to \infty} \left[\frac{1}{N}\sum(x_i-\mu) \right]= \lim_{N\to \infty} \left(\frac{1}{N}\sum x_i\right) - \mu = 0$$
Variance: $$\sigma^2 \equiv \lim_{N\to \infty} \left[\frac{1}{N}\sum(x_i-\mu)^2 \right]= \lim_{N\to \infty} \left(\frac{1}{N}\sum x_i^2\right) - \mu^2$$
Variance of a continuous distribution: $$\sigma^2 = \int_{-\infty}^\infty(x-\mu)^2p(x)dx = \int_{-\infty}^\infty x^2p(x)dx - \mu^2$$
In all of the above cases, the mean $\mu$ has been taken out of the brackets $()$ in what seems to be a violation of algebra laws. What is the justification for that?
Intuitively I think that because $\mu$ is a constant, it is unrelated to all of the other things that are going on in there, but I can't fully understand it yet.