# What happens to the electric field at the boundary of a dielectric?

The question in the title is a broader one, but for now, I want to confine myself to the following problem.

I have the task to find the potential difference between points A and B shown in the diagram.

The point B is vertically below A. $k_1$, $k_2$ and $k_3$ refer to the dielectric constants of the slabs. The thickness of the slab of dielectric constant $k_1$ is $x$, and correspondingly for $k_2$ is $y$.

Now, using formulae for parallely connected capacitors, we find the potentials of points A and B to be equal to: $$V_A = \dfrac{V}{1+\frac{k_2}{k_1}\frac xy}$$ $$V_B = \dfrac{V}{1+\frac xy}$$

But, if we calculate the integral $\displaystyle V_{AB}=-\int_B^A\vec{E\,}\cdot\mathrm d\vec{r\,}$, then we get potential difference to be zero! Why does this integral not give the actual potential difference between the two points? I suspect this is due to something wierd happening to the field at the boundary of $k_3$ slab and the $k_1$ and $k_2$ slabs.

Thank you.