An approximate method of solving boundary value problems