Advanced maths

Green’s theorem calculator

Integrate polynomial vector fields around a rectangle or axis-aligned ellipse, with working.

Your numbers

Polynomials only. Examples: -y, x^2 - y^2, (x+y)^3/2. Use total degree at most 20.

Calculated on your device. Your inputs aren’t sent to us.

Your result

Ready when you are

Enter your inputs and select Calculate.

Report an issue

Try it, understand it

Explore the result

Explore one change at a time: boundary direction, scalar curl and region shape. Every example stays within the supported polynomial and region classes.

Worked example comparison
ExampleOutputWhat to notice
Constant curl · rectangleOriented line integral ∮ P dx + Q dy4P = −y and Q = x give scalar curl 2. The rectangle has area 2, so the counterclockwise integral is 4.
Reverse the boundaryOriented line integral ∮ P dx + Q dy-4The field and region are unchanged. Clockwise orientation reverses the line-integral sign to −4.
Nonzero field · zero curlOriented line integral ∮ P dx + Q dy0P = 2x and Q = 2y are not identically zero, but ∂Q/∂x − ∂P/∂y = 0, so this closed-boundary integral is zero.
Same curl · ellipseOriented line integral ∮ P dx + Q dy12.566371The ellipse with semiaxes 2 and 1 has area 2π. Constant curl 2 gives counterclockwise integral 4π.

Check your understanding

Before checking: what changes if you reverse the boundary direction?

The circulation changes sign. The unsigned region area does not change. This is why the orientation is a separate input.

Can a nonzero field have zero circulation in these examples?

Yes. The gradient example has P = 2x and Q = 2y and zero scalar curl. The field does not have to vanish for its integral around this supported closed boundary to be zero.

Behind the numbers

How this calculation works

For a counterclockwise simple boundary, Green’s theorem replaces circulation along the boundary with an area integral of scalar curl. This tool differentiates supported polynomials and integrates them analytically over the selected region using floating-point arithmetic.

THE FORMULA∮(P dx + Q dy) = ∬(∂Q/∂x − ∂P/∂y) dA for positive orientation

A worked example

For P = −y and Q = x, scalar curl is 2. The rectangle 0 ≤ x ≤ 2, 0 ≤ y ≤ 1 has area 2, giving counterclockwise integral 4.

Good to know

Only polynomial fields with total degree at most 20 and the listed simple regions are supported. No holes, rotated ellipses, arbitrary boundaries, singular fields, trigonometric functions or general computer algebra.

A little curiosity

Why an outline can reveal an area

The vector field calculator shows sampled arrows and local divergence and scalar curl. It does not replace the region integral computed by Green’s theorem.

Choose P = −y/2 and Q = x/2. The scalar curl is 1, so the counterclockwise line integral equals the enclosed area. This is a striking special case: information accumulated around a boundary can measure what is inside.

A planimeter is a mechanical area-measuring instrument that follows an outline. The connection between line integrals and area helps explain its mathematical principle. The Harvard lecture reference discusses that application alongside Green’s theorem.

The area of a rectangle can independently check the integration region in the rectangular case; the line integral still also depends on the entered field and orientation. The vector line integral calculator for parametric curves instead integrates an explicitly entered path with symbolic velocity and Simpson quadrature. The selected path and orientation remain part of that task.

The direction of travel changes the sign

For a simple region without holes, positive orientation means traversing its boundary counterclockwise, with the interior on your left. Reversing the boundary reverses the circulation integral. It does not make the geometric area negative.

The result panel keeps the region area separate and labels the oriented line integral. Try the same field with both direction selections: the circulation changes sign while the area remains unchanged.

A useful polynomial test you can check by hand

For P = −y and Q = x, differentiating gives ∂Q/∂x = 1 and ∂P/∂y = −1. The difference is 2, so the integral is twice the region’s area for counterclockwise orientation. On a rectangle of width 2 and height 1, the answer is 4.

For an ellipse with semiaxes 2 and 1, the same field gives 4π. A circle is the special case where both semiaxes match. Moving the ellipse does not change this constant-curl example because its area stays the same.

What this solver supports

Enter polynomial expressions in x and y with non-negative integer powers and total degree at most 20. Parentheses, ordinary multiplication, implicit forms such as 2x, and division by nonzero numeric constants are supported. The solver does not execute arbitrary code or accept a general function library.

The listed regions are rectangles and axis-aligned ellipses. Arbitrary curved boundaries, holes and singular vector fields need additional analysis. Polynomial fields are smooth, but that fact does not extend a result to a different nonsmooth field copied into the same problem.

A few questions, answered

Can I enter sin(x), exp(y) or 1/x?

No. This implementation is restricted to polynomials and constant division. Unsupported expressions are rejected explicitly.

Does it numerically sample the boundary?

No. It differentiates the polynomial and uses analytic polynomial area integrals evaluated with floating-point arithmetic.

Can I use a clockwise boundary?

Yes. Select Clockwise; the result negates the corresponding counterclockwise area integral.

How is an ellipse specified?

Enter its centre and positive horizontal and vertical semiaxes. The ellipse is axis-aligned; a rotated ellipse is outside this input model.

Find your calculator

Start typing to explore the library.