An efficient and simple approximate technique for solving nonlinear initial and boundary-value problems