How does one measure the mass of a galaxy? And other such large quantities? Trained as a pure mathematician, I see claims about the mass of a galaxy and other such huge measurements that are arrived at experimentally, and I just have to scratch my head.
I know this is a bit of a vague question--but does anyone have a good resource for something like "measurement in astrophysics" or an introductory history of how astrophysicists figured out how to make measurements of this kind?
 A: One common way of making these measurements is gravitational lensing. Basically, astronomers look at some distant object which is located directly behind the galaxy in question. Since the galaxy is so massive, it bends the light from the more distant object around it, so we see an image of the object displaced by some angle from where it actually is in the sky. For a distant object in the right position, we can see multiple images, one from light deflected to the left and one from light deflected to the right. Measuring the angular separation between them allows you to compute the angle by which the light was bent, and in turn to determine the mass of the galaxy required to produce that deflection.
For galaxies that are less massive but closer, close enough to resolve the spectra of individual stars, we can measure the Doppler shifts of the spectra of stars on the advancing side of the galaxy and on the receding side, and taking the difference gives (twice) the tangential speed of the stars at that radius, which is related to the amount of mass contained within that radius. So measuring the spectra of stars at the edge of the galaxy, or in e.g. a globular cluster that orbits the galaxy, can give you the total mass contained in the galaxy.
A: The best way of measuring the mass is in principle using gravitational lensing, as mentioned in the first posted answer to this question. However, applying this method has become feasible only relatively recently, partly because lensing is relatively rare and requires 'lucky' alignment of the source and the lens, and thus a large telescope survey to find enough of them and with an excellent spatial resolution (typically below an arcsecond) to resolve the source images. Moreover, in detail it is hard to apply. You don't know the 'density profile' (radial distribution of mass in the galaxy) a priori, so you need to measure it. Therefore, ideally you need to have multiple sources of light behind a single galaxy at different angular locations, so that each source probes the galaxy mass M(R) enclosed at some radius. This can be done using the method called weak gravitational lensing (and it would take us beyond the scope of the question to talk about it). Anyway, this kind of measurement has started to happen only in recent years. 
Traditionally in astrophysics, the mass of the galaxy is instead measured using various dynamical methods where velocities of stars are converted to the mass. But I disagree with Ernie that this is easy to do using Newton's Laws. The difficulties include the fact that you are only measuring the radial (and not tangential) velocity of the star(s) using spectroscopy; that the distribution of the mass of the galaxy may not be spherically symmetric, etc. 
Traditionally people have used the virial theorem, most famously first used by Fritz Zwicky in 1933 to measure the mass of the Coma cluster of galaxies. In this approach, under some assumptions, one can relate the mass of the cluster to velocity dispersion of galaxies along the line of sight, and you can measure the latter as described in the earlier post to this question. (This brilliant logic, using existing measurements at the time, led Zwicky to announce that Coma must be dominated by invisible, dark, matter). 
There are also other methods to get masses, but they are messy. Typically, one infers the mass-to-light ratio of the object (M/L), and then measures L to get M. These approaches have significant uncertainties. Therefore, as mentioned in the post above, gravitational lensing is in principle the cleanest method.  
