David, thanks. What do you mean by an+ and an- in the notation?
>From what I can tell, that does look like the same algorithm I plan to use. I have some working code now, I just want to review it and make sure I didn't miss any edge cases before re-posting the patch. The code posted as a patch now uses the same algorithm, but doesn't properly handle unbounded functions. -- Paul On Tue, Dec 9, 2008 at 8:32 AM, David Joyner <[EMAIL PROTECTED]> wrote: > > Paul: > It was not at all clear to me when you first started working on the > antiderivatives of piecewise defined functions that it was possible or > made sense. > Now I have changed my mind to an extent. If you think of the > antiderivative as the > (multi-valued) inverse of the differentiation map, as I usually do, then I'm > not sure what to do. But if you just want a function whose derivavtive is the > original and which satisfies the FTC, then I think I have an algorithm which > might work. > > Let f(x) be the piecewise defined function which is fn(x) for an<x<a(n+1), > for n in ZZ (and let us ignore endpots for now). Here a_n is an > infinite sequence > a_{-infty}=-infty and a_{infty}=+infty and each f_n(x) is Riemann integrable > with antiderivative Fn(x)+Cn. The question is can we piece the Cns's > together so that > F(x) = Fn(x)+Cn for an<x<a(n+1) satisfies the FTC? These constants must > satisfy > > Cn = F_{n-1}(an-)-Fn(an+)+C_{n-1}, > > If you fix C0 = C to be an arbitrary constant (you could take this to > be 0 for example), > this is a 1-step recursionrelation which can be solved. > > I think this should do the job. > > Thanks for raising this issue! > > ++++++++++++++++++++++++++++++++++++ > > > On Sat, Dec 6, 2008 at 5:06 PM, Paul Butler <[EMAIL PROTECTED]> wrote: >> When a1 = -infinity, I would make F1 = integrate(f, x, a2, x) instead of >> integrate(f, x, a1, x). Then I would not calculate the definite integral of >> the first interval, which would align my constants so that F(a2) = 0. When I >> get a chance, I'll add this to my code. >> >> Functions like floor with an infinite number of pieces are beyond the scope >> of the Piecewise class, because piecewise functions in Sage can only (at the >> moment) have finitely many pieces. I can't give an algorithm for integration >> of all piecewise functions with multiple pieces off the top of my head, but >> I'll give it some thought. >> >> -- Paul >> >> On Sat, Dec 6, 2008 at 4:13 PM, David Joyner <[EMAIL PROTECTED]> wrote: >>> >>> Okay, this helps me understand what you mean. >>> >>> Still, the case a1=-ifinty is precisely the special case which I don't >>> understand. >>> >>> For example, take a function such as f(x) = max(1,floor(x)), x real. >>> How do you define an antiderivative F(x) so that >>> F(b)-F(a) = area under the y=f(x) for a<x<b? >>> (And mayeb you can do it for that special function, >>> and let us ignore points of discontinuity for the sake of >>> discussion.) In other words, I am asking for the algorithmic procedure >>> you would use to create an "area function" of a piecewise-defined >>> function on the reals. >>> >>> >>> > >>> > With this definition, F(b) - F(a) can be used to find the Riemann sum >>> > between a and b. Also, F'(x) = f(x) seems to hold, except at points >>> > where >>> > f(x) goes from defined to undefined or vice-versa. >>> > >>> >> The antiderivative is only well-defined up to an additive constant. >>> >> IMHO, the piecewise defined function of antiderivavtives >>> >> >>> >> int f1(x) dx +C1 , a1<x<=a2, >>> >> int f2(x) dx +C2, a2<x<=a3, >>> >> ... >>> >> int fn(x) dx +Cn, an<x<=a{n+1} >>> >> >>> >> does not make sense. >>> > >>> > I agree that it doesn't make sense where C1 .. Cn are arbitrary >>> > constants. >>> > >>> > -- Paul >>> > >>> > > >>> > >>> >>> >> >> >> > >> > > > > --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---