[Math] Integration limits of a Marginal Probability Density Function with a Triangle-Shaped Boundary

probabilityprobability distributions

I have given a triangle shaped boundary $M$ of my probability density function in $\mathrm{R}^{2}$, with the limitations beeing:
$$y = 0$$
$$y = x$$
$$y = 2-x$$
and a probability density function
$$
f(x,y)=
\begin{cases}
cx &\mbox{if } (x,y) \in M \\
0 & \mbox{else}
\end{cases}
$$
where i calculated it to be a probability density function for $c=3$ with the ansatz
$$\int\limits_{0}^{1}\int\limits_{x}^{2-x}cx\,\mathrm{d}x\stackrel{!}{=}1\;\;\Rightarrow\;\; c=3.$$
So i try to calculate the marginal probability density function $f_X(x)$ and $f_Y(y)$.

For $f_X(x)$ I get
$$f_X(x)=\int\limits_0^1 3x\mathrm{d}y=3x$$

The problem I see now is getting the limits of $f_Y(y)$. I reshaped the inequality $$x<y<2-x$$ to:
$$x<y$$ and $$x<2-y.$$
These limits seem to make no sense to me. Where is my mistake in order to get the correct limits to calculate my marginal probability density function?

Best Answer

To find $c$:

\begin{eqnarray*} 1 &=& \int_{y=0}^{1} \int_{x=y}^{2-y} cx\;dx\;dy \\ &=& c\int_{y=0}^{1} \left[x^2/2 \right]_{x=y}^{2-y} \;dy \\ &=& c\int_{y=0}^{1} \left(2-2y \right) \;dy \\ &=& c \left[2y-y^2 \right]_{y=0}^{1} \\ &=& c \left(2-1 \right) \\ \therefore\quad c &=& 1. \end{eqnarray*}

For $f_Y(y)$:

\begin{eqnarray*} f_Y(y) &=& \int_{x=y}^{2-y} x\;dx \\ &=& \left[x^2/2\right]_{x=y}^{2-y} \\ &=& \dfrac{(2-y)^2-y^2}{2} \\ &=& 2-2y \qquad\text{for $0\lt y\lt 1$}. \end{eqnarray*}

For $f_X(x)$ we need to split into two cases, each with a different upper limit of integration.

If $0\lt x\lt 1$, then

\begin{eqnarray*} f_X(x) &=& \int_{y=0}^{x} x\;dy \\ &=& \left[xy\right]_{y=0}^{x} \\ &=& x^2. \end{eqnarray*}

If $1\lt x\lt 2$, then

\begin{eqnarray*} f_X(x) &=& \int_{y=0}^{2-x} x\;dy \\ &=& \left[xy\right]_{y=0}^{2-x} \\ &=& 2x-x^2. \end{eqnarray*}

So that gives us,

$$f_X(x) = \begin{cases} x^2, & \text{if $0\lt x\lt 1$} \\ 2x-x^2, & \text{if $1\lt x\lt 2$.} \end{cases}$$