Is my integration correct or wrong? Is my integration correct or wrong?
I have doubts with these:
$$ P(x+y<1/2)=\int_{0}^{1/2} \! \int_{0}^{1/2-y} \! f(x,y) \, dx dy $$
$$ P(x+y>1/2)=\int_{0}^{1} \! \int_{1/2-y}^{1} \! f(x,y) \, dx dy $$
To conclude how can I make sure if my integration is correct? Are there any indicators? Please, help me how can I defend it.
Thank you.
 A: You are probably thinking of a pair $(X,Y)$ that take values in $\left[0,1\right]^2$.
If so then you could write:
$$P\left[X+Y<\frac{1}{2}\right]=\int_{0}^{1}\int_{0}^{1}\left[x+y<\frac{1}{2}\right]f\left(x,y\right)dxdy$$
$$P\left[X+Y>\frac{1}{2}\right]=\int_{0}^{1}\int_{0}^{1}\left[x+y>\frac{1}{2}\right]f\left(x,y\right)dxdy$$
where $$\left[x+y<\frac{1}{2}\right]:\left[0,1\right]^{2}\rightarrow\left\{ 0,1\right\} $$
$$\left[x+y>\frac{1}{2}\right]:\left[0,1\right]^{2}\rightarrow\left\{ 0,1\right\} $$
denote the characteristic function of the sets: $$\left\{ \left(x,y\right)\in\left[0,1\right]^{2}\mid x+y<\frac{1}{2}\right\} $$
$$\left\{ \left(x,y\right)\in\left[0,1\right]^{2}\mid x+y>\frac{1}{2}\right\} $$
respectively.
If you are using a density $f:\left[0,1\right]^{2}\rightarrow\left[0,\infty\right)$
then that results in $$P\left[X+Y<\frac{1}{2}\right]=\int_{0}^{\frac{1}{2}}\int_{0}^{\frac{1}{2}-y}f\left(x,y\right)dxdy$$
$$P\left[X+Y>\frac{1}{2}\right]=\int_{0}^{1}\int_{\max\left\{ 0,\frac{1}{2}-y\right\} }^{1}f\left(x,y\right)dxdy$$
Note that we have $\max\left\{ 0,\frac{1}{2}-y\right\} $ instead of $\frac{1}{2}-y$
because $f\left(x,y\right)$ is not defined for a negative $x$. 
To avoid this you could use a density on $\mathbb{R}^{2}$ that coincides with
the original on $\left[0,1\right]^{2}$ and is $0$ elsewhere. 
Example
Define $f:\mathbb{R}^{2}\rightarrow\left[0,\infty\right)$ by $f\left(x,y\right)=1$
if $\left(x,y\right)\in\left[0,1\right]^{2}$ and $f\left(x,y\right)=0$
otherwise. Then
$\int\int f\left(x,y\right)dxdy=\int_{0}^{1}\int_{0}^{1}1dxdy=1$
showing that $f$ is a density. Here:
$P\left[X+Y>\frac{1}{2}\right]=\int\int f\left(x,y\right)dxdy=\int_{0}^{1}\int_{\frac{1}{2}-y}^{1}f\left(x,y\right)dxdy$. 
If $y\leq\frac{1}{2}$ then $\int_{\frac{1}{2}-y}^{1}f\left(x,y\right)dx=\int_{\frac{1}{2}-y}^{1}dx=y+\frac{1}{2}$
If $y>\frac{1}{2}$ then $\int_{\frac{1}{2}-y}^{1}f\left(x,y\right)dx=\int_{0}^{1}f\left(x,y\right)dx+\int_{\frac{1}{2}-y}^{0}f\left(x,y\right)dx=\int_{0}^{1}dx+\int_{\frac{1}{2}-y}^{0}0dx=1$
This leads to $P\left[X+Y>\frac{1}{2}\right]=\int_{0}^{\frac{1}{2}}\left(y+\frac{1}{2}\right)dy+\int_{\frac{1}{2}}^{1}1dy=\frac{3}{8}+\frac{1}{2}=\frac{7}{8}$. 
