# Simplifying polynomial fractions with same DiracDelta function in both denominator and numerator

I am trying to simplify an expression with multiple Diracdelta functions in both numerator and denominator. For example,

expr = (x1 DiracDelta[ω0 + ω]+x2 DiracDelta[ω0 + ω])/
(x3 DiracDelta[ω0 + ω] - x4 DiracDelta[ω0 + ω]) // FullSimplify


However, DiracDelta[ω0 + ω] does not cancel out during the simplification. I have already read answers to this, this, and this questions, and I understand that this is due to the definition of DiracDelta[ω0 + ω].

This is my approach:

expr /.{DiracDelta[ω0 + ω]->X}// FullSimplify


It works, however, not very convenient for complicated expressions with multiple DiracDelta at different values.

Is there any better approach to cancel out same DiracDelta functions both denominator and numerator?

• There are problems with multiplication of distributions (see the Problem of multiplication section in en.wikipedia.org/wiki/Distribution_(mathematics) ). Division is multiplication by inverse distribution. – user64494 Jan 10 '20 at 14:20
• Got it. But here, I just want to use Mathematica to analyse an electrical circuit and I want similar terms to be cancelled out. – Pojj Jan 10 '20 at 14:26
• It is impossible to simplify an indeterminate expression. Here is a simpler example FullSimplify[1/Gamma[n - 1]/Gamma[n], Assumptions -> n \ [Element] Integers] . The expression in your question is indeterminate because the supports of the numerator and denominator are the same. Hope I am clear. – user64494 Jan 10 '20 at 16:12
• Here is a similar command to yours FullSimplify[(2*0 - 0)/(5*0 - 3*0)] which is answered Indeterminate. – user64494 Jan 11 '20 at 11:33
• Use //Factor instead of //FullSimplify – Bill Watts Feb 7 '20 at 8:20

Use //Factor instead of //FullSimplify

• All that is built on the sand because the expression under simplification is indeterminate. You demonstrate rather a weakness of Mathematica than its capacities. – user64494 Feb 7 '20 at 11:10
• The Factor command is so powerful: even Factor[(3*"0" - "0")/(2*"0" - "0")] performs 2. – user64494 Feb 7 '20 at 13:51

Try this:

expr = (x1 DiracDelta[ω0 + ω] + x2 DiracDelta[ω0 + ω])/(x3 DiracDelta[ω0 + \
ω] - x4 DiracDelta[ω0 + ω]) // Cancel

(* (x1 + x2)/(x3 - x4)  *)


Have fun!

• All that is built on the sand because the expression under simplification is indeterminate. You demonstrate rather a weakness of Mathematica than its capacities. – user64494 Feb 7 '20 at 11:09
• @user64494 No. One should understand delta-function as a limit of a bell-shaped function. In that case one makes simplification and passes to the limit. – Alexei Boulbitch Feb 7 '20 at 11:55
• This is the limit in the weak topology (see encyclopediaofmath.org/index.php/Generalized_function for info). Mathematica does not deal with such limits. – user64494 Feb 7 '20 at 12:48
• @AlexeiBoulbitch, Thanks, this also works! I accepted the other answer because he first put it as a comment. – Pojj Feb 7 '20 at 12:58
• The Cancel command is so powerful: even Cancel[(3*"0" - "0")/(2*"0" - "0")] performs 2. – user64494 Feb 7 '20 at 13:52