Device-to-Device (D2D) communication is one of the technologies for next generation communication system. Unlike traditional cellular network, D2D allows proximity users to communicate directly with each other without routing the data through a base station. In this paper, we propose a resource allocation scheme for energy efficiency (EE) optimization in cellular network with overlaying D2D communication. The objective of this work is to maximize the overall EE of the network while satisfying the rate and power constraints for all users. We decompose the main problem into two subproblems; resource efficiency (RE) optimization for cellular user in the first stage and EE optimization for D2D pair in the second stage. The RE optimization problem is solved using the bisection
method while Dinkelbach and interior point method are implemented to solve the EE optimization problem. Simulation results demonstrate that the proposed scheme outperforms the cellular mode and dedicated mode of communication and the performance is close to the global optimal solution.