Device-to-device communication is a cellular network communication technique in which cellular user devices directly communicate with each other without a base station. In the present work, resource sharing methods of device device users and cellular users are examined in terms of channel capacity gain. For this purpose, the problem of determining the transmit power values that provide the best data rate has been solved using nonlinear programming. The analysis is shown numerically for randomly generated cellular network scenarios. As a result, it has been shown that non orthogonal resource sharing method in device-to-device communication provides higher data rate gain compared to the orthogonal channel sharing method.