Analysis and numerical approximation of singular boundary value problems