Solving solitary waves with discontinuity by means of the homotopy analysis method