Total internal reflection and waveguides I'm looking at a model of a planar dielectric waveguide along the lines of this picture: 
For the wave inside the $n_1$ dielectric slab to totally internally reflect $\theta_M$ needs to be smaller than $cos^{-1} (n_2 / n_1)$. In my textbook it says that the treatment of the planar dielectric waveguide is completely analogous to the case of two planar mirrors with perfect reflectivity SHORT OF ONE difference: Due to the evanescent wave that travels a very short length into the $n_2$ medium the reflected wave experiences an angle-dependent phase shift given by $tan(\phi /2) = \sqrt{\frac{sin^2(\theta_C)}{sin^2{\theta}} -1} $, where c denotes the critical incident angle and $\phi$ is the phase shift, that the reflected wave experiences.
There is no explanation of this in the book and I couldn't figure out how to get to that result. Anybody care to explain?
Cheers
 A: The phase-shift occurs due to the complex nature of the reflection coefficient. The so-called critical angle is given by: 
$sin(\theta_M) = \frac{n_2}{n_1}$ 
As long as $\theta<\theta_M$ we have only partial reflection and a real valued reflection coefficient $R$.
As soon as the critical angle is exceeded $(\theta>\theta_M)$, we have $\mid R \mid=1$ and total reflection of the light occurs. $R$ is now complex and a phase shift is imposed on the reflected light, we write: 
$R=e^{2j\phi}$ 
wehre $\phi$ is the phase shift between the incident and reflected wave.
Now, we know what the value of $R$ is, both for TE and for TM modes, i.e. the Fresnel coefficients for the two different states of polarization of the electric and magnetic fields. To get the formula for the phase-shift you only need to equal this complex expression for $R$ to the Fresnel formulas and solve for $\phi$. The formula you wrote is the one corresponding to TE modes, so it's the TE phase-shift (with electric fields perpendicular to the plane of incidence spanned by the wave normal and the normal to the interface). For TM modes you would get exactly the same result but multiplied by a factor of $n_{1}^{2}/n_{2}^{2}$.
