How can the center of mass of a region with density $d[x, y]$ be understood as as a kind of (average x-value, average y-value)? For a region of uniform density, the center of mass is equal to centroid, which is equal to:
$$(\text{average x-value}, \text{average y-value}) = \left(\frac{\int\int_R{x}\,dxdy}{ \int\int_R{1}\,dxdy}, \frac{\int\int_R{y}\,dxdy}{ \int\int_R{1}\,dxdy}\right)$$
For density $d[x, y]$, the center of mass is instead:
$$\left(\frac{\int\int_R{x d[x, y]}\,dxdy}{ \int\int_R{d[x, y]}\,dxdy}, \frac{\int\int_R{y d[x, y]}\,dxdy}{ \int\int_R{d[x, y]}\,dxdy}\right)$$
Is there a way to understand the center of mass with variable density using this same idea of an average value? The uniform density center of mass is analogous to finding the mean value in 1D ($\frac{\int_a^b f[x]\,dx}{b - a} = \frac{F[b] - F[a]}{b -a}$); is there a way a similar way to understand center of mass for variable density?
When I look online (such as this and this), they use moment and mass, which I don't really grasp. So, preferably, I would like an explanation that doesn't use these concepts; or if they are necessary, an explanation that explains what they are and why they are necessary. What is the connection between $\left(\frac{M_y}{m}, \frac{M_x}{m}\right)$, and $\left(\frac{\int\int_R{x}\,dxdy}{ \int\int_R{1}\,dxdy}, \frac{\int\int_R{y}\,dxdy}{ \int\int_R{1}\,dxdy}\right)$ and $\left(\frac{\int\int_R{x d[x, y]}\,dxdy}{ \int\int_R{d[x, y]}\,dxdy}, \frac{\int\int_R{y d[x, y]}\,dxdy}{ \int\int_R{d[x, y]}\,dxdy}\right)$?
(One thought I had was: the reason the uniform density center of mass works is because all surrounding areas around the point balance out. (If you draw a straight line through the point, two mass of the two sides are the same. Or maybe another way of thinking of it is, if you take the integral of both sides created by the line, those two masses are equal). Perhaps the center of mass with variable density can be derived similarly?)
Sorry if this is very rambling.
 A: The idea of center of mass is that you have a point in space that behaves like if all the mass of the given object is concentrated in that point. So how would you describe this? Let's suppose that you divide the object into infinitesimal masses with density $d(x,y,z)$ and volume $dV=dxdydz$. Then, if the acceleration of the object is $\vec a$, we can write $$\iiint_V d(x,y,z) \vec a dxdydz=\vec a\iiint_V d(x,y,z) dxdydz=M\vec a$$
Here $M$ is the mass of the object.
But there is one more condition. That is that the sum of torques with respect to the center of mass. This is equivalent of saying that all points in the object move with the same acceleration. So the infinitesimal torque is $$d\vec F\times(\vec r-\vec r_{CM})=dxdydz\ d(x,y,z)\vec a\times(\vec r-\vec r_{CM})$$
You can get the integral equal to zero for any $\vec a$ only if $$\iiint_Vdxdydz\ d(x,y,z)(\vec r-\vec r_{CM})=0$$
We can write the last equation by components. I will just do it for $x$:
$$\iiint_Vdxdydz\ d(x,y,z)(x-x_{CM})=0\\\iiint_Vdxdydz\ d(x,y,z)x-\iiint_Vdxdydz\ d(x,y,z)x_{CM}=0$$
So from here $$x_{CM}=\frac{\iiint_Vdxdydz\ d(x,y,z)x}{\iiint_Vdxdydz\ d(x,y,z)}=\frac{M_x}M$$
What this expression tells you is that the center of mass position is the weighted average of the positions of all the points in the object. If the density is constant, then it reduces straight to the simple average.
Note for your problem the density function is two dimensional, so you can ignore the $z$ direction for integration. Also, use for example the gravity along the $-\hat z$ as $\vec a$, if you want to reproduce the calculations in 2D.
