I have used Green's Theorem. For limits, I divided triangle into two right triangles. Then I found the equation of two sides of triangle which were $2y=x+1$ and $y=2-x$. As, I divided the triangles which helped me dividing the integral into two parts. My limits for section one were $y=0$ to $y=(x+1)/2$; $x=-1$ to $x=1$ and for section two my limits were $y=0$ to $y=2-x$ and $x=1$ to $x=2$. As, I have used Green's Theorem my function was $2x$ after taking partial derivative. My final answer was $7/3$. I do not whether it is correct or not.
I just have two questions is my method correct? and can we find out the line integral directly without using Green's Theorem. Thanks for help.
Your approach is correct, but I got a different result. Check out your computations!
Moreover, by using Green's Theorem, we may also evaluate the double integral in just one step: $$\int_{y=0}^1\left(\int_{x=2y-1}^{2-y}2x\,dx\right)\,dy=\int_{0}^1(2-y)^2-(2y-1)^2\,dy=\left[-\frac{(2-y)^3}{3}-\frac{(2y-1)^3}{6}\right]_0^1=2.$$