I am trying to find the distribution of the sum of two random variables $(x_1,x_2)$ which have the following distribution:

$$f(x_1,x_2) = \begin{cases}2 ( x_1 + x_2) & 0 \le x_1 \le x_2 \le 1 \\ 0 & \text{otherwise} \end{cases}$$

The expression I thought would work was

 x1 + x2, {x1, x2} \[Distributed] 
  ProbabilityDistribution[2 (x1 + x2), {x1, 0, x2}, {x2, x1, 1}]]

But this only returns the expression unevaluated. What would be the proper method to calculate the result?


1 Answer 1


I figured it out -- the expression is representing the distribution object. To get the formula, I had to call PDF on the distribution. The code would then look like

  x1 + x2, {x1, x2} \[Distributed] 
   ProbabilityDistribution[2 (x1 + x2), {x1, 0, x2}, {x2, x1, 1}]], w]

The result is

$$\begin{cases} -((-2+w)w) & 1 < w < 2 \\ w^2 & 0 <w \le 1 \\ 0 & \text{True}\end{cases}$$

  • 2
    $\begingroup$ Showing your result would be helpful. $\endgroup$
    – bbgodfrey
    Nov 14, 2021 at 3:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.