Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 1998

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

Search the Archive

Re: Bug in Calculus`DiracDelta`

  • To: mathgroup at
  • Subject: [mg14842] Re: Bug in Calculus`DiracDelta`
  • From: "Kevin J. McCann" <kevinmccann at>
  • Date: Fri, 20 Nov 1998 02:16:51 -0500
  • Organization: @Home Network
  • References: <72je71$> <72tscl$>
  • Sender: owner-wri-mathgroup at

I don't believe that the change of variables suggested by Bill "gives
the correct result for all  limits of integration."  Try 0->2Pi and you
get zero which is not correct.

To get a handle on DiracDelta manipulations, I like to go to one of the
limiting forms.  Try the following:

delta[n_, x_] :=
Integrate[delta[n, x],
  {x, -Infinity, Infinity}]
NIntegrate[delta[10, x], {x, -5, 5}] Plot[delta[10, x], {x, -2, 2},
  PlotRange -> All]
NIntegrate[delta[10, Cos[x]],
  {x, 0, 2*Pi}]
Plot[delta[10, Cos[x]], {x, 0, 2*Pi},
   PlotRange -> All];

(If you copy this into a NB and then highlight the right notebook
bracket and type Ctl-Shift-N, it will prettify the input) .  Anyway,
you can see that the correct result for


is 2, not zero.


W. K. Bertram wrote in message <72tscl$iqi at>...
>M. Rommel wrote:
>> I know normally "it's the user, stupid!" but this one seems real.
>> In[1]:=    <<Calculus`DiracDelta`
>> In[2]:=    Integrate[DiracDelta[Cos[x]],{x,0,\[Pi]}]
>> Out[2]=  1
>> That's what I agree with but the next line I cannot:
>> In[3]:=    Integrate[DiracDelta[Cos[x]],{x,\[Pi],2\[Pi]}]
>> Out[3]=  0
>> Any comments/insights/etc. pp.?
> Martin,
>The second result is certainly wrong! I have always been told to be very
>with expressions containing delta functions. As a result I would always
>an integral such as the one above by making the argument of the delta
>function the
>variableof integration. Therefore, making the substitution,
>   u = Cos[x]
>you would instead evaluate
> Integrate[Sqrt[1-u^2] DiracDelta[u],{u, Cos[Pi], Cos[2Pi]}]
>and this gives the correct result for all  limits of integration.
>    Bill

  • Prev by Date: Re: How Mathematica do Interpolation?
  • Next by Date: Re: Mechanical Systems Question
  • Previous by thread: RE: Re: Bug in Calculus`DiracDelta`
  • Next by thread: Simplify