# Revision history [back]

### How to simplify dirac_delta?

Various manipulations are possible with dirac_delta and its derivatives. How can I teach sage to simplify these? For example, the following Green's function for a free particle in 1D could simplify to simply dirac_delta(x):

sage: %var x, k
sage: G = heaviside(x)*sin(k*x)/k
sage: simplify(k**2*G + diff(G, x, x))
2*cos(k*x)*dirac_delta(x) + sin(k*x)*diff(dirac_delta(x), x)/k


How can I teach sage to perform the following simplifications

f(x)*dirac_delta(x)
-> f(0)*dirac_delta(x)
f(x)*diff(dirac_delta(x),x)
-> diff(f(x), x)*dirac_delta(x)
-> diff(f(x), x).subs(x=0)*dirac_delta(x)


which would bring the answer into the desired form dirac_delta(x)?

### How to simplify dirac_delta?

Various manipulations are possible with dirac_delta and its derivatives. How can I teach sage to simplify these? For example, the following Green's function for a free particle in 1D could simplify to simply dirac_delta(x):

sage: %var x, k
var('x,k')
sage: G = heaviside(x)*sin(k*x)/k
sage: simplify(k**2*G + diff(G, x, x))
2*cos(k*x)*dirac_delta(x) + sin(k*x)*diff(dirac_delta(x), x)/k


How can I teach sage to perform the following simplifications

f(x)*dirac_delta(x)
-> f(0)*dirac_delta(x)
f(x)*diff(dirac_delta(x),x)
-> diff(f(x), x)*dirac_delta(x)
-> diff(f(x), x).subs(x=0)*dirac_delta(x)


which would bring the answer into the desired form dirac_delta(x)?