Classes of solutions in the problem of stability analysis in bars with varying cross-section and axial distributed loading