Let's apply the material from the post on boundary conditions to calculate a transfer matrix. We will consider a TE wave travelling between materials with parameters μ1,ϵ1\mu_1,\epsilon_1 and μ2,ϵ2\mu_2,\epsilon_2:

We consider electromagnetic waves propagating horizontally along the z-axis, with the vertical axis denoted by x. There is a vertical boundary at the centre, with unit normal nhat. The left-hand side region has parameters mu1 and epsilon . There is a field propagating towards the right denoted by a1, with electric field out of the page and magnetic field pointing upwards to the right. This has overall wavevector k1, pointing to the bottom right, broken up into k1z along the z-axis and k1x along the x-axis. There is also a backwards-propagating field denoted b1, with electric field out of the page, and B pointing to the bottom right. The overall wavevector is to the bottom-left. The right-hand side has parameters mu2 and epsilon2. The forward propagating field is denoted c1, with B to the top left, E out of the page, and overall wavevector pointing top-right. The backwards propagating field is denoted d1, with B pointing to the top right, E out of the page, and overall wavevector to the top-left.

There are a few things to note:

  1. This is a TE wave, so the electric field E\mathbf{E} is \emph{transverse} to the plane of incidence. In this case we chose to let E\mathbf{E} point into the page, which then determines the direction of the magnetic field since (k,E,B)(\mathbf{k},\mathbf{E},\mathbf{B}) form a right-handed coordinate system.
  2. The total wavevector k\mathbf{k} is made up of a component kzk_z in the zz-direction and kxk_x in the xx direction.
  3. The field on each side is made up of a forward-propagating wave (a1,c1a_1,c_1) and a backward propagating wave (b1,d1b_1,d_1). On the left we have

[eqTotalE]: E=(a1ei(k1zzωt)+b1ei(k1zzωt))eikxx, E=\left(a_1e^{i(k_{1z}z-\omega t)}+b_1e^{i(-k_{1z}z-\omega t)}\right)e^{ik_xx},

and similarly for the right.

We want (a1,b1)(a_1,b_1) to represent the electric field in the first medium, but do we want them to represent E\mathbf{E} or D\mathbf{D}? To decide, let's take a look at the boundary conditions:

n^(B2B1)=0;;n^×(E1E2)=0, \hat{\mathbf{n}}\cdot\left(\mathbf{B}_2-\mathbf{B}_1\right)=0;; \hat{\mathbf{n}}\times\left(\mathbf{E}_1-\mathbf{E}_2\right)=0,
n^(D2D1)=0;;n^×(H2H1)=0.\hat{\mathbf{n}}\cdot\left(\mathbf{D}_2-\mathbf{D}_1\right)=0;;\hat{\mathbf{n}}\times\left(\mathbf{H}_2-\mathbf{H}_1\right)=0.

The electric field is perpendicular to the boundary, so n^(D2D1)=0\hat{\mathbf{n}}\cdot(\mathbf{D}_2-\mathbf{D}_1)=0. On the other hand since E\mathbf{E} is perpendicular to n^\hat{\mathbf{n}}, you can convince yourself that the other boundary condition for the electric field gives E1=E2\mathbf{E}_1=\mathbf{E}_2. Thus the electric field is continuous across the boundary, so we want (a1,b1)(a_1,b_1) to represent the electric field. In this case if a1,b1a_1,b_1 are the fields just before the boundary and c1,d1c_1,d_1 the fields just after, we have

E1=E2, \mathbf{E}_1 = \mathbf{E}_2,
a1+b1=c1+d1.a_1+b_1 =c_1+d_1.

Note that we have chosen coordinates such that the exponentials in Eq. [eqTotalE] are one right at the boundary.

Aside: If we had a TM wave we would choose (a1,b1)(a_1,b_1) to represent H\mathbf{H} rather than B\mathbf{B}, since H\mathbf{H} is what would be continuous across the boundary and we would again have a1+b1=c1+d1a_1+b_1=c_1+d_1. Note that this is just a convenience; you could use B\mathbf{B} if you really wanted to, and using B=μH\mathbf{B}=\mu \mathbf{H} the boundary condition would then become (a1+b1)/μ1=(c1+d1)/μ2(a_1+b_1)/\mu_1=(c_1+d_1)/\mu_2.

We need one more relation between the a1,b1,c1,d1a_1,b_1,c_1,d_1, and we have two two boundary conditions we haven't used so far:

n^(B2B1)=0;;n^×(H2H1)=0. \hat{\mathbf{n}}\cdot(\mathbf{B}_2-\mathbf{B}_1)=0;;\hat{\mathbf{n}}\times(\mathbf{H}_2-\mathbf{H}_1)=0.

These are in terms of the magnetic field, which we want to relate to the electric field. This comes from Maxwell's equation:

×E=tB=iωB. \nabla\times\mathbf{E}=-\partial_t\mathbf{B}=i\omega\mathbf{B}.

What would happen if we took the B\mathbf{B} equation? Since B\mathbf{B} is being dotted with n^\hat{\mathbf{n}}, we see that the zz-component of B\mathbf{B} is continuous across the boundary. This tells us that (×E)z(\nabla\times\mathbf{E})_z is continuous, which is:

(×E)z=EyxExy=Eyx, (\nabla\times\mathbf{E})_z=\frac{\partial E_y}{\partial x}-\frac{\partial E_x}{\partial y}=\frac{\partial E_y}{\partial x},

since only EyE_y is nonzero. Meanwhile the H\mathbf{H} equation gives us a relation for the xx-component of H\mathbf{H}, and

[eqCurlEx]: (×E)x=EzyEyz=Eyz. (\nabla\times\mathbf{E})_x=\frac{\partial E_z}{\partial y}-\frac{\partial E_y}{\partial z}=-\frac{\partial E_y}{\partial z}.

The wave is propagating in the zz direction, so this is what we want.

Using B=μH\mathbf{B}=\mu\mathbf{H}, Eq. [eqCurlEx] tells us that

1μ1EyzLeft=1μ2EyzRight. \left.\frac{1}{\mu_1}\frac{\partial E_y}{\partial z}\right\rvert_{Left}=\left.\frac{1}{\mu_2}\frac{\partial E_y}{\partial z}\right\rvert_{Right}.

Looking at \cref{eqTotalE} the left hand side is

ik1zμ1(a1b1), \frac{ik_{1z}}{\mu_1}\left(a_1-b_1\right),

while the right hand side will be

ik2zμ2(c1d1). \frac{ik_{2z}}{\mu_2}\left(c_1-d_1\right).

Thus this boundary condition is:
[eqSecondBoundary]: a1b1=μ1μ2k2zk1z(c1d1). a_1-b_1=\frac{\mu_1}{\mu_2}\frac{k_{2z}}{k_{1z}}(c_1-d_1).

The last thing is to write k2z/k1zk_{2z}/k_{1z} in terms of the parameters of the material. We know that k=ωμϵ|k|=\omega\sqrt{\mu\epsilon}, and kx2+kz2=k2k_x^2+k_z^2=k^2. Thus

k1z=ω2μ1ϵ1kx2,k_{1z} = \sqrt{\omega^2\mu_1\epsilon_1-k_x^2},
k2z=ω2μ2ϵ2kx2.k_{2z} = \sqrt{\omega^2\mu_2\epsilon_2-k_x^2}.

[eqSecondBoundary] thus gives us our second boundary equation:

a1b1=μ1μ2ω2μ2ϵ2kx2ω2μ1ϵ1kx2(c1d1). a_1-b_1=\frac{\mu_1}{\mu_2}\sqrt{\frac{\omega^2\mu_2\epsilon_2-k_x^2}{\omega^2\mu_1\epsilon_1-k_x^2}}(c_1-d_1).

This is in terms of the frequency of the wave ω\omega, the parameters μi,ϵi\mu_i,\epsilon_i of the material, as well as kxk_x, which is a parameter telling us the angle of the input wave. For normal incidence we have kx=0k_x=0.