Re: Integrate and Piecewise

• To: mathgroup at smc.vnet.net
• Subject: [mg98462] Re: [mg98416] Integrate and Piecewise
• From: Daniel Lichtblau <danl at wolfram.com>
• Date: Fri, 10 Apr 2009 04:54:40 -0400 (EDT)
• References: <200904090955.FAA06715@smc.vnet.net>

```Hugh Goyder wrote:
> Below I make a piecewise function that is continuous. Then I integrate
> it to make another piecewise function. However, the integrated
> function is not continuous. Presumable because I do indefinite
> integration and each part of the piecewise function needs a constant
> of integration. Is there anyway of doing the integration and getting a
> continuous function? I would like the function to be zero at  minus
> infinity. Do I have to break the function out into its parts or can I
> keep it all as a Piecewise function?
>
> Thanks
> Hugh Goyder
>
> f4[t_, a_, t0_] := Piecewise[{
>    {0, t - t0 <= -a},
>    { 4 (t - t0 + a)/a, -a < t - t0 <= -(3/4) a},
>    {1 - 4/a (t - t0 + (3 a)/4), -(3/4) a < t - t0 <= -(1/4) a},
>    {-1 + 4/a (t - t0 + a/4), -(1/4) a < t - t0 <= 0},
>    {-(4/a) (t - t0 ), 0 < t - t0 <= 1/4 a},
>    {-1 + 4/a (t - t0 - 1/4 a), 1/4 a < t - t0 <= 3/4 a},
>    {1 - 4/a (t - t0 - 3/4 a), 3/4 a < t - t0 <= a}
>    }]
>
> Plot[f4[t, 1, 0], {t, -3, 3}]
>
> f3[t_, a_, t0_] := Evaluate[Integrate[f4[t, a, t0], t]]
>
> Plot[f3[t, 1, 0], {t, -3, 3}, PlotRange -> All]

Formulate f3 as a definite integral from -Infinity to t.

f3[t_, a_, t0_] :=
Evaluate[Integrate[f4[x, a, t0], {x, -Infinity, t},
Assumptions -> Element[{a, t0, t}, Reals]]]

Daniel Lichtblau
Wolfram Research

```