By using a transformation introduced formerly,a nonlinear partial differential equation was reduced to a nonlinear ordinary differential equation,and then solved directly.A series of explicit and exact analytical solutions to the KdV equation and KdV-Burgers equation,including solitary wave solutions and singular travelling wave solutions etc.,were derived easily.