# 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?

• You might want to (re)familiarize yourself with how multiple integration works, see here and particularly here ... Short answer: When integrating with respect to x, y is considered a constant. – Tyler Oct 15 '13 at 3:15
• @Tyler, can I say the reason why the rest of the terms ($y^2-y^2\rho^2$ compared to $y\rho$) are taken out is they so happen to be in a "convenient form" then? ie. keeping $y\rho$ inside, helps simplify things – Jiew Meng Oct 15 '13 at 5:42

$$(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)$$
$$\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.