# How can I get a marginal PDF from a joint PDF (probability density function)?

Let X and Y be random variables with a joint probability density function (joint PDF) given by

$$f_{X,Y}(x,y) \quad=\quad \begin{cases} \frac{c}{1+x^2+y^2} & \text{ if } x^2+y^2<1\,, \\ 0 & \text{ otherwise,} \end{cases}$$

where the positive constant c is determined by the requirement that $$f_{X,Y}$$ is a PDF.

What is the correct formula for the marginal PDF of X?

I think I have to start off by integrating $$\frac{c}{1+x^2+y^2}$$ with respect to y. Which gives me

$$\int \frac{c}{1+x^2+y^2} dy = \frac{c*\arctan{\frac{y}{\sqrt{1+x^2}}}}{\sqrt{1+x^2}}$$

But don't know how to continue now.

I'd also like to know if there's any software out there where I can compute this kind of symbolic stuff.

Thanks

• If you do it with software, you'll skip the fun part. Nov 5, 2020 at 23:35
• Once I know how to do it it's a waste of time calculating in 21st century with all computers and stuff.. and they don't make mistakes! I want to learn and then be able to do it fast :)) Nov 5, 2020 at 23:40
• Computer programs have their limits and make mistakes, trust me on this one :) But OK, for your particular problem they should help probably. Nov 5, 2020 at 23:44
• Can you mention me any good software to compute this kind of stuff? Nov 5, 2020 at 23:45
• SymPy in Python you can try. Wolfram Alpha / Wolfram Cloud too, Maxima too (but that one is kind of archaic, not that it's bad). Just google "free computer algebra system". Nov 5, 2020 at 23:45

I think I finally managed to recall.

[1] I think you made a mistake, you should integrate w.r.t. $$x$$ not $$y$$.

That will give you the margin PDF of $$Y$$.

[2] Make this equation:

$$\int_{-1}^{1} \left(\int_{-\sqrt{1-y^2}}^{\sqrt{1-y^2}} \frac{c}{1+x^2+y^2} \,dx\right)\,dy = 1$$

Solving this equation should give you $$c$$.

[3] Also, the inner integral gives you the marginal distribution of $$Y$$.

$$f(y) = \int_{-\sqrt{1-y^2}}^{\sqrt{1-y^2}} \frac{c}{1+x^2+y^2} \,dx$$

So just solve this as an indefinite integral treating $$y$$ as constant (similar to what you did but reversed), but then compute the definite integral too (i.e. apply the boundaries). That will give you a function of just $$y$$, your marginal PDF.

• So, to get the marginal PDF of X I have to integrate wrt to x? Nov 6, 2020 at 0:48
• web.ma.utexas.edu/users/mks/384G05/jointcondmarg.pdf Nov 6, 2020 at 0:57
• No, to get the marginal of X you integrate w.r.t. y i.e. you eliminate the y. Nov 6, 2020 at 0:59
• So I didn't do any mistakes then, I wanted marginal of X and integrated wrt y. Nov 6, 2020 at 1:03
• Where do you get the limits from? Nov 6, 2020 at 1:45