I'm learning about center of mass, but I have trouble understanding the definition. How is $x_{com}=\frac{1}{M}\sum_{i=1}^{n}m_ix_i$ equal to $x_{com}=\frac{1}{M}\int xdm$?
At first I thought it should be $x_{com}=\frac{1}{M}\int mdx$ since the function of mass in terms of position sounded better to me. But then I found this question, so I understood that $\frac{1}{M}\int mdx$ equals one because mass as a function of $x$ is the density function, and the integral of the density function is always equal to $M$. But that doesn't mean that I understood why $x_{com}=\frac{1}{M}\int xdm$. Since two or more positions can have same mass, the function of position in terms of mass does not exist according to the the definition of a function, does it?
