The first and second boundary value problems for nonlinear second order differential equations