Re: How to integrate over a constrained domain
- To: mathgroup at smc.vnet.net
- Subject: [mg34218] Re: [mg34203] How to integrate over a constrained domain
- From: Andrzej Kozlowski <andrzej at platon.c.u-tokyo.ac.jp>
- Date: Fri, 10 May 2002 03:05:00 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
A little complicated looking, perhaps, but it can be done, (at least when r is a real number). In[1]:= <<Experimental` In[2]:= Integrate[1, Sequence @@ ({#1[[3]], #1[[1]], #1[[5]]} & ) /@ List @@ GenericCylindricalAlgebraicDecomposition[ x^2 + y^2 <= 1, {x, y}][[1]]] Out[2]= Pi Andrzej Kozlowski Toyama International University JAPAN http://platon.c.u-tokyo.ac.jp/andrzej/ On Thursday, May 9, 2002, at 06:16 PM, Maciej Sobczak wrote: > Hi, > > Let's say I have a set on a (x,y) plane given by: > > x^2 + y^2 < r^2 > > and I want to compute its area. > Yes, I know its Pi*r^2, but I want Mathematica tell me. > > As a generalization, I want to integrate over a domain given by one or > more > inequalities. > The problem above can be solved like this: > > Integrate[1, {x, -r, r}, {y, -Sqrt[r^2-x^2], Sqrt[r^2-x^2]}] > Simplify[%, {r>0}] > > which gives > > Pi r^2 > > That's nice, but requires solving the inequality for y, which is not > always > viable. > > It would be nice to have syntax like: > > Integrate[1, {x, y}, {x^2 + y^2 < r^2}] > > but it does not work (of course). > > How can I achieve what I want? > > Cheers, > > -- > Maciej Sobczak > http://www.maciejsobczak.com/ > > > > > >