TITLE: Why square the term $X - \mu$ in the definiton of the variance?
QUESTION [5 upvotes]: Why is is the variance $\operatorname{Var}(X)$  of a random variable $X$ definied to be $\operatorname{E}[(X-\mu)^2]$? My professor said that you want the variance to be positive, but why not go for  $\operatorname{E}[|X-\mu|]$ then? (Just starting on this subject so maybe a stupid question).

REPLY [2 votes]: Variances works somewhat well with sums, as already mentoined in Michael Hardy's answer. 
There is more that can be said: variance is (*) the quadratic form associated with an inner product, namely covariance , a measure of how different variables vary in relation to each other. 
That is, covariance $\operatorname{Cov}(X,Y) := E((X-EX)(Y-EY))$ is sort of like the dot product $a\cdot b$ of two vectors $a$ and $b$ and then variance $\operatorname{Var}(X) = \operatorname{Cov}(X,X)$ is sort of like the length of a vector $a$ squared $\|a\|^2$. Note that for vectors we have $\|a\cdot a\| = \|a\|^2$.
Now consider the "pythagorean theorem". In the geometry case, we have $\|a+b\|^2 = \|a\|^2 + \|b\|^2$ if $a$ is orthogonal to $b$, i.e. if $a\cdot b = 0$. Accordingly, for variables we have $\operatorname{Var}(X+Y) = \operatorname{Var}(X) + \operatorname{Var}(Y)$ if $X$ and $Y$ are uncorrolated
, i.e. if $\operatorname{Cov}(X,Y) = 0$ (note that independent variables are uncorrolated, but not vice versa).
This motivates why variance should be "quadratic". The length in this analogy, as opposed to the square of the length (variance), is called standard deviation $\operatorname{sd}(X) = \sqrt{\operatorname{Var}(X)}$.

(*) ...if we identify variables that are equal almost surely.