ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Sat, 06 Jun 2020 08:16:37 +0200How to simplify dirac_delta?https://ask.sagemath.org/question/51779/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)`?mforbesSat, 06 Jun 2020 08:16:37 +0200https://ask.sagemath.org/question/51779/