IF I correctly understand the code
> integrate(f(x) * pwdelta(x-a, n), x); > sum((-1)^k*binomial(n,k)*at(diff(f(x),x,k),x=a) * pwdelta(x-a,n-k-1),k,0,n)
I think that it is not entirely correct.
Given the space D of indefinitely continuously differentiable functionswith bounded support, the Dirac delta is a functional from D to R, the space of real numbers.
For all phi in D with support including x=0, the Dirac delta can be represented by the set of formal integrals
int_R phi(x) delta(x) dx = phi(0).
Using formal integration by parts the derivative delta' can be defined as
int_R phi(x) delta'(x) dx = - int_R phi'(x) delta(x) dx = - phi'(0),
and by repeating the operation n times:
int_R phi(x) delta^(n) (x) dx = (-1)^n \phi^(n) (0). (*)
OK. As long as the function f is such that the product f phi remains in D (thus the Heavisidefunction H(x) := 1 if x >0 else 0, is excluded; a fortiori 1/x) then
int_R phi(x) f(x) delta^(n) (x) dx = (-1)^n [(d/dx)^n (f phi)]_{x=0}
and by the Leibniz rule
(d/dx)^n (f phi) = sum_{k=0}^n C(n,k) f^(k) phi^{n-k},
where C(n,k) is the binomial coefficient.
Thus, splitting the factor (-1)^n,
int_R phi(x) f(x) delta^(n) (x) dx =
sum_{k=0}^n C(n,k) (-1)^k f^(k)(0) (-1)^{n-k) phi^{n-k}(0),
or, returning to integrals using (*) above
= int_R phi(x) [sum_{k=0}^n C(n,k) (-1)^k f^(k)(0) delta^{n-k}(x)] dx,
which shows that as generalised function
f(x) delta^(n) (x) = sum_{k=0}^n C(n,k) (-1)^k f^(k)(0) delta^{n-k}(x).
Thus the code above AS I understand it should be:
> integrate(f(x) * pwdelta(x-a, n), x); > sum((-1)^k*binomial(n,k)*at(diff(f(x),x,k),x=a) * pwdelta(x-a,n-k),k,0,n)
For n=0 this formula is trivial: f(x) delta(x) = f(0) delta(x)
The next non trivial case states
f(x) delta'(x) = f(0) delta'(x) - f'(0) delta(x).
To check directly a formula assumed valid for such generalised functionsjust follow the fundamental rule. On the left side:
\int_R phi(x) f(x) delta'(x) dx =
- (d/dx)(phi f)_{x=0} = -phi'(0)f(0) - phi(0) f'(0),
On the right side:
f(0) \int_R phi(x) delta'(x) dx = f(0) [-\phi'(0)]
and
- f'(0) \int_R phi(x) delta(x) dx = - f'(0) phi(0).
All problems with Dirac delta and other generalised functionsarising for instance from singular integrals is that one takeunwarranted short cuts.
Reference: Gel'fand I.M. & Shilov G. E.Generalized Functions, Vol. I: Properties and Operations,Academic Press: 1964.
(Note to the list manager:I tried as much as possible to format the reply to makeit more or less legible only using "plain text" for theemails (avoiding "rich text" --- or GmailLaTeX !) but for some reason which escapes me even this formatting, using line returns and blank lines for legibility, is completely removed from the reply as in comes back to me in maxima digests.
My apologies if that is delivered that way but I seem tohave no control whatever on the format.)
Rene' Grognard
> ------------------------------> Message: 7
> Date: Wed, 17 Jul 2013 17:03:53 -0400
> From: "Richard Hennessy" <rich.hennessy at verizon.net>
> Subject: Re: [Maxima] pw.mac problem
> Hi List,
>
> Someone pointed out that there is an error in pw.mac, for integration of delta functions and their derivatives.
>
> Currently,
>
> integrate(f(x)*diff_pwdelta(m, x-a), x);
> gives the wrong answer.
>
> This person says it should be.
>
> integrate(f(x) * pwdelta(x-a, n), x);
> sum((-1)^k*binomial(n,k)*at(diff(f(x),x,k),x=a) * pwdelta(x-a,n-k-1),k,0,n)
>
> where the two argument form of pwdelta(x,n) = diff_pwdelta(n,x) and pwdelta(x,0) = pwdelta(x) and pwdelta(x,-1)=unit_step(x).