kill(all)$

nth power derivative for dirac-delta function from g(x) under integral sign
which contains all real roots,(integral:-∞ to +∞),version 1.0
peter.vlasschaert@gmail.com,06/03/2020

ref : code 'maple': Prof Dr Denis Constales.(UGent)
=====================================

maple : input.
----------------

(int(Dirac(2, t^2 - 49), t = -10 .. infinity) assuming (0 < a));
                               3  
                             -----
                             67228

Prof .Dr. Denis Constales:code
=======================
diff(Dirac(t), t);
                          Dirac(1, t)
dirn := proc(f, n, g, x, x0l) local w, i, x0; w := f/diff(g, x); for i to n do w := diff(w, x)/diff(g, x)
; end do; add(subs(x = x0, csgn(diff(g, x))*(-1)^n*w), x0 = x0l); end proc;
=====================
eval(dirn(1, 2, t^2 - 49, t, [-7, 7]));
                               3  
                             -----
                             67228

symbolic representation of the problem
============================
n=nth order derivative dirac delta from g(x)

q1:'integrate(f(x)*delta(g(x),n),x,-∞,∞);

list representation of q1
----------------------------

q1a:args(q1);

rem : delta(g(x),n) = nth power derivative of dirac- delta function from g(x)
rem : real space.(-∞,∞)

how to use : f       => function : f(x)                        ,(example :f=1)
                   g      => function :g(x),function we take nth power derivative dirac-delta function.
                   x      => variable                                ,(example : t)      
                   n      =>{0,1,2,..,n},derivative              ,(example : n =2)
                   x0l    => list of  real null points of g(x)  ,(example : g:t^2-49, x0l =[-7,7])    

example : below.

dirn(f,n,g,x,x0l):=block([w,i,m],
w:f/diff(g,x),
for  i:1 thru n do(
w:diff(w,x)/diff(g,x)),
s:0, /*init value of the sum */
m:length(x0l),
for i:1 thru m do(
    s:s+subst([x=x0l[i]],signum(diff(g,x))*(-1)^n*w)),
return(s));

ref : local ,see maple code.
---------------------------------

[w,i,m];

 better representation. (= code)
=======================

grind(dirn);

explain : signum ( = sign when g(x) cross x-axis ,d/dx(g(x)) =slope)
             (-1)^n   (= sign of nth partial integration)

 first order derivative (n=1)
====================

q2:'integrate(f(x)*delta(g(x),1),x,-∞,∞) =(-1)^(1)* at(diff(f(x),x),x=0);

example :
=======

symbolic representation problem
========================
second order derivative (n=2)
======================

q3:'integrate(1*delta(t^2-49,2),t,-7-ε,7+ε);

ε = very small value

computation:(= q3)
==============

dirn(1,2,t^2-49,t,[-7,7]);

how to find real null points of g(x)
========================
set: x=t

first method :
=========

p1:allroots(t^2-49);

p1a:makelist(rhs(p1[i]),i,1,length(p1));

second method
===========

p2:realroots(t^2-49);

p2a:makelist(rhs(p2[i]),i,1,length(p2));

result :p1a,p2a,list  : x0l, see above : 'example'
appendix : extra:*.txt for explain the code.'dirn'

 =================================