Integral with respect to $x$ with a $y$ term Referencing the 2nd line of the below image


$$\int^\infty_{-\infty} ... \int^\infty_{-\infty} \exp\{ -\frac{1}{2(1-\rho^2)} \} (x-\color{red}{y}\rho) \; dx \; dy$$
What I don't understand is why can I have a $y$ term inside when I am integrating with respect to $x$? It seems to be treated as a constant? After doing that inner integral I still need to integrate with respect to $y$ ... so why can I treat that $y$ as a constant? 
 A: This is too big for a comment. Here is what's happening. The integral "skips" a step which is a not too obvious factorisation.
$$(x^2 + y^2 - 2xy \rho) = (x^2 - 2xy \rho \color{darkgreen}{ +y^2 \rho ^2} \color{blue}{- y^2 \rho ^2} + y^2) = (x - y \rho)^2(y^2 - y^2 \rho ^2)$$
The green terms go into the left factor, and the blue terms go into the right side.
So, using that, we know that
$$ \exp{(\frac{-1}{2(1- \rho ^2)}(x^2 + y^2 - 2xy \rho))} = \exp{(\frac{-1}{2(1- \rho ^2)}(x - y \rho)^2(y^2 - y^2 \rho ^2))}$$
$$ = \exp(\frac{-1}{2(1- \rho ^2)}(y^2 - y^2 \rho ^2)) \exp (\frac{-1}{2(1- \rho ^2)}(x - y \rho)^2)$$
where the first equality comes from our fancy factoring trick, and the last equality is because of a property of exponents.
Now, we can factor the first $\exp$ out of the $\mathrm dx$ integral like it is a constant since it only contains $y$ terms. Keeping $yp$ in the last $\exp$ function isn't really a matter of convenience, it was the whole purpose of the first factoring trick. Now the $\mathrm dx$ integral integrates to $\sqrt{2\pi}\sqrt{1 - \rho ^2}$ which (presumably) has been shown previously. 
