Solution (source code)

= Solution

Let $\mathbf n$ point from medium 1 to medium 2. Integrate $\nabla\cdot\mathbf D=\rho_f$ over a thin <Gaussian pillbox> crossing the interface. As its thickness tends to zero, the side contribution vanishes and any free <surface charge density> $\sigma_f$ gives
$$
\boxed{\mathbf n\cdot(\mathbf D_2-\mathbf D_1)=\sigma_f.}
$$
Apply $\oint\mathbf E\cdot d\boldsymbol\ell=0$ to a thin rectangular loop spanning the same interface. Its short sides vanish in the limit, so the tangential <electric field> is continuous:
$$
\boxed{\mathbf n\times(\mathbf E_2-\mathbf E_1)=0.}
$$
For a clean dielectric interface with no free <surface charge density>, these <electrostatic interface boundary conditions> reduce to $D_{1n}=D_{2n}$ and $E_{1t}=E_{2t}$. In particular $\epsilon_1E_{1n}=\epsilon_2E_{2n}$; the normal <electric field> itself need not be continuous. Bound polarization charge is already incorporated into $\mathbf D$.