Buckling of laminated composite and sandwich beams due to axially varying in-plane loads