\(\alpha,\beta\) are the roots of \(x^2+px-q=0\)
Sum of the roots,
$\alpha+\beta=-p$
\(\gamma, \delta\) are the roots of \(x^2+px+r=0\)
Sum of the roots,
\(\gamma+\delta=-p\)
Now,
$\alpha+\beta = \gamma+\delta$
\(\Rightarrow \alpha-\gamma=\delta - \beta \cdots(1)\\
\Rightarrow \alpha - \delta = \gamma - \beta \cdots(2)\)
Using equation $(1)$ and $(2)$,
$\dfrac{(\alpha-\gamma)(\alpha-\delta)}{(\beta-\gamma)(\beta-\delta)} = \dfrac{(\delta - \beta)(\gamma - \beta)}{(\beta-\gamma)(\beta-\delta)} = 1$