# How to calculate the mass of the orbiting body given only its orbital information

A question asks the following: Using Newton’s Law of Gravity, show that the mass of a planet can be written:

$$M = \frac{4\pi^2a^3}{ GP^3}$$

where $a$ is the semi-major axis and $P$ is the orbital period.

However, having gone through a calculation where I made the centripetal force equal to the force of gravity between the two, I found that the mass of the orbiting planet actually cancelled out, so I suspect that the question may be wrong and that this equation actually gives the mass of the body being orbited. If this is true, is there anyway to calculate the mass of the orbiting body given only its orbital information (radius, period, mass of the body it orbits etc.), and not information about a satellite that orbits it?

Hope that makes sense

The correct formula is actually $$M = \frac{4\pi^2 a^3}{GP^2}$$ and is a form of Kepler's third law. $M$ in this formula is the central mass which must be much larger than the mass of the orbiting body in order to apply the law.
In reality the formula that should be used is $$M_1 + M_2 = \frac{4\pi^2 a^3}{GP^2},$$ where $M_1+ M_2$ is the sum of the masses of the two objects and $a$ is the semi-major axis. This obviously reduces to Kepler's third law if $M_1 \gg M_2$.
So with a measurement of $P$ and $a$ alone you can only constrain the sum of the two masses. In order to get the individual masses you need additional information that could be for instance: the relative orbital speeds of the two objects or the relative sizes of the two orbits, both of which would give you the mass ratio $M_1/M_2$.
is exactly right. In general, there is no way to infer the mass of a body using any measurements of its response to gravitational forces, because in its equation of motion, $$m\mathbf a=m\mathbf g,$$ where $\mathbf a$ is the body's acceleration and $\mathbf g$ is the local gravitational field, the body's mass $m$ will always cancel. To measure the mass of an astronomical body, you always need dynamical information of how its gravity affects other bodies that orbit it or otherwise interact with it.