Calculating light's lateral shift in a glass slab

I get a different formula. Let me show you how I derived it.

Using the following diagram:

enter image description here

We can write the following equations by looking at triangles:

$$\begin{align}\frac{x}{L} &= \sin(\theta_1-\theta_2)\\&=\sin\theta_1 \cos\theta_2 - \cos\theta_1\sin\theta_2\\ \frac{d}{L}&=\cos\theta_2\end{align}$$

Assuming that the air has a refractive index of 1, we can further write

$$\frac{\sin \theta_1}{\sin\theta_2}=n$$

From basic geometry we know that for angles in the first quadrant,

$$\cos\theta = \sqrt{1-\sin^2\theta}$$ Combining these gives

$$\begin{align}x &= \frac{d}{\cos\theta_2}\left(\sin\theta_1 \cos\theta_2 - \cos\theta_1 \sin\theta_2 \right)\\ &= d\left(\sin\theta_1 - \frac{\sin\theta_1\cos\theta_1}{n\cos\theta_2}\right)\\ &=d\sin\theta_1\left(1-\frac{\sqrt{1-\sin^2\theta_1}}{n\sqrt{1-\frac{\sin^2\theta_1}{n^2}}}\right)\\ &=d\sin\theta_1\left(1-\frac{\sqrt{1-\sin^2\theta_1}}{\sqrt{n^2-\sin^2\theta_1}}\right)\end{align}$$

Note that with this expression, the distance $x$ will approach $d$ when $\theta_1$ approaches $\pi/2$ since the second term will vanish.

You might want to compare my approach with yours. I'm not claiming mine is right...

$$ \left[\text{lateral shift}\right]~=~\left[\text{thickness}\right] \frac{\sin{\left(i-r\right)}}{\cos{\left(r\right)}} \,,$$where:

  • $\left[\text{thickness}\right]$ is the thickness is of the glass slab;

  • $i$ is the angle of incidence;

  • $r$ is the angle of refraction.

enter image description here

That is indeed the $\theta\to\pi/2$ limit of the expression you give. This is physically reasonable because you require $x$ to be zero when $n=1$ as there is then no glass slab to deflect the beam.

For the region in between $n=1$ and $n\gg1$, there's not all that much that can tell you whether the result is reasonable or not. The change in $x$ from $0$ to $d$ as $n$ goes from $1$ to $n\gg 1$ is continuous but quick. If you graph it, you get a very sudden uptick at $n=1$,

$\hspace{125px}$Mathematica graphics,

and by the time it reaches $n\approx 1.5$, which is where your intuition about how glass behaves was formed, $x$ is already at 90% of $d$. Again, that's reasonably consistent with intuition. If you want more validation, though, you'll just need to double-check your calculations, or reproduce them inside a bigger framework which you trust more.