By using the quantum Ising chain as a test bed and treating the spin polarization along the external transverse field as the generalized density, we examine the performance of different levels of density functional approximations parallel to those widely used for interacting electrons, such as local density approximation (LDA) and generalized gradient approximation (GGA). We show that by adding the lowest-order and nearest-neighbor density variation correction to the simple LDA, a semi-local energy functional in the spirit of GGA is almost exact over a wide range of inhomogeneous density distribution. In addition, the LDA and GGA error structures bear a high level of resemblance to the quantum phase diagram of the system. These results provide insights into the triumph and failure of these approximations in a general context.