For a cascade multilevel inverter, switching angles at fundamental frequency are obtained by solving the selective harmonic elimination equations in such a way that the required fundamental voltage is obtained while eliminating certain lower order harmonic components. Due to nonlinear transcendental nature of these equations, there may exist simple, multiple or even no solution for a particular value of modulation index. In this article, an optimization based technique is implemented for solving the nonlinear transcendental equations producing all possible solutions. The objective function chosen is sum of square of harmonic components to be eliminated, and the solution (switching angles) is said to be obtained when the objective function is identically zero. The switching angles for different level of voltage unbalancing factors have been calculated for an 11-level cascade multilevel inverter. Since the THD in the output voltage depends very much on the values of calculated switching angles, therefore, in this work, THD corresponding to different solution sets have been computed and compared for each set of voltage unbalancing factors. For the verification of computational results, MATLAB simulations on an 11-level CMLI using IVIATLAB/SIMULLNK are carried out. It has been observed that the computational/analytical results are in close agreement with the simulated results hence verifying computational results.