# Calculate the covariance between X and Y when these variables have joint distribution:

Calculate the covariance between X and Y when these variables have joint distribution:

$$f(x, y)=3\, \min\{x,\, y\}\, \text{ if 0

and $$0$$ otherwise.

Attempt:

A first step is to calculate $$E(XY)$$, which is given by:

$$E(XY)=\int_{0}^{1}\int_{0}^{1}\, 3xy \min\{ x,\ y \} \, dx\, dy$$

I don't know how to solve it! Then, it occurred to me that I could express it in the following way:

$$E(XY)=\int_{0}^{1}\int_{0}^{1}\, 3xy \frac{x + y - \mid x - y\, \mid}{2} \, dx\, dy$$

But now, I don't know how to remove the absolute value. I think I would have two cases, when $$x \geq y$$ and $$x < y$$. Everything else I've tried doesn't work.

I think I would have two cases, when x≥y and x<y. Everything else I've tried doesn't work.

Yes. Do that.

Since $$\min\{x,y\}=\begin{cases}x&:& x , therefore:

\begin{align} \mathsf E(XY)&=\quad\int_0^1\int_0^1 3xy\min\{x,y\}\,\mathrm d x\,\mathrm d y\\[1ex]&=\int_0^1\left(\int_0^y3x^2y\,\mathrm d x+\int_y^13xy^2\,\mathrm d x\right)\,\mathrm d y\end{align}

• And now, to calculate $f_X(x)$ and $f_Y(y)$. According to me, it would be something like this: $f_X(x)=\int_{0}^{1}\, 3\min \{x,\, y\} \, dy$ How do I calculate it?
– Max
Oct 21 '21 at 1:42
• Is it: $\int_{0}^{y}\, 3x \, dy +\int_{y}^{1}\, 3y \, dy$?
– Max
Oct 21 '21 at 1:48
• Close @Max . Reality check: $f_X(x)$ is a function of $x$ alone (and so you are "integrating out" $y$), therefore $y$ should not appear in the bounds of the integral. $$f_X(x) = \int_0^x 3 y\, \mathrm d y+\int_x^1 3 x\,\mathrm d y$$ Oct 21 '21 at 2:45
• And likewise, $$f_Y(y) = \int_0^y 3x\,\mathrm d x+\int_y^1 3y\,\mathrm d x$$ Oct 21 '21 at 2:53