Solution (source code)

= Solution

Assume a simple, piecewise smooth closed <curve> oriented counterclockwise around its enclosed region $D$. Apply <Green's theorem> with $P=-y$ and $Q=x$:
$$
\oint_C(x\,dy-y\,dx)
=\iint_D(Q_x-P_y)\,dx\,dy
=\iint_D2\,dx\,dy
=\boxed{2\,\operatorname{area}(D).}
$$
The orientation assumption is essential. A clockwise unit <circle>, $x=\cos\theta$, $y=-\sin\theta$ for $0\le\theta\le2\pi$, gives $-2\pi$ although its enclosed <area> is $\pi$. For a self-intersecting <curve> the same <line integral> measures twice the <signed area>, with multiplicity, rather than necessarily twice an ordinary enclosed <area>.

For positive semiaxes $a,b$, the <ellipse> has the counterclockwise <parametrization> $x=a\cos\theta$, $y=b\sin\theta$. Then
$$
x\,dy-y\,dx
=ab(\cos^2\theta+\sin^2\theta)\,d\theta=ab\,d\theta.
$$
Therefore
$$
\boxed{\operatorname{area}(\text{ellipse})=\frac12\int_0^{2\pi}ab\,d\theta=\pi ab.}
$$
If nonzero signed constants are allowed in place of positive semiaxes, the geometric <area> is $\pi|ab|$.