Centres of Mass
Every rigid body has a single point where its whole weight can be treated as acting. For a uniform rod that's just the midpoint — but for a non-uniform one, you have to find it using moments.
Uniform vs non-uniform bodies
So far, every rod or beam you've met has been uniform — its mass is spread evenly along its length, so its centre of mass sits exactly at the midpoint. That's why the weight of a uniform rod always acts "at the middle" in earlier moment equations.
A non-uniform rod doesn't have this symmetry: it might be thicker at one end, or made of different materials along its length. Its centre of mass can lie anywhere, and you're usually given enough information — such as the reactions at two supports — to calculate exactly where.
The centre of mass of a rigid body is the single point at which its entire weight can be considered to act. For a uniform rod or beam, this is the midpoint of its length. For a non-uniform body, its position must be found from the given information — typically by taking moments.
Using a known centre of mass
If you already know where the centre of mass of a non-uniform body is, you treat the problem exactly like any other rigid-body equilibrium question: the weight acts as a single downward force at that point, and you resolve and take moments as usual.
Worked example 1
$26g(x-2.5) = 22g(0.4) + 16g(2.5)$
Finding an unknown centre of mass
More often, the centre of mass itself is the unknown. If you're given the reactions at two supports — or a relationship between them — you can take moments about one support to find where the weight must act for the body to balance.
Worked example 2
The reaction at $D$ is twice the reaction at $C$, so more of the rod's weight is supported near $D$ — you'd expect the centre of mass to sit closer to $D$ than to $C$. Here $x=2.53$ is indeed closer to $D$ (at $3.2$) than to $C$ (at $1.2$), which confirms the answer is physically sensible.
Assuming the centre of mass is at the midpoint just because a question doesn't draw attention to it. Always check whether a rod or beam is described as uniform or non-uniform — the word "uniform" is doing real mathematical work. If a body is non-uniform and no position is given for its centre of mass, you almost always need to find it first, usually via moments, before the rest of the problem can be solved.
Check yourself
A non-uniform rod $AB$ is $3\ \text{m}$ long and has weight $12\ \text{N}$. It rests horizontally on supports at $C$ and $D$, where $AC=0.5\ \text{m}$ and $AD=2.5\ \text{m}$. The reaction at $C$ is three times the reaction at $D$. Find the distance of the centre of mass of the rod from $A$.
Let the reaction at $D$ be $R$, so the reaction at $C$ is $3R$. Resolving vertically: $3R+R=12 \Rightarrow R=3\ \text{N}$, so $R_C=9\ \text{N}$ and $R_D=3\ \text{N}$.
Taking moments about $A$: $12x = 9(0.5)+3(2.5) = 4.5+7.5=12 \Rightarrow x=1\ \text{m}$ from $A$.