I have tried to compute light's lateral shift after passing through a glass slab
In terms of the incidence angle $\theta_1$, the slab thickness $d$ and the refraction index $n$, I have found that the lateral shift $x$ is given by
$$x = \frac{d}{n^2} \sin(\theta_1) \left( \sqrt{n^2 + \sin^2(\theta_1)} \right) \left( \sqrt{n^2 - \sin^2(\theta_1)} - \cos(\theta_1) \right).$$
In order to test this formula I have considered two extreme cases: when the light is perpendicular to the slab ($\theta_1 = 0$) and when it is almost parallel ($\theta_1 \approx \pi/2$). The first case works OK, since if $\theta_1 = 0$ then $\sin(\theta_1) = 0$ and $x=0$. This is physically plausible, for if the light ray is perpendicular then it does not change direction.
I'm having trouble assessing the second case. If $\theta_1 \approx \pi/2$ then the formula can be written as
$$x = \frac{d}{n^2} \sqrt{n^4 -1}.$$
Is this physically plausible? My guess has been that if I can say that $n^4 \gg 1$ I obtain $x \approx d$. This sounds correct to me since if the light ray approaches the slab almost parallel then after refracting back to air it should come out almost parallel, causing a lateral shift of exactly $d$. I am not sure, however, in saying $n^4 \gg 1$. I have checked glass's refraction index and it lies in the range $1.5 - 1.9$. Am I correct?