The formal statement of Green's theorem is (Stuart Calculus)
Let C be a positivley oriented, piecwise-smooth, simple closed curve int he plance and let D be the region bounded by C. If P and Q have contionous partial derivatives on an open region that contains D, then
You started with
note that
Now using Greens theorem