Explanation:
Let the first wave is :
[tex]y_1=A\sin\omega t[/tex]
And another wave is :
[tex]y_2=A\sin (\omega t+\phi)[/tex]
[tex]\phi[/tex] is phase difference between waves
Let y is the resultant of these two waves. So,
[tex]y =y_1+y_2[/tex]
The waves reflected from the upper and lower surfaces of the medium, it means that the resultant to be zero. So,
[tex]\cos(\dfrac{\phi}{2})=0\\\\\cos(\dfrac{\phi}{2})=\cos(\dfrac{\pi}{2})\\\\\phi=\pi[/tex]
So, the phase difference between the two waves is [tex]\pi[/tex].