Although for many years scientists and engineers have been faced with the problem of optimizing discrete functions, no general analytical method has been proposed for multidimensional discrete optimization. All the methods that have already been reported in the literature are algorithmic. In one dimensional discrete optimization, no general analytical method has yet been proposed to find all the local minima and maxima of multimodal one dimensional discrete functions either. In this paper, for the first time, a general analytical method has been proposed for solving multidimensional and multimodal discrete optimization problems. Here, first we will introduce the method and present its mathematical proof, and then confirm its validity through some examples and computer simulations.