I want to compute a integral of a polynomial $f(x, y)$ over a polygon domain $D$ of $n$ sides.
$$ I(f) = \int_{D} f(x, \ y) \ dx \ dy $$
The vertex of this polygon are
$$\vec{p}_{i} = (x_i, \ y_i) \ \ \ \ \ \ \ \ \forall \ i = 1, \ 2, \ \cdots , \ n$$
The main aproach is transform this integral over the domain in a integral over the boundary using Green's theorem.
$$ \int_{D} \left(\dfrac{\partial Q}{\partial x} - \dfrac{\partial P}{\partial y}\right)\ dA = \oint_{C} P \ dx + Q \ dy $$
Where the path $C$ is
$$ \partial D = C = C_1 \cup C_2 \cup \cdots \cup C_{n} = \bigcup_{i=1}^{n} C_{i} $$
And $C_{i}$ is defined by the linear parametrization with $t \in \left[0, \ 1\right] $
$$ \vec{p}(t) = \left(1-t\right)\cdot \vec{p}_{i} + t \cdot \vec{p}_{i+1} $$ $$ x(t) = \left(1-t\right) \cdot x_{i} + t \cdot x_{i+1} $$ $$ y(t) = \left(1-t\right) \cdot y_{i} + t \cdot y_{i+1} $$
And therefore the integral $I$ is just
$$ I = \sum_{i = 1}^{n} \int_{C_i} P \ dx + Q \ dy = \sum_{i = 1}^{n} \int_{0}^{1} \left(P, \ Q\right) \cdot \dfrac{d\vec{p}}{dt} \ dt $$
$$ \boxed{ I = \sum_{i = 1}^{n} \int_{0}^{1} \left(P, \ Q\right) \cdot \left(\vec{p}_{i+1}-\vec{p}_{i}\right) \ dt} $$
To compute this integral, I can choose whatever I want for $P$ and $Q$ such that
$$ f(x, \ y) = \dfrac{\partial}{\partial x} Q(x, \ y) - \dfrac{\partial}{\partial y} P(x, \ y) $$
And then compute the sum.
The question: Why the expression is not unique?
Like, if I choose a pair $(P_1, \ Q_1)$, I get a function $g_1(x_1, \ y_1, \ \cdots, \ x_{n}, \ y_{n})$. But if I choose another pair $(P_2, \ Q_2)$, I get $g_2(x_1, \ y_1, \ \cdots, \ x_{n}, \ y_{n})$ with
$$ g_1 \ne g_2 $$
Example: In the video Michael Penn - Overkill - The area of a rectangle we have $f(x, y) = 1$.
Then he chose $P = 0$ and $Q = x$ to get
$$ I(1) = \sum_{i = 1}^{n} \dfrac{(x_{i+1}+x_{i})(y_{i+1}-y_{i})}{2} $$
But if I choose $P=-y$ and $Q = 0$ I get
$$ I(1) = \sum_{i=1}^{n} \dfrac{(x_{i+1}-x_{i})(y_{i+1}+y_{i})}{2} $$