Look at the curve of your integral

Your integral is the red one, and the closed curve is the red one plues the green one. The point is that the green one is a integral only over because along that line, so you can apply Green's theorem to theclosed(red + green) curve. As you have said it gives but what it is is the integral along the closed curve, not the one you asked. So:

Now I denote the red curve and the green one, so that:

Note that both the integral in and are line integrals!

In particular, the is a easy line integral, the usual integral over some interval in