$x _1= a \sin \left(\omega t +\phi_1\right), x _2= a \sin \left(\omega t +\phi_2\right)$
$\left| x _1- x _2\right|=2 a \sin \left(\omega t +\frac{\phi_1+\phi_2}{2}\right) \cos \left(\frac{\phi_1-\phi_2}{2}\right)$
To maximize $\left|x_1-x_2\right|: \sin \left(\omega t+\frac{\phi_1+\phi_2}{2}\right)=1$
$\Rightarrow a \sqrt{2}=2 a \times 1 \times \cos \left(\frac{\phi_1-\phi_2}{2}\right)$
$\Rightarrow \frac{1}{\sqrt{2}}=\cos \left(\frac{\phi_1-\phi_2}{2}\right) \Rightarrow \frac{\pi}{4}=\frac{\phi_1-\phi_2}{2}$
$\Rightarrow \phi_1-\phi_2=\frac{\pi}{2}$
