Let $X\in \mathbb R^d$ be a random vector and $\mu=E(X)\in \mathbb R^d$ be its mean. Let $\Sigma=E[(X-\mu)(X-\mu)^T]\in\mathbb R^{d\times d}$ be the variance-covariance matrix of X. Show that $\Sigma=E(XX^T)-\mu\mu^T$.
Attempt
Ok so I know if you have $(x-y)^T(x-y)=(x^T-y^T)(x-y)=x^Tx-2x^Ty+y^Ty$. So here I tried to do something similar. $\Sigma=E[(X-\mu)(X^T-\mu^T)]=E[XX^T-X\mu^T-\mu X^T+\mu\mu^T]=E[XX^T]-E[X\mu^T+\mu X^T]+\mu\mu^T$. There's an extra term there. Are these operations not valid for the outer product? Or what am I missing?
What you have done is fine. By linearity of expectaion $EX\mu^{T}=\mu\mu^{T}$ and $E\mu^{T}X=\mu\mu^{T}$ so we get $\Sigma=EXX^{T}-\mu \mu^{T}$.