An introduction to modern astrophysics and cosmology