Message Boards Message Boards

Get Integrate and Conjugate to work with Generalized Functions?

GROUPS:

These work:

In[363]:= Integrate[+I*DiracDelta[x], {x, -Infinity, +Infinity}]

Out[363]= I

In[364]:= Integrate[-I*DiracDelta[x], {x, -Infinity, +Infinity}]

Out[364]= -I

But Mathematica doesn't evaluate this:

In[367]:= Integrate[
 Conjugate[+I*DiracDelta[x]], {x, -Infinity, +Infinity}]

More generally, I need a function that does something like this:

testFunction2[signal_] := 
 Integrate[
  signal[x] + Conjugate[signal[x]], {x, -Infinity, +Infinity}]

But my naive implementation fails to evaluate this to zero:

In[366]:= testFunction2[(I*DiracDelta[#]) &]

Is there a way to implement this so that Mathematica will recognize that the conjugate of (the product of a complex-number and DiracDelta) equals the product of (the conjugate of the complex-number) and DiracDelta? This axiom is true in conventional theories of generalized functions, no?

POSTED BY: Joe Donaldson
Answer
2 months ago

I am not familiar with generalized functions. Have you reasons to believe that Integrate[Conjugate[signal[x]], {x, -Infinity, +Infinity}] may not be the same as Conjugate[Integrate[signal[x], {x, -Infinity, +Infinity}]]?

POSTED BY: Gianluca Gorni
Answer
2 months ago

I am not familiar with generalized functions

Mathematica includes a description (if you are curious):

http://reference.wolfram.com/language/tutorial/GeneralizedFunctionsAndRelatedObjects.html

One example of a generalized function is DiracDelta. On all non-zero arguments, the function's value is 0, but on an argument of 0 the function's value is infinite in a sense. A motivation for the theory is that when you integrate DiracDelta over (-Infinity,+Infinity), the result should be 1. Both replies in this other thread offer insight into Wolfram's implementation of generalized functions.

Have you reasons to believe that... may not be the same as...?

No, those two expressions should be equal, in my non-expert opinion. Regrettably, I made a mistake when formulating testFunction for the purpose of this thread. I originally wrote:

testFunction[signal_] := 
 Integrate[signal[x], {x, -Infinity, +Infinity}] + 
  Integrate[Conjugate[signal[x]], {x, -Infinity, +Infinity}]

and so that's what you responded to; but what I meant to write was:

testFunction2[signal_] := 
 Integrate[
  signal[x] + Conjugate[signal[x]], {x, -Infinity, +Infinity}]

Sorry about that. I've corrected the first post.

So while your proposed solution does solve my malformed question, it won't solve the problem with testFunction2, because in testFunction2, the Conjugate inside the Integrate can't be moved simply to outside the Integrate. (And combining the two terms into one by use of the function "Re" doesn't result in a successful evaluation.)

Moreover, in the application I'm developing, the integrand is formed automatically at run-time, so there's no opportunity for me to rearrange it manually. Any rearrangement needs to be programmatic, and I cannot know ahead of runtime how generalized functions and Conjugate will be combined inside the integrand. (In my actual application, I'm applying FourierTransform rather than Integrate, but I use Integrate for this question, since it's more popular, and the issue seems to be shared between Integrate and FourierTransform.)

POSTED BY: Joe Donaldson
Answer
2 months ago

With ungeneralized functions I would be tempted to write

testFunction2[signal_] := 
 2 Re[Integrate[signal[x], {x, -Infinity, +Infinity}]]
POSTED BY: Gianluca Gorni
Answer
2 months ago

I have tried to explain why I can't do that (but maybe I've been unclear):

in the application I'm developing, the integrand is formed automatically at run-time, so there's no opportunity for me to rearrange it manually. Any rearrangement needs to be programmatic, and I cannot know ahead of runtime how generalized functions and Conjugate will be combined inside the integrand.

At run-time, the integrand might end up being, for example,

I*DiracDelta[x]

In that case, the integral should not be real, so the "Re" outside the Integrate function would cause an error in the results.

POSTED BY: Joe Donaldson
Answer
2 months ago

Is there a way to implement this so that Mathematica will recognize that the conjugate of (the product of a complex-number and DiracDelta) equals the product of (the conjugate of the complex-number) and DiracDelta? This axiom is true in conventional theories of generalized functions, no?

This may solve my problem by augmenting Wolfram's implementation of Conjugate, but I have barely tested it yet:

conjugate[DiracDelta[x_]] := DiracDelta[x]

conjugate[x_ + y_] := conjugate[x] + conjugate[y]

conjugate[x_*y_] := conjugate[x]*conjugate[y]

conjugate[x_] := Conjugate[x]

I will see if I can modify my program so that "Conjugate" no longer shows up inside the integrand, and "conjugate" takes it place(s) instead.

Very preliminary testing looks good:

In[5]:= Integrate[
 conjugate[+I*DiracDelta[x]], {x, -Infinity, +Infinity}]

Out[5]= -I

In[8]:= testFunction3[signal_] := 
 Integrate[signal[x] + conjugate[signal[x]], {x, -Infinity, +Infinity}]

In[9]:= testFunction3[(I*DiracDelta[#]) &]

Out[9]= 0
POSTED BY: Joe Donaldson
Answer
2 months ago

Group Abstract Group Abstract