Small amplitude wave in shallow water over linear and quadratic sloping beds