Question:
$\displaystyle \left(\frac{p}{q}\right)^{-2}$
When you have an indice to a negative power, this mean you will need to flip the fraction as you want the reciprocal.
$\displaystyle \left(\frac{q}{p}\right)^{2}$
When a fraction is to a power, then both the numerator and the denominator are to that power too.
$\displaystyle \frac{q^2}{p^2}$