Application of the method of the kernel function for solving boundary-value problems