An integral equation formulation of two- and three-dimensional nanoscale inhomogeneities