The design of slender beams, that is, beams with large laterally unsupported lengths, is commonly controlled by stability limit states. Beam buckling, also called "lateral torsional buckling," is different from column buckling in that a beam not only displaces laterally but also twists about its axis during buckling. The coupling between twist and lateral displacement makes stability analysis of beams more complex than that of columns. For this reason, most of the analytical studies in the literature on beam stability are concentrated on simple cases: uniform beams with ideal boundary conditions and simple loadings. This paper shows that complex beam stability problems, such as lateral torsional buckling of rectangular beams with variable cross-sections, can successfully be solved using homotopy perturbation method (HPM).