Confusion in calculating $\int_0^2 \left( \frac{z-x}{2}\mathbf 1_{0 \le z- x \le 2} + \mathbf 1_{2 < z-x}\right)\text dx$

32 Views Asked by At

While calculating the CDF of a sum of random variables (as opposed to a difference in this post), I came to the following integral $$\int_0^2 \left( \frac{z-x}{2}\mathbf 1_{0 \le z- x \le 2} + \mathbf 1_{2 < z-x}\right)\text dx$$ But I cannot figure out how to choose the intervals for $z$ as in the linked answer.

1

There are 1 best solutions below

0
On

Observe that $0 \leq z - x \leq 2$ if and only if $-z \leq -x \leq 2 - z$ if and only if $z - 2 \leq x \leq z.$ Consequently, the indicator function $\mathbf 1_{0 \leq z - x \leq 2}$ can be identified with the indicator function $\mathbf 1_{z - 2 \leq x \leq z}.$ By definition of the integral, we have that $0 \leq x \leq 2,$ hence if $x$ does not satisfy $x \geq \max \{0, z - 2\},$ then the indicator function $\mathbf 1_{0 \leq z - x \leq 2}$ will be zero. By a similar rationale, if $x$ does not satisfy $x \leq \min \{2, z\},$ then the indicator function $\mathbf 1_{0 \leq z - x \leq 2}$ will be zero. Last, we have that $x \leq z \leq x + 2,$ from which it follows that $0 \leq z \leq 4.$ Ultimately, this analysis yields $$\int_0^2 {\left(\frac{z - x} 2 \mathbf 1_{0 \leq z - x \leq 2} + \mathbf 1_{2 < z - x} \right)} \, dx = \mathbf 1_{0 \leq z \leq 4} \int_{\max \{0, z - 2\}}^{\min \{2, z\}} \frac{z - x} 2 \, dx + \int_0^2 \mathbf 1_{2 < z - x} \, dx.$$ Can you perform a similar analysis for the second integral to complete the problem?