# Set $Z=X+Y$ and calculate the density function $f_Z$ for Z. Given solution doesn't match mine. (Continuous R.V)

I'm having difficulties with task 2, since given solution doesn't equal mine:

$f_{XY}(x,y) = \begin{cases} \left (6·e^{-3x}·e^{-2y} \right) & \text{if } 0<x< \infty \space and\space 0<y<\infty\\ 0 & \text{otherwise } % \end{cases}$

Task 1: Show that X and Y are independent

Task 2: Set $Z=X+Y$ and calculate the density function $f_Z$ for Z

I'll post the entire task, since others might seek help for a similar problem.

To show this we use that "Two continuous random variables X and Y are independent if:

$f_{XY}(x,y)=f_X(x)·f_Y(y),\space for\space all \space x,y$

We find the marginal PDF's

$f_X(x)=\int_0^\infty6·e^{-3x}·e^{-2y}$dy

$f_Y(y)=\int_0^\infty6·e^{-3x}·e^{-2y}$dx

We multiply the two:

$f_Y(y)·f_X(x)=6·e^{-3x}·e^{-2y}$

Which is the same as the joint PDF. We conclude they are independent.

We solve it by finding the CDF and differentiate this to find the PDF:

$P(Z\leq z)$

$P(x+y\leq z)$

$P(y\leq z-x)$

We solve the double integral:

$\int_0^\infty \int_0^{(z-x)}(6·e^{-3x}·e^{-2y}dydx=(1-3·e^{-2·z})$

We now have the CDF:

$F_{Z}(z) = \begin{cases} \left (0 \right) & \text{if } 0>z \\(1-3·e^{-2·z}) & \text{}0<z< \infty \\ 1 & \text{}z> \infty % \end{cases}$

To find the PDF we differentiate the CDF:

$\frac{d}{dz}(1-3·e^{-2·z})=6·e^{-2z}$

Giving us a PDF of:

$f_{Z}(z) = \begin{cases} \left (6·e^{-2z} \right) & \text{if } 0<z<\infty \\ 0 & \text{otherwise } % \end{cases}$

However the solution provided is:

$f_Z(z)=6·e^{-2z}·(1-e^{-z})$

What am I doing wrong?

Besides this im unsure of:

The intervals in the CDF

• While writing the CDF of $Z$, the only case is $0<z<\infty$, and $0$ otherwise (i.e. the third case does not make sense). – StubbornAtom Jan 3 '18 at 20:50
• Thank you! I Really appreciate the input – Fauré Jan 3 '18 at 21:07

$$Y = z-X = -X + z$$ is a linear equation with $$y$$-intercept $$z$$ and slope $$-1$$. The region where $$Y \leq -X + z$$ is in green below. Note where the line intersects with the $$X$$ and $$Y$$ axes.
Thus, the CDF is, according to the graph above, $$\int_{0}^{z} \int_{0}^{-x+z}6e^{-3x}e^{-2y}\text{ d}y\text{ d}x = 2e^{-3z}-3e^{-2z}+1$$ from which we obtain $$f_{Z}(z) = -6e^{-3z}+6e^{-2z}=6e^{-2z}-6e^{-3z}=6e^{-2z}(1-e^{-z})$$ for $$z > 0$$ as desired.
• @Fauré 1) Factor out $6$ and $e^{-2z}$. To make this more explicit: $$6e^{-2z}-6e^{-3z} = 6(e^{-2z})-6(e^{-2z})(e^{-z}) = 6e^{-2z}(1-e^{-z})$$ For 2), from the graph I posted, $X$ ranges from $0$ to $z$: notice the bounds of the triangle. – Clarinetist Jan 3 '18 at 20:39
• @Fauré The reason why we get $z$ for the upper bound of $X$, by the way, is because of this: the upper bound of $X$ is determined by the line $Y = -X + z$ (as you see in the picture above). The intersection with the $X$-axis occurs when $Y = 0$. Hence, substituting $Y = 0$, we have $0 = -X + z$, or $X = z$. – Clarinetist Jan 3 '18 at 20:42