Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2003
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2003

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

Search the Archive

Integrate piecewise with Assumptions

  • To: mathgroup at smc.vnet.net
  • Subject: [mg44072] Integrate piecewise with Assumptions
  • From: "Chia-Ming" <yucalf at mail.educities.edu.tw>
  • Date: Tue, 21 Oct 2003 02:07:45 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

Excuse me,

First, I define a piecewise function to discribe the shortest distance
on the edge of a circle.

dis[x_, xi_] :=
  Which[1/2 >= x - xi >= 0, x - xi, x - xi > 1/2, 1 - (x - xi),
    0 > x - xi >= -1/2, xi - x, x - xi < -1/2, 1 - (xi - x)]

And it does works that it can automatically judge to go in a clockwise
or a conter-clockwise direction.

dis[2/3, 1/10]
13/30

Furthermore, dis[] can be applied in the Integrate[] command:

Integrate[(a - 5 dist[1/6, x])^2, {x, 0, 1}]// Simplify
25/12 - (5 a)/2 + a^2

However, it can not work with the option Assumptions:

Integrate[(a - 5 dist[y, x])^2, {x, 0, 1}, Assumptions->0<y<1/2]//Simplify

While the above calculation can be completed by hands:

Integrate[(a - 5 (y - x))^2,     {x, 0, y}] +
Integrate[(a - 5 (x - y))^2,     {x, y, y + 1/2}] +
Integrate[(a - 5 (1 - x + y))^2, {x, y + 1/2, 1}]//Simplify

I don't know how to improve it. Please help me, thank you very much!


Chia-Ming Yu



  • Prev by Date: Re: recode procedural algorithm to faster functional module
  • Next by Date: NotebookML & css
  • Previous by thread: non linear least square minimization....
  • Next by thread: Re: Integrate piecewise with Assumptions