Does anyone know a general formula for computing the mass of a galaxy interior to a point at a given distance, given given the galaxy's total mass?
Knowing that galaxies have flat rotation curves, one way I can think of is to re-write the circular velocity formula to solve for M: v=sqrt(GM/r) --> M=v2r/G. So for any galaxy, the mass interior to a given r could be a function of v and r.
I imagine this is just a rough estimate, as the flat rotation curves are not perfect. Is there more widely accepted formula?