How can I compute the integral $e^{\left(\frac{x^2}{2}+xy-y^2\right)}$

55 Views Asked by At

Let (X, Y) be a pair of random variables with density

$$f_{(X,Y)}(x,y):=\frac{1}{2\pi}e^{(\frac{x^2}{2}+xy-y^2)}, (x,y)\in\mathbb R.$$

  1. Give the marginal laws of X and Y and identify it with usual laws.
  2. Are X and Y independent?

I am stuck from the first question. How can I compute the integral of $e^{(\frac{x^2}{2}+xy-y^2)}$? The teacher gave us a hint: $xy-y^2=-(y-\frac{x}{2})^2+\frac{x^2}{4}$. But I still can't figure it out. Could anybody give me solutions?

1

There are 1 best solutions below

1
On

You probably have $-\frac{x^2}{2}+xy-y^2$ in the exponential so $$ -\frac{x^2}{2}+xy-y^2=-\frac{x^2}{2}-\left(y-\frac{x}{2}\right)^2+\frac{x^2}{4}=-\frac{x^2}{4}-(y-\frac{x}{2})^2 $$ and the joint density can be written as $$ f_{X,Y}(x,y)= \frac{1}{2\pi}\mathrm e^{\left(-\frac{x^2}{2}+xy-y^2\right)}= \underbrace{\frac{1}{\sqrt{2\pi} \sqrt{2}}\mathrm e^{\frac{x^2}{4}}}_{X\sim\mathcal N(0,2)}\times\underbrace{\frac{1}{\sqrt{2\pi}\sqrt{1/2}}\mathrm e^{-\left(y-\frac{x}{2}\right)^2}}_{{Y|X\sim\mathcal N(x/2,1/2)}} $$ The exponential can also be written as $$ -\frac{x^2}{2}+xy-y^2=-\frac{y^2}{2}-\frac{1}{2}(x-y)^2 $$ and the joint density can be written as $$ f_{X,Y}(x,y)= \frac{1}{2\pi}\mathrm e^{\left(-\frac{x^2}{2}+xy-y^2\right)}= \underbrace{\frac{1}{\sqrt{2\pi}}\mathrm e^{\frac{y^2}{2}}}_{Y\sim\mathcal N(0,1)}\times\underbrace{\frac{1}{\sqrt{2\pi}}\mathrm e^{-\frac{(x-y)^2}{2}}}_{{X|Y\sim\mathcal N(y,1)}} $$

Then integratin over $x$ we find $$ f_Y(y)=\int_{-\infty}^{\infty}f_{X,Y}(x,y)\mathrm d x= \frac{1}{\sqrt{2\pi} }\mathrm e^{\frac{y^2}{2}}\underbrace{\frac{1}{\sqrt{2\pi}}\int_{-\infty}^{\infty}\mathrm e^{-\frac{(x-y)^2}{2}}\mathrm d x}_{=1} $$ that is $Y\sim \mathcal N(0,1)$.

$X$ and $Y$ anre not independent, because $$ f_{X,Y}(x,y)\ne f_X(x)f_Y(y) $$