# Finding marginal density of a joint density function

I don't like/don't understand the solution to the SOA practice problem #171 so I'm trying to find the marginal density of x in another way without drawing a diamond.

Here is the joint density: $f(x,y)=\begin{cases} {{1\over2}}&0<|x|+|y|<1\\{0}&otherwise\end{cases}$

I thought I could do the following:

$f_x(x)= \int_{-1}^{1-x}{1\over2}dy \,+\,\int_0^{1+x}{1\over2}dy$

Then I tried

$f_x(x)= \int_{0}^{1-x}{1\over2}dy \,+\,\int_{1-x}^{1+x}{1\over2}dy$

but I'm not getting the same density as them with their drawing. If it comes down to it, I can try to learn their method but I would really like to just do it the way I know how. Can anyone tell me where my limits are going wrong?

• Did you sketch a drawing of the support region? Commented Apr 1, 2017 at 17:13
• @leonbloy it's a diamond, and I thought the 2nd one had the right limits for sure, but it doesn't work. Commented Apr 1, 2017 at 17:15

For a fixed $0<x<1$, the support region (check this) goes from $y=x-1$ to $y=1-x$
Hence, in that range, $$f_x(x)= \int_{x-1}^{1-x}\frac12 dy= 1 - x$$
The range $-1<x<0$ is similar.
• so for $-1<x<0\, f_x(x)=\int_{-x-1}^{x+1}{1\over2}dy=x+1$? Commented Apr 1, 2017 at 18:30
• yes. you should check that the answer makes sense, for example, that $f_x$ integrates to 1 Commented Apr 1, 2017 at 19:27