MathGroup Archive 2003

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Integrate with piecewise function

  • To: mathgroup at
  • Subject: [mg44068] Re: Integrate with piecewise function
  • From: bobhanlon at (Bob Hanlon)
  • Date: Mon, 20 Oct 2003 01:13:37 -0400 (EDT)
  • References: <bmt8gd$87u$>
  • Sender: owner-wri-mathgroup at

Use a more straightforward definition for dis, i.e., define it using
mathematical functions rather than program control logic




Bob Hanlon

In article <bmt8gd$87u$1 at>, "Chia-Ming"
<yucalf at> wrote:

<< I define a function describing the distance on the edge of a circle.

dis[x_, xi_] := Which[ x - xi >= 0, x - xi, x - xi < 0, xi - x]

Then I find that the command Integrate does not yield the result (37/72).

Integrate[dis[x, 0], {x, 0, 1/6}]

If I use the command NIntegrate, only the numerical result is yielded. But I
want the
exact result.

NIntegrate[dis[x, 0], {x, 0, 1/6}]

How can I get the exact result, just like I keyin the command by hand.

Integrate[-x, {x, -1, 0}] + Integrate[x-0, {x, 0, 1/6}]

  • Prev by Date: DataSmoothing problem
  • Next by Date: Re: Integrate with piecewise function
  • Previous by thread: DataSmoothing problem
  • Next by thread: Re: Integrate with piecewise function