Gradient corrections in the exchange and correlation energy of an inhomogeneous electron gas