The key point is that since we assume the screen is at infinity we can treat the rays as parallel. Then the difference in the length of the two rays is just the bit marked on the diagram i.e. the $d\sin\theta$.
In a real experiment the rays aren't parallel because they have to converge to the same spot on the screen. But say the screen is 1m away and the slit spacing is 10 microns - these are typical dimensions. Then the angle between the rays is 0.00001 radians or 0.0006°.
So it's a very very good approximation to treat them as parallel.
What I'm saying is that if we take the rays to be parallel then we get the path difference to be $d\sin\theta$. The rays aren't exactly parallel, but they are so close to being parallel that $d\sin\theta$ is still an excellent approximation to the path difference.
Technically we are working in the Fraunhofer limit i.e. the approximation that the screen is at infinity. Even though this is obviously never true, it is an excellent approximation in many situations. This limit gives us Fraunhofer diffraction.
@Jasmine so are you happy with my construction and how it calculates the path difference to be $d\sin\theta$?
I think the diagram I've draw is the simplest way to understand the Young's slits because the calculation is so straightforward.
Anyhow ...
This path difference is a real distance measured in metres. It doesn't matter whether the experiment is in air, water, or whatever. This distance is just a physical distance.
Yes, but what matters is not the physical path difference. It is the phase difference between the two rays. Suppose the path difference is $\ell$ (i.e. $\ell = d\sin\theta$) then the phase difference is $\phi = 2\pi\ell/\lambda$.
Is it obvious how I got this or do I need to explain it?
And this is where the difference between air and water appears, because in water the wavelength becomes $\lambda_w = \lambda_0/\mu$, where $\mu$ is the refractive index of the water.
We get constructive interference when the phase difference is an integer multiple of $2\pi$, and we get destructive interference when the phase difference is an integer multiple of $2\pi$ plus $\pi$.
@JohnRennie This question was given by our sir in class so I cant get the photo of it
According to the question, A man conducted YDSE setup in air and the number of total maxima he got was 'n' then he conducted the same experiment in water then calculated the total number of maxima as 'm' . Find relation between n and m if refractive index of water is u
@Jasmine I would guess the question means count the maxima starting at the centre and counting outwards as $\theta \to \pi/2$.
Suppose $d = \lambda$, then we get the central maximum an a maximum at $\theta = \pi/2$. But we can't observe the maximum at $\pi/2$ because it never reaches the screen.
So if $d = n\lambda$ that means we can only see $n$ maxima starting our count from the centre.