Derivation of parallel axis theorem

For a particle with mass $m_i$ that is $\v r_i$ from axis $A$ and $\v R_i$ from axis $A_{CM}$, it follows that $$ \v r_i = \v a + \v R_i $$ where $\v a$ is the displacement from $A$ to $A_{CM}$.

Therefore the moment of inertia about $A$ is $$\begin{align*} I &= \sum_i m_i|\v r_i|^2 \\ &= \sum_i m_i(\v a+\v R_i)\cdot (\v a+\v R_i) \\ &= a^2\underbrace{\sum_im_i}_{M} + 2\v a\cdot\underbrace{\sum_i m_i\v R_i}_{\v 0 \text{ since CM}} + \underbrace{\sum_i m_i R_i^2}_{I_0} \\ &= I_0 + Ma^2. \end{align*}$$