I have the vector $\vec c$ that is:
$\vec c= \frac{\sum_{i=1}^n m_i\vec r_i}{\sum_{i=1}^n m_i}$
where $\vec r_i$ is a vector and $m_i$ is a scalar
I need to proof the folowwing equality for any vector $\vec r $
$ \sum_{i=1}^n m_i |\vec r-\vec r_i|^2=\sum_{i=1}^n m_1|\vec r_i-\vec c|^2+m|\vec r-\vec c|^2$
and i known that $m= \sum_{i=1}^n m_i$
I try to replace the vector $\vec c$ in the equality but but i get confused with the vector algebra.
Let us use the property $$|\textbf{x}-\textbf{y}|^2 = (\textbf{x}-\textbf{y}).(\textbf{x}-\textbf{y}) = |\textbf{x}|^2 - 2\textbf{x}.\textbf{y} + |\textbf{y}|^2$$
LHS reduces to the following
$$= m|\textbf{r}|^2 - 2\textbf{r}.\left(\sum_1^n m_i\textbf{r}_i\right) + \sum_1^n m_i \textbf{r}_i.\textbf{r}_i$$
$$= m\left(|\textbf{r}|^2 - 2\textbf{r}.\textbf{c} + |\textbf{c}|^2\right) + \sum_1^nm_i(|\textbf{r}_i|^2 - |\textbf{c}|^2)$$
Can you proceed further?