I have an integral $$\int_C xy^2dx-4x\sin y\,dy$$ where $C$ bounded with some constrains, for instance inside $x^2+y^2=1$ and below $y=x^2$.

I can integrate of one variable and also with some calculations do above integral, but I want to know how can Mathematica do it. Is it something of the form

Integrate[f[x]-g[y], {x, 0, 2 π}, {y, 0, 2 π}]

but it doesn't work, or can software do that!

How can I do this type of integrals? Thanks.

  • $\begingroup$ I would rewrite it in polar coordinates... $\endgroup$ – MsTais Nov 3 '17 at 0:33
  • $\begingroup$ Thanks. but I want just this form! $\endgroup$ – Nosrati Nov 3 '17 at 0:34
  • $\begingroup$ From the documentation of Integrate, you can specify a region. Example from the doc: Integrate[1, {x, y, z} \[Element] Sphere[]]. $\endgroup$ – anderstood Nov 3 '17 at 0:36
  • $\begingroup$ Thanks. I think this is triple integral but the question is about some weird with $x$ and $y$ variable! $\endgroup$ – Nosrati Nov 3 '17 at 0:38
  • $\begingroup$ Integrate[x y^2 - 4 x Sin[y], {x, y} [Element] Circle[]]... "..weird x and y.." gives you a circle... $\endgroup$ – MsTais Nov 3 '17 at 0:40

Using Green's theorem is simplest. Here is L, M and the region:

L[x_, y_] := x y^2
M[x_, y_] := -4 x Sin[y]
region = ImplicitRegion[x^2 + y^2 < 1 && y < x^2, {x, y}];

Visualize region:

Region @ region

enter image description here

Perform integral:

    NIntegrate[D[M[x, y], x] - D[L[x, y], y], {x, y} ∈ region]


Answers using the line integral approach can be compared to this answer.

Update for M9 users

In M9, one can use Boole:

    (D[M[x, y], x]-D[L[x, y], y]) Boole[x^2+y^2<1 && y<x^2],


  • $\begingroup$ Thanks. I restart my software but it doesn't work (version 9.0). Is it need to execute a package (like ancient versions) for your codes? $\endgroup$ – Nosrati Nov 3 '17 at 1:47

Sorry the code line gets screwed up in comments...

Integrate[x y^2 - 4 x Sin[y], {x, y} \[Element] Circle[]]

with zero output.

Reference is here ,and here for how to define the unit circle...

Another way to express it is

Integrate[x y^2 - 4 x Sin[y], {x, y} \[Element] Circle[{0, 0}, 1]]
  • $\begingroup$ How do I add the condition $y\geq x^2$.? $\endgroup$ – Nosrati Nov 3 '17 at 0:59
  • $\begingroup$ condition is there. See edits, pls. $\endgroup$ – MsTais Nov 3 '17 at 1:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.