1
$\begingroup$

I tried to run

  Integrate[   (E^(I q x))/(q - I), {q, -\[Infinity], \[Infinity]}, 
  Assumptions -> x \[Element] Reals]

I got something involving MeijerG function whereas the answer is really simple viz.

  E^-x (2 \[Pi] I) HeavisideTheta[x]
  
$\endgroup$
3
  • 2
    $\begingroup$ FWIW: FourierTransform gives you that result basically instantly: Sqrt[2 Pi] * FourierTransform[1/(q - I), q, x] $\endgroup$ Jun 28, 2023 at 8:04
  • $\begingroup$ I think F.T. is the way to go. But to get the x>0 part, you can do anti = Integrate[(E^(I q x))/(q - I), q]; hi = Limit[anti, q -> Infinity, Assumptions -> x > 0]; low = Limit[anti, q -> -Infinity, Assumptions -> x > 0]; anti = hi - low which gives 2 I Pi Exp[-x] but for x<0, it does not give zero. !Mathematica graphics F.T. does some magic internally. Maple 2023 gives !Mathematica graphics which match the result from F.T. $\endgroup$
    – Nasser
    Jun 28, 2023 at 8:17
  • 1
    $\begingroup$ There are many kinds of integrals in mathematics. FourierTransform[] computes a different class than Integrate[]. I'm not sure that the classes are well-defined in Mma, but DiracDelta[] and HeavisideTheta[] (at least as a distribution) are not possible answers in classical analysis. E.g. the classical integral $\int_{\Bbb R} Exp[i q x] \, dq$ diverges. Also, FourierTransform[] uses a different lookup table, and therefore it is more likely to be successful when you wish to compute Fourier transforms. This distinction in functionality should be kept in mind. $\endgroup$
    – Michael E2
    Jun 28, 2023 at 15:30

2 Answers 2

4
$\begingroup$

Try FourierTransform

 FourierTransform[1/(q - I), q, x] 
 (*2 I E^-x \[Pi] HeavisideTheta[x]*)
$\endgroup$
8
  • $\begingroup$ This means it is well within capabilities of Mathematica. Why does the integral form give a useless answer then? Something for the makers to fix. This is an extremely critical integral in all branches of physics and engineering. It is unacceptable that the integral gives a complicated answer. $\endgroup$ Jun 28, 2023 at 8:08
  • 2
    $\begingroup$ It is unacceptable that the integral gives a complicated answer Ok, this result was complicated, I agree. (but I assume it is correct, did not verify). But Mathematica still solves more integrals that any other CAS system out there. No software is perfect ! $\endgroup$
    – Nasser
    Jun 28, 2023 at 8:23
  • $\begingroup$ There are many even simpler examples where F.T. gives a result: ` FourierTransform[1 , q, x] (Sqrt[2 [Pi]] DiracDelta[x])` whereas Integrate[(E^(I q x)) , {q, -\[Infinity], \[Infinity]}, Assumptions -> x \[Element] Reals] doesn't evaluate $\endgroup$ Jun 28, 2023 at 8:28
  • $\begingroup$ @UlrichNeumann Arguably, though, that integral is not actually well-defined and shouldn't be returned as a result from Integrate. But for something straight-forward like the Fourier transform of 1/(1 + q^2) there is no excuse. $\endgroup$ Jun 28, 2023 at 8:34
  • $\begingroup$ @SjoerdSmit Here the "excuse": Mathematica 12.2 evaluates Integrate[(E^(I q x))/(1 + q^2) , {q, -\[Infinity], \[Infinity]}] (*ConditionalExpression[Pi/E^Abs[x], Element[x, Reals]]*) $\endgroup$ Jun 28, 2023 at 10:28
5
$\begingroup$

It also works by integrating real and imaginary parts separately:

Integrate[(q Cos[q x])/(1 + q^2) - Sin[q x]/(1 + q^2), {q, -\[Infinity], \[Infinity]},
  Assumptions -> x \[Element] Reals]
(* 0 *)

Integrate[(Cos[q x]/(1 + q^2) + (q Sin[q x])/(1 + q^2)), {q, -\[Infinity], \[Infinity]}, 
  Assumptions -> x \[Element] Reals]
(* E^-Abs[x] \[Pi] (1 + Sign[x]) *)
$\endgroup$
2
  • $\begingroup$ Similarly, Integrate[ComplexExpand[(E^(I q x))/(q - I)], {q, -∞, ∞}, Assumptions -> x > 0] returns 2 I E^-x π, and the same input with Assumptions -> x < 0 returns 0. But Assumptions -> x \[Element] Reals returns an ugly result. $\endgroup$ Jun 28, 2023 at 15:42
  • $\begingroup$ Is MeijerG result for both then? $\endgroup$ Jun 28, 2023 at 16:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.