# How do I find the marginal probability density function when the interval is dependent of one of the variables?

I'm trying to find $f_x$ and $f_y$ given a joint probability distribution $$f(x,y) = \frac18 (y^2 -x^2)e^{-y}$$ defined on the interval $0 \leq y \leq \infty$, $-y \leq x \leq y$

Naturally I've tried integrating on the intervals and found:

$$f_x(x) = \int_0^\infty \mathrm{d}y\ f(x,y)= \frac18 (2 -x^2)$$ $$f_y(y) = \int_{-y}^y \mathrm{d}x\ f(x,y)= \frac16 e^{-y}y^3$$

But $f_x$ isn't normallized to one.

I believe the error is on the integration interval but I don't know what exactly is wrong. Can anybody point the correct direction?

• Hint: Start from the true joint density, namely, $$f(x,y)=\tfrac18(y^2-x^2)e^{-y}\mathbf 1_{|x|<y},$$ and apply the fully general formula $$f_X(x)=\int_\mathbb Rf(x,y)\mathrm dy.$$ In the present case, $$f_X(x)=\int_\mathbb R\tfrac18(y^2-x^2)e^{-y}\mathbf 1_{|x|<y}\mathrm dy=\int_{|x|}^\infty\tfrac18(y^2-x^2)e^{-y}\mathrm dy=\cdots$$ – Did May 25 '15 at 22:47

It always helps to sketch the support of the joint distribution; i.e., the region of $(X,Y)$ such that the density is positive. In your case, you can see that this region must be in the upper half plane ($y \ge 0$), and for a given value of $y$, $x$ must be between $-y$ and $y$; so this region is triangular and is bounded to the right by $y = x$ and to the left by $y = -x$.
Thus, the marginal density of $X$ is given by the integral $$f_X(x) = \int_{y=|x|}^\infty f_{X,Y}(x,y) \, dy$$ since we require $y$ to be at least as large as $|x|$ (otherwise the joint density is zero). This corresponds to picking an $x$-value, drawing a vertical line, and integrating over a $y$-interval that corresponds to the intersection of this vertical line and the support of the joint distribution; in a sense, it is like "collapsing" the support onto the $x$-axis, where the marginal density at each $x$-value is the integral of the joint density for all corresponding $y$-values.
The marginal density of $Y$ is easier to see: $$f_Y(y) = \int_{x=-y}^y f_{X,Y}(x,y) \, dx$$ as you wrote. This is analogous to "collapsing" the support onto the $y$-axis, "summing" up the joint density in horizontal rather than vertical lines.
{"ft_lang_label":"__label__en","ft_lang_prob":0.9200562,"math_prob":0.9999647,"size":1212,"snap":"2019-51-2020-05","text_gpt3_token_len":344,"char_repetition_ratio":0.13162252,"word_repetition_ratio":0.028708134,"special_character_ratio":0.28630364,"punctuation_ratio":0.11153846,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":1.0000069,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2019-12-08T11:02:18Z\",\"WARC-Record-ID\":\"<urn:uuid:6a6f3f90-b88d-48e7-be57-a42c719a10a0>\",\"Content-Length\":\"135599\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:e3c2624d-6340-409d-8603-f2ccbc67416a>\",\"WARC-Concurrent-To\":\"<urn:uuid:20fc25d5-5abf-41ab-8b13-d1b9edbdb9be>\",\"WARC-IP-Address\":\"151.101.193.69\",\"WARC-Target-URI\":\"https://math.stackexchange.com/questions/1298769/how-do-i-find-the-marginal-probability-density-function-when-the-interval-is-dep\",\"WARC-Payload-Digest\":\"sha1:4V3CVIWEBUD7OFKEA3ZQ4OCKN2HSHVOZ\",\"WARC-Block-Digest\":\"sha1:DELZRQSVBDVNQYVKUARJ24OZ5HA3GCNC\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2019/CC-MAIN-2019-51/CC-MAIN-2019-51_segments_1575540508599.52_warc_CC-MAIN-20191208095535-20191208123535-00478.warc.gz\"}"}