Radiation forces on a microsphere in an arbitrary refractive index profile