Re: Integrating over a Minimum

• To: mathgroup at smc.vnet.net
• Subject: [mg32980] Re: [mg32946] Integrating over a Minimum
• From: Tomas Garza <tgarza01 at prodigy.net.mx>
• Date: Fri, 22 Feb 2002 01:49:11 -0500 (EST)
• References: <200202210706.CAA02149@smc.vnet.net>
• Sender: owner-wri-mathgroup at wolfram.com

```I take the example you give. Try NIntegrate instead of Integrate:

In[1]:=
NIntegrate[Min[x, y], {y, 0, 1}, {x, 0, 1}]
Out[1]=
0.33333

I quote from the Help Browser: "Integrate can evaluate integrals of rational
functions. It can also evaluate integrals that involve exponential,
logarithmic, trigonometric and inverse trigonometric functions, so long as
the result comes out in terms of the same set of functions." If you're
interested in numerical results - which I assume is the case - I think you
can successfully use NIntegrate. Another example:

In[1]:=
f[x_, y_] := x + y /; 0 <= x <= 1 && 0 <= y <= 1;
f[x_, y_] := x + 2*y /; x >= 1 || y >= 1;

In[2]:=
NIntegrate[f[x, y], {x, 0, 2}, {y, 0, 2}]
Out[2]=
11.5

Tomas Garza
Mexico City

----- Original Message -----
From: "Moritz Meyer-ter-Vehn" <meyerter at pool.uni-mannheim.de>
To: mathgroup at smc.vnet.net
Subject: [mg32980] [mg32946] Integrating over a Minimum

> Hi,
>
> I want to integrate piecewise linear functions over a highdimensional
> space. The ranges where the function is linear are given by linear
> inequality constraints.
>
> Example: Integrate[Min[x,y],{y,0,1},{x,0,1}]
> (of course that is not the one I really want to solve)
>
> I could not get matematica to do this.
>
> Moritz Meyer-ter-Vehn
>
>

```

• Prev by Date: World map
• Next by Date: Re: complexity of AppendTo
• Previous by thread: Integrating over a Minimum
• Next by thread: Re: Integrating over a Minimum