The main concern is whether the integral of a piecewise function is
even well-defined. It seems to me that at least for continuous
piecewise functions, the indefinite integral is well-defined. The
anti-derivative is well defined, and by the fundamental theorem of
calculus, the indefinite integral of a continuous function is the
anti-derivative. As for discontinuous piecewise functions, I'm finding
it difficult to convince myself either way.
The trac ticket is 4721 ( http://trac.sagemath.org/sage_trac/ticket/4721 )
-- Paul
This crops up regularly in solid mechanics, in particular in the bending
of beams. One can represent the loading of a beam as derivatives and
integrals of Heaviside functions and then integrate the expression to
get the shear force, bending moment, and deflection of the beam. It's
also one of the parts of Maple that's problematic. I wrote some code
for my students a few years back to help them, but unfortunately, there
are problems with some integrals of Heaviside functions. These can be
discontinuous piecewise functions, at least the shear and moment graphs.
Cheers,
Tim.
---
Tim Lahey
PhD Candidate, Systems Design Engineering
University of Waterloo
http://www.linkedin.com/in/timlahey
First, the indefinite integral is the anti-derivative, by definition.
On Sat, Dec 6, 2008 at 11:39 AM, Paul Butler <pau...@gmail.com> wrote:
>
> Currently, taking the integral of a piecewise function in Sage gives
> you the definite integral. I've proposed on trac that the integral of
> piecewise functions be indefinite by default. This would be consistent
> with how integration works on other functions in Sage, as well as
> piecewise functions in Maple and Mathematica.
>
> The main concern is whether the integral of a piecewise function is
> even well-defined. It seems to me that at least for continuous
> piecewise functions, the indefinite integral is well-defined. The
> anti-derivative is well defined, and by the fundamental theorem of
> calculus, the indefinite integral of a continuous function is the
> anti-derivative. As for discontinuous piecewise functions, I'm finding
> it difficult to convince myself either way.
What the FTC says is that although the indefinite integral "evalated
at b" is not
well-defined, and the same antiderivative "evalated at a" is also not
well-defined,
their difference *is* well-defined. Moreover, this difference agrees with the
definite integral defined by the Riemann sum between a and b.
Second, I think (but I am not sure), what you want when you say
indefinite intergal is not the indefinite integral but is a function who
derivavtive is the original function, defined as follows:
if the orginial function f(x) is
f1(x), a1<x<=a2,
f2(x), a2<x<=a3,
...
fn(x), an<x<=a{n+1}
(and 0 outside (a1,a{n+1}) then I guess you want to define the integral,
call it F, by
int_{a1}^x f1(t) dt, a1<x<=a2,
int_{a2}^x f2(t) dt, a2<x<=a3,
...
int_{an}^x fn(t) dt, an<x<=a{n+1}
Is this correct? This is not the antiderivative
but it does have the property that F'(x)=f(x).
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.
sage: f(x)=max(1,floor(x))
sage: f(10)
1
sage: type(f)
<class 'sage.calculus.calculus.CallableSymbolicExpression'>
huh, there are some problems with this function, first because it always
return 1 and second because it's not built with Piecewise, which is the
point of the discussion.
Ronan