Help using Green's theorem to find volume of function inside a polygon

75 Views Asked by At

For my work, I am trying to find the volume under a two dimensional function $f(x,y)$ bounded by a polygon of $n$ vertices.

My dim memory of undergrad is that Green's theorem is the way to go for this, but the calculations in my test case are all coming out wrong and I don't know if it's an error in calculation or in understanding how to apply the theorem.

I'm going to describe as best I can my understanding of how the theorem is applied, and I hope someone will be able to spot where I went wrong


My process is partly taken from this question: https://mathoverflow.net/questions/425647/double-integral-in-a-polygon-domain and this Michael Penn youtube video: https://www.youtube.com/watch?v=Y2cBpBLJlfU

The equation I want to solve is $$\iint_A f(x,y) dx dy $$

The relation between the line integral and area integral is: $$\oint_C (P(x,y) dx + Q(x,y) dy ) = \iint_A \left( \frac{\partial Q}{\partial x} - \frac{\partial P}{\partial y} \right) dx dy $$

Which means that $$f(x,y) = \frac{\partial Q}{\partial x} - \frac{\partial P}{\partial y}$$

At this point there is some freedom in what I choose P and Q to be. The standard approach seems to be to set $Q =\int f(x,y) dx = F(x,y)$ and set $P = 0$ which means the equation I want to solve becomes: $$ \oint_C (F(x,y) dx + 0 dy )$$

This part I'm a bit hazy on

In order to solve this line integral, I need to parameterise $F(x,y)$ with a function of $t$. For the sides of a polygon, this is a straight line of the form $\langle x_{n-1} +(x_n - x_{n-1} )t, y_{n-1} + (y_n-y_{n-1})t \rangle$ for $0 >= t >= 1$, where $x_{n-1},y_{n-1}$ and $ x_n,y_n$- are the startpoints and endpoints of the line segment respectively. This means the equation for line integrals $$\oint_C (F(x,y) dx + 0 dy ) =\int_a^b F(\mathbf{r}(t)) |\mathbf{r}'(t)| dt $$

becomes

$$ \sqrt{(x_n - x_{n-1})^2+(y_n - y_{n-1})^2}\int_0^1 F(x_{n-1} +(x_n - x_{n-1} )t,y_{n-1} +(y_n - y_{n-1} )t) dt$$ Which can be solved through normal methods.


The test function I chose to work this out was $f=xy$, partly because it's simple, and partly because my actual (more complicated) function is of the form $g(x)h(y)$. For the polygonal boundary, I choose the square region from 1 to 2, so that $A =( (1,1),(2,1),(2,2) ,(1,2))$. This is so the process can be easily verified by other methods.

enter image description here

$$ f(x,y) = xy = \frac{\partial Q}{\partial x} $$ $$ F(x,y) = \int xy dx = \frac{x^2y}{2} $$ $$\oint_C (F(x,y) dx + 0 dy ) = \sum_{n=1}^4 \sqrt{(x_n - x_{n-1})^2 + (y_n - y_{n-1} )^2}\int_0^1 (x_{n-1} +(x_n - x_{n-1} )t)^2(y_{n-1} +(y_n - y_{n-1} )t) dt $$

Which if you integrate and plug in the values of A for $x_1...x_n,y_1...y_n$, you get $$\frac{7}{6} + 3 + \frac{1}{6} + \frac{1}{6} = 4.5$$ Which is double the correct answer of 2.25

Furthermore, when I try the same process on the lower triangle ((1,1),(2,1),(2,2)), which is exactly half the volume A because $xy$ is symmetric on the xy axis, I get the bogus answer of 7.17, when I should be getting 1.125.

Is my approach to using Green's theorem wrong? Or is this just a likely mistake in computation?