Path difference when performing double slit experiment in a medium 
Consider the situation shown in the figure. Two slits $S_1$ and $S_2$ are placed symmetrically about the line $OP$ which is perpendicular to screen. The space between screen and slits is filled with a liquid of refractive index $\mu_3$. A plate of thickness $t$ and refractive index $\mu_2$ is placed in front of one of the slit. A source $S$ is placed above $OP$ at a distance $d$. What is the position of central maxima from point $P$?


My Approach:- First for the path difference for a general point on screen, I first wrote the path difference in air as $d\sin(\theta)$. After which using the appropriate assumptions, I assumed $\sin\theta$ as $\tan\theta$ and wrote $\tan\theta=\frac{d}{D}$, which gives the path difference in air as $\frac{d^2}{D}$. Now the path difference due to two slits is $d\sin\theta$ and again using the similar approximations we get path difference due to two slits=$\frac{dY}{2D}$. And now the main function is for the path difference due to the plate. I wrote the path difference due to the plate as $(\frac{\mu_2}{\mu_3}-1)t$. And then adding up all the terms to zero, the value of $Y$ is coming incorrect. I am not able to understand my conceptual mistake here. A small hint would be also of great help.

So according to me, it should have been
$$\frac{d^2}{D}+\left(\frac{\mu_2}{\mu_3}-1\right)t+\frac{Yd}{2D}=0$$
The equation which gives the correct answer is
$$\frac{d^2}{D}+(\mu_2-\mu_3)t+\frac{\mu_3Yd}{2D}=0$$
Also noticed that after some rearranging it is
$$\frac{d^2}{D}+\mu_3\left[\left(\frac{\mu_2}{\mu_3}-1\right) t+\frac{Yd}{2D}\right]=0$$
 A: Okay lets just say we are trying to find the path difference for a point $Q$ on the rightmost screen. We shall be trying to obtain the optical path difference between the path $SS_1Q$ and $SS_2Q$. Now, as you have rightly pointed out, the path difference of $SS_1$ and $SS_2$ is $$l_{SS_2}-l_{SS_1}= \frac{d^2}{D}$$ (from geometry and paraxial approximations). Now, for the path difference between $S_1Q$ and $S_2Q$ we need to note the fact that the medium on the right has a refractive index $\mu_3$ (except for the glass slab which has a refractive index $\mu_2$). Let's assume that the point $Q$ is above $O$ such that $OQ=y$. Now, the geometric path difference between $S_2Q$ and $S_1Q$ will be $$\Delta x \approx d \sin \alpha \approx  d\frac{y}{2D}$$ Now, while calculating the optical path difference between $S_2Q$ and $S_1Q$  we must remember that the light travels the distance $\Delta x$ in $\mu_3$ not vacuum, and as we know, if light travels in a refractive index $n$, its wavelength will be $\lambda \over n$ where $\lambda$ is wavelength in vacuum and therefore, the optical path needs to be multiplied by $\mu_3$ to account for the corresponding phase change. Also, the slab of thickness $t$ placed near slit $S_2$ gives rise to an additional optical path of $(\mu_2 -\mu_3)t$. Therefore, net optical path difference will be
$$l_{S_2Q}-l_{S_1Q}=\mu_3\Delta x +(\mu_2-\mu_3)t=\mu_3d\frac{y}{2D}+(\mu_2-\mu_3)t $$
Hence, the total optical path difference will be
$$\boxed{l_2-l_1=\mu_3d\frac{y}{2D}+(\mu_2-\mu_3)t + \frac{d^2}{D}}$$
The only error in your solution is that you forgot to include the fact that equal distance travelled by light on the left and right side of the slit plane do not contribute to equal phase difference, because of the different refractive index on the right. From this you can locate the central maxima by equating path difference to zero.  $$y_0=-\frac{2D}{\mu_3d}((\mu_2-\mu_3)t + \frac{d^2}{D})$$
