Kepler's third law says the square of a planet's period is proportional to the cube of its orbit's size. Satellites in Orbit has everything needed to derive it, and the derivation turns it into a scale for weighing planets and stars.
Why it works
For a circular orbit of radius $r$ and period $T$, the speed is $v = 2\pi r/T$, and gravity supplies the centripetal force: $$\dfrac{GMm}{r^2} = \dfrac{mv^2}{r} = \dfrac{4\pi^2mr}{T^2}.$$ The satellite's mass $m$ cancels, leaving $T^2 = \dfrac{4\pi^2}{GM}r^3$. Newton also showed that the same formula holds for an ellipse with $r$ replaced by the semi-major axis $a$.
Key idea
$$T^2 = \dfrac{4\pi^2}{GM}r^3.$$ It doesn't depend on the orbiting body's mass (when that is small compared with $M$), and $r$ is measured from the center of the central body. Solved for $M$: $M = \dfrac{4\pi^2r^3}{GT^2}$, which weighs a planet from any moon's orbit.
Worked example: A satellite's period
Find the period of a satellite $400\ \text{km}$ above Earth ($GM = 3.986 \times 10^{14}\ \text{m}^3/\text{s}^2$, $R = 6.371 \times 10^{6}\ \text{m}$).
- $r = R + h = 6.771 \times 10^{6}\ \text{m}$ (from Earth's center).
- $$T = 2\pi\sqrt{\dfrac{r^3}{GM}} = 2\pi\sqrt{\dfrac{(6.771 \times 10^{6})^3}{3.986 \times 10^{14}}} = 5545\ \text{s} \approx 92.4\ \text{min}$$
Answer: About $92\ \text{min}$, like the International Space Station.
Worked example: Weighing Jupiter
Jupiter's moon Io orbits at $4.217 \times 10^{8}\ \text{m}$ with a period of $1.769$ days. Find Jupiter's mass.
- $T = 1.769 \times 86\,400 = 1.528 \times 10^{5}\ \text{s}$.
- $$M = \dfrac{4\pi^2r^3}{GT^2} = \dfrac{4\pi^2(4.217 \times 10^{8})^3}{(6.674 \times 10^{-11})(1.528 \times 10^{5})^2} = 1.90 \times 10^{27}\ \text{kg}$$
- About 318 Earth masses, matching NASA's figure.
Answer: $1.90 \times 10^{27}\ \text{kg}$.
If the orbiting body is not small, both bodies circle their common center of mass, and the law becomes $T^2 = \dfrac{4\pi^2a^3}{G(M + m)}$. For the Moon around Earth that matters at about the 1% level; for Io around Jupiter it is negligible. The same law with $a$ in AU, $T$ in years and masses in solar masses reads $T^2 = a^3/(M + m)$, which is how astronomers weigh stars in binary systems.
Common mistake
Using the altitude instead of the distance from the center, or putting the satellite's mass into the formula. A satellite 400 km up is $6.77 \times 10^{6}\ \text{m}$ from the center, not $4 \times 10^{5}\ \text{m}$; using the altitude gives a period of a few minutes, far too short. And the satellite's mass canceled in the derivation. Check: a geostationary orbit needs $T = 1$ sidereal day, which gives $r = 42\,164\ \text{km}$ from the center, about 35,800 km up.