Abstract
An analytic technique, namely the homotopy analysis method, is applied to solve shallow water waves governed by the nonlinear KdV equation. Explicit analytic solutions of periodic and solitary waves axe given and compared with exact ones. This verifies the validity of the homotopy analysis method for nonlinear wave problem.