Here are the proofs regarding the center of mass motion as reported on my book.
$$\vec{r_{cm}}=\frac{\sum\vec{r_i} m_i}{\sum m_i}$$
$$\vec{v_{cm}}=\frac{d{\vec{r_{cm}}}}{dt}=\frac{1}{M}\sum \frac{d}{dt} m_i \vec{r_i}=\frac{1}{M} \sum m_i \vec{v_i}=\frac{1}{M} \vec{P} \tag{1}$$
$$\vec{a_{cm}}=\frac{d{\vec{v_{cm}}}}{dt}=\frac{1}{M}\sum \frac{d}{dt} m_i \vec{v_i}=\frac{1}{M} \sum m_i \vec{a_i}=\frac{1}{M} \vec{F^{(EXT)}}=\frac{1}{M} \frac{d\vec{P}}{dt} \tag{2}$$
Both in $(1)$ and $(2)$ derivatives this assumption was made: the mass of the system $M$ and the mass of each point $m_i$ are constant. Otherwise the derivatives would have been much more complicated.
But I also read that $$\vec{F^{(EXT)}}= \frac{d\vec{P}}{dt}\tag{3}$$
Holds true also if the mass is not constant.
Nevertheless to prove $(2)$ (and so $(3)$) the assumption of constant mass was used, so how can $(3)$ be true without that assumption?
And if $(3)$ holds which mass can vary? The mass of the system $M$ or the mass of the single points $m_i$?