Majorization under constraints and bounds of the second Zagreb index