How to find the mass density function of a solid given its total mass, its volume and the position of its center of mass? I would like to know how to find the mass density function $\rho=f(\vec{r})$ of a solid rectangle of length $a$, width $b$ and height $c$, given:


*

*its mass: $m$

*its center-of-mass position: $\vec{r}_{CM} = \begin{bmatrix} \bar{x} & \bar{y} & \bar{z} \end{bmatrix}^T$
This with the objective of finding the mass moment of inertia tensor of an object knowing that its center of mass does not coincide with its geometric center.
Thanks!
 A: This is impossible to do because the total mass and center of mass do not uniquely define a mass distribution $\rho(\mathbf r)$.
The total mass is
$$M=\int\rho(\mathbf r)\text dV$$
the center of mass is
$$\mathbf r_{\text{com}}=\frac{1}{M}\int\mathbf r\rho(\mathbf r)\text dV$$
Since $\rho(\mathbf r)$ is contained within the integrands of these integrals you can't have a unique density function. Integrals do not uniquely determine an integrand. Even more specifically, the center of mass is essentially just a weighted average. If I told you that I have a list of numbers whose average is $10$, would you be able to tell me which numbers I used? You would not be able to without additional information.
A really easy counter-example is just to consider two similar objects of different sizes. For example, a sphere of volume $V$ and a sphere of volume $2V$. If you make the uniform density of the smaller sphere $2\rho$ and the density of the larger sphere $\rho$, then they both have a mass $2\rho V$. Furthermore the center of mass of each sphere is located at the center of the sphere. Therefore, we have two objects with the same mass and same center of mass location, but they have different mass density functions. 
A: The density function is not uniquely defined.
Let $a,b,c$ be the lengths of the sides of the cuboid and $m$ the mass. Consider $\rho(\vec{r}) = \frac{m}{abc}$ and $$\rho(\vec{r}) = \rho(x,y,z) = \frac{12m}{a^3bc}\left(x-\frac{a}2\right)^2$$
Then both density functions yield the center of mass $\left(\frac{a}2, \frac{b}2, \frac{c}2\right)$.
