MathGroup Archive 2004

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

Search the Archive

Re: UnitStep

  • To: mathgroup at smc.vnet.net
  • Subject: [mg52377] Re: UnitStep
  • From: "David W. Cantrell" <DWCantrell at sigmaxi.org>
  • Date: Thu, 25 Nov 2004 05:49:51 -0500 (EST)
  • References: <200411230712.CAA29371@smc.vnet.net> <co1dp5$sbm$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

DrBob <drbob at bigfoot.com> wrote:
[snip]
> In version 5.1 we have a different choice:
>
> (inputs)
> f[p_] = Piecewise[{{0, p == 0}, {(1/p) UnitStep[p - 1], True}}];
> Integrate[f@x, {x, -5, 5}]
> D[f@x, {x}]
> Integrate[%, x]
> Plot[f@x, {x, -5, 5}]
>
> (outputs)
> Log[5]
> Piecewise[{{0, x < 1}, {-(1/x^2), x > 1}}, Indeterminate]
> Piecewise[{{0, x <= 1}}, -1 + 1/x]
> (and a plot)
>
> This time D followed by Integrate is evaluated, but WRONG.

I don't know why you think it's wrong. But in fact, it is not only right,
but also clever. Note that the original function is discontinuous, as is
its derivative. Then when we Integrate that, we need to get an
antiderivative of the derivative of f. But due to the discontinuity, an
antiderivative of the derivative of f need not be f itself. To confirm that
the result of Integrate is correct, just differentiate that result

Piecewise[{{0, x <= 1}}, -1 + 1/x]

in your head. Don't you get

Piecewise[{{0, x < 1}, {-(1/x^2), x > 1}}, Indeterminate]

just as desired?

The antiderivative is clever because Mathematica chose -1 as the constant
of integration in the part for x > 1, thereby nicely making the
antiderivative continuous.

David Cantrell


  • References:
    • UnitStep
      • From: "Blimbaum, Jerry AA R22" <jerry.blimbaum@navy.mil>
  • Prev by Date: Re: Mathematica&SuSe 9.2: Inputformulars disabled
  • Next by Date: tetrahedral Siegel Disk Julia map
  • Previous by thread: Re: UnitStep
  • Next by thread: Re: UnitStep