If I want to find the $c$ of a $PDF$ when it's given:
$f_{X,Y}\left(x,y\right)=c\:\:\:\:\left(The\:area\:in\:blue\right),\:otherwise:\:0$

I try to do that:
$$\int _{\frac{1}{2}}^1\:\int _{-x+\frac{3}{2}}^1\:c\,dy\,dx+\int _0^1\:\int _{-x+\frac{1}{2}}^{-x+1}\:c\,dy\,dx=1$$
But I got $c=\frac{8}{5}$ and the result is $c=2$.
(I know we can calculate it with by calculating the area of the triangles but I am wondering to know why my way is not working)
You need to calculate like this:
$$\int _0^{\frac{1}{2}}\:\int _{\frac{1}{2}-x}^{-x+1}\:cdydx+\int _{\frac{1}{2}}^1\int _0^{-x+1}\:\:cdydx+\int _{\frac{1}{2}}^1\int _{-x+\frac{3}{2}}^1\:\:cdydx=1$$
And then you'll get: $c=2$