2
$\begingroup$

I need to perform this integration as a contour integral over the lower half of the complex omega plane with Mathematica.

$$\int_{-\infty }^{\infty } \frac{e^{-i \left(\omega -\omega _0\right) (t-\tau )}}{\lambda ^2+\left(\omega _0-\omega \right){}^2} \, d\omega$$

I am new to Mathematica and have no idea on how to proceed.

$\endgroup$
7
  • 2
    $\begingroup$ Welcome to Mathematica SE! This site is generally not a tutorial site. If you are just learning Mathematica, I recommend following some online tutorials. The Mathematica documentation is very good, so you can also jump right in by looking up Integrate in the documentation. In there, you will see many examples of proper syntax, and there should be examples doing contour integration as well. Alternatively, you can look up Residue in order to compute the integral using direct residue integration rather than computing the contour. $\endgroup$ Commented Jul 26, 2024 at 21:47
  • 2
    $\begingroup$ Mathematica "knows" how to compute this integral without the need of integration over the complex plane. Just type ` Integrate[Exp[-Iωt]/(λ^2+ω^2),{ω,-∞,∞}, Assumptions -> Element[λ|t,Reals]]` and you will get the correct result. Complex path integration is needed if you would like to compute the integral "by hands". If you want to learn this technique, you have to attend a course in complex analysis or read a textbook. It does not bring much to learn it from some online resources. $\endgroup$ Commented Jul 26, 2024 at 21:55
  • 1
    $\begingroup$ @yarchik: The general case is not so simple. Integrate[ Exp[-I*(\[Omega] - \[Omega]0)* t]/(\[Lambda]^2 + (\[Omega] - \[Omega]0)^2), {\[Omega], -Infinity, Infinity}, Assumptions -> t \[Element] Reals && \[Omega]0 \[Element] Reals && \[Lambda] > 0] results in a long analytic expression in terms of SinIntegral ans CosIntegral. $\endgroup$ Commented Jul 27, 2024 at 5:03
  • 1
    $\begingroup$ @user64494 Yes, you are right. Every time I see such questions, I do not know what to do. On one side I am tempted to provide quick and relevant answer that may be expected in some contexts. People want such quick and easy solutions. But it is much more important to advise that one does not learn math from a forum. One learns by attending a course or by reading a book. Therefore, I believe such questions are out of scope of this site and should be closed. $\endgroup$ Commented Jul 27, 2024 at 8:41
  • 1
    $\begingroup$ @yarchik: The contour integration in the case under consideration may be useful for didactic purpose. $\endgroup$ Commented Jul 27, 2024 at 9:02

3 Answers 3

2
$\begingroup$

Computing integral NOT using Contour integration.

Using InverseFourierTransform we can get a simple solution:

ComplexExpand[FullSimplify[Sqrt[2 Pi] E^(I t \[Omega]0)* InverseFourierTransform[1/(\[Lambda]^2 + (\[Omega]0 - \[Omega])^2), \[Omega], t, Assumptions -> t \[Element] Reals && \[Omega]0 \[Element] Reals], Assumptions -> t \[Element] Reals && \[Omega]0 \[Element] Reals] // Expand] (*(E^(t \[Lambda]) \[Pi] Sign[\[Lambda]] UnitStep[-t Sign[ Re[\[Lambda]]]])/\[Lambda] + ( E^(-t \[Lambda]) \[Pi] Sign[\[Lambda]] UnitStep[ t Sign[Re[\[Lambda]]]])/\[Lambda]*) 

$$\int_{-\infty }^{\infty } \frac{\exp (-i (\omega -\text{$\omega $0}) t)}{\lambda ^2+(\text{$\omega $0}-\omega )^2} \, d\omega =\frac{e^{t \lambda } \pi \text{sgn}(\lambda ) \theta (-t \text{sgn}(\Re(\lambda )))}{\lambda }+\frac{e^{-t \lambda } \pi \text{sgn}(\lambda ) \theta (t \text{sgn}(\Re(\lambda )))}{\lambda }$$

where: $t=t-\tau$

Check:

F1[\[Omega]0_, \[Lambda]_, t_] := (E^(t \[Lambda]) \[Pi] Sign[\[Lambda]] UnitStep[-t Sign[ Re[\[Lambda]]]])/\[Lambda] + ( E^(-t \[Lambda]) \[Pi] Sign[\[Lambda]] UnitStep[ t Sign[Re[\[Lambda]]]])/\[Lambda]; G1[\[Omega]0_, \[Lambda]_, t_] := NIntegrate[ Exp[-I*(\[Omega] - \[Omega]0)* t]/(\[Lambda]^2 + (\[Omega] - \[Omega]0)^2), {\[Omega], \ -Infinity, Infinity}, WorkingPrecision -> 20]; par = SetPrecision[RandomReal[{-2, 2}, 100], 21]; Chop[Table[{F1[par[[n]], par[[n]], par[[n]]] - G1[par[[n]], par[[n]], par[[n]]]}, {n, 1, Length[par]}]] // Flatten // Quiet (*0,0,.....0 *) (*Solution is correct. *) 
$\endgroup$
1
  • $\begingroup$ The title of the question is "Contour integration over lower half of complex plane". You find the integral under consideration without any contour integration or residues. Also the question arises: how does InverseFourierTransform[1/(\[Lambda]^2 + (\[Omega]0 - \[Omega])^2), \[Omega], t, Assumptions -> t \[Element] Reals && \[Omega]0 \[Element] Reals], Assumptions -> t \[Element] Reals && \[Omega]0 \[Element] Reals] work? $\endgroup$ Commented Jul 27, 2024 at 9:00
1
$\begingroup$

It is not so simple because of many parameters (which are assumed real). Unfortunately,

ContourIntegrate[ Exp[-I*(\[Omega] - \[Omega]0)* t]/(\[Lambda]^2 + (\[Omega] - \[Omega]0)^2), \[Omega] \[Element] HalfPlane[{{0, 0}, {1, 0}}, {0, -1}], Assumptions -> t \[Element] Reals && \[Omega]0 \[Element] Reals && R > 0 && \[Lambda] > 0] 

returns the input. In view of it we consider

j = -ContourIntegrate[Exp[-I*(\[Omega] - \[Omega]0)* t]/(\[Lambda]^2 + (\[Omega] - \[Omega]0)^2), \[Omega] \[Element] Disk[{0, 0}, R, {Pi, 2*Pi}], Assumptions -> t \[Element] Reals && \[Omega]0 \[Element] Reals && R > 0 && \[Lambda] > 0] 

ConditionalExpression[-Piecewise[{{((-1 + E^(2*t*\[Lambda]))*Pi)/(E^(t*\[Lambda])*\[Lambda]), Abs[\[Lambda] + I*\[Omega]0]/R < 1 && Arg[(-I)*\[Lambda] + \[Omega]0] < 0 && Abs[\[Lambda] - I*\[Omega]0]/R < 1 && Arg[I*\[Lambda] + \[Omega]0] < 0}, {-(Pi/(E^(t*\[Lambda])*\[Lambda])), Abs[\[Lambda] + I*\[Omega]0]/R < 1 && Arg[(-I)*\[Lambda] + \[Omega]0] < 0}, {(E^(t*\[Lambda])*Pi)/\[Lambda], Abs[\[Lambda] - I*\[Omega]0]/R < 1 && Arg[I*\[Lambda] + \[Omega]0] < 0}}, 0], (R != Abs[\[Lambda] - I*\[Omega]0] || Arg[I*\[Lambda] + \[Omega]0] >= 0) && (R != Abs[\[Lambda] + I*\[Omega]0] || Arg[(-I)*\[Lambda] + \[Omega]0] >= 0) && !((Abs[\[Lambda] - I*\[Omega]0]/R <= 1 && (Arg[I*\[Lambda] + \[Omega]0] == Pi || Arg[I*\[Lambda] + \[Omega]0] == 0)) || (Abs[\[Lambda] + I*\[Omega]0]/R <= 1 && (Arg[(-I)*\[Lambda] + \[Omega]0] == Pi || Arg[I*\[Lambda] + \[Omega]0] == 0)))]

We may assume Abs[\[Lambda] + I*\[Omega]0]/R < 1 because R will tend to infinity:

j = -ContourIntegrate[Exp[-I*(\[Omega] - \[Omega]0)* t]/(\[Lambda]^2 + (\[Omega] - \[Omega]0)^2), \[Omega] \[Element] Disk[{0, 0}, R, {Pi, 2*Pi}], Assumptions -> t \[Element] Reals && \[Omega]0 \[Element] Reals && R > 0 && \[Lambda] > 0 && Abs[\[Lambda] + I*\[Omega]0]/R < 1] 

ConditionalExpression[-Piecewise[{{((-1 + E^(2*t*\[Lambda]))*Pi)/(E^(t*\[Lambda])*\[Lambda]), Arg[(-I)*\[Lambda] + \[Omega]0] < 0 && Abs[\[Lambda] - I*\[Omega]0]/R < 1 && Arg[I*\[Lambda] + \[Omega]0] < 0}, {-(Pi/(E^(t*\[Lambda])*\[Lambda])), Arg[(-I)*\[Lambda] + \[Omega]0] < 0}, {(E^(t*\[Lambda])*Pi)/\[Lambda], Abs[\[Lambda] - I*\[Omega]0]/R < 1 && Arg[I*\[Lambda] + \[Omega]0] < 0}}, 0], (R != Abs[\[Lambda] - I*\[Omega]0] || Arg[I*\[Lambda] + \[Omega]0] >= 0) && Arg[(-I)*\[Lambda] + \[Omega]0] != Pi && Arg[I*\[Lambda] + \[Omega]0] != 0 && (Arg[I*\[Lambda] + \[Omega]0] != Pi || Abs[\[Lambda] - I*\[Omega]0]/R > 1)]

Now

FullSimplify[j, Assumptions -> Abs[\[Lambda] - I*\[Omega]0]/R < 1] 

-ConditionalExpression[Piecewise[ {{(2*Pi*Sinh[t*\[Lambda]])/\[Lambda], Arg[(-I)*\[Lambda] + \[Omega]0] < 0 && Arg[I*\[Lambda] + \[Omega]0] < 0}, {-(Pi/(E^(t*\[Lambda])*\[Lambda])), Arg[(-I)*\[Lambda] + \[Omega]0] < 0}, {(E^(t*\[Lambda])*Pi)/\[Lambda], Arg[I*\[Lambda] + \[Omega]0] < 0}}, 0], Arg[(-I)*\[Lambda] + \[Omega]0] != Pi && Arg[I*\[Lambda] + \[Omega]0] != 0 && Arg[I*\[Lambda] + \[Omega]0] != Pi]

and, tending R to infinity,

Limit[%, R -> Infinity] 

ConditionalExpression[-Piecewise[ {{(2*Pi*Sinh[t*\[Lambda]])/\[Lambda], Arg[(-I)*\[Lambda] + \[Omega]0] < 0 && Arg[I*\[Lambda] + \[Omega]0] < 0}, {-(Pi/(E^(t*\[Lambda])*\[Lambda])), Arg[(-I)*\[Lambda] + \[Omega]0] < 0}, {(E^(t*\[Lambda])*Pi)/\[Lambda], Arg[I*\[Lambda] + \[Omega]0] < 0}}, 0], Arg[(-I)*\[Lambda] + \[Omega]0] != Pi && Arg[I*\[Lambda] + \[Omega]0] != 0 && Arg[I*\[Lambda] + \[Omega]0] != Pi]

We can get rid of Arg[-I \[Lambda] + \[Omega]0] != \[Pi] && Arg[I \[Lambda] + \[Omega]0] != 0 && Arg[I \[Lambda] + \[Omega]0] != \[Pi].

Edit. The minus sign is added since the boundary of the lower half-disk is oriented counterclockwise.

Edi 2. A typo - instead of = in the last ConditionalExpression in the answer.

$\endgroup$
9
  • $\begingroup$ Just to compare with Integrate[ Exp[-I*(\[Omega] - \[Omega]0)* t]/(\[Lambda]^2 + (\[Omega] - \[Omega]0)^2), {\[Omega], -Infinity, Infinity}, Assumptions -> t \[Element] Reals && \[Omega]0 \[Element] Reals && \[Lambda] > 0] which outputs a long analytic expression in terms of SinIntegral ans CosIntegral. $\endgroup$ Commented Jul 27, 2024 at 4:53
  • $\begingroup$ As you know, I have a problem with this kind of questions here. These searches for quick and easy answers never work and lead to further confusions of unexperienced pupils or students. Future visitors to this forum will not be able to learn about the MA techniques from this questions unless there are some good and pedagogical answers. Unfortunately, your answer is messy and not quite pedagogical because it does not explain why certain transformations are done. $\endgroup$ Commented Jul 28, 2024 at 14:52
  • $\begingroup$ @yarchik: Can you kindly elaborate "certain transformations", giving us details? I follow a usual approach of complex analysis, integrating over Disk[{0, 0}, R, {Pi, 2*Pi}]. $\endgroup$ Commented Jul 28, 2024 at 15:05
  • 1
    $\begingroup$ I am not questioning what you are doing. I am concerned that the OP might not even know that the result does not depend on the choice of contour if the function is analytic. Because if they knew, they would be able to find the function poles and residues and/or ask more precise question. Thus, if you would like to be pedagogic, it would be good to briefly explain the relation between the integral over real axis and the contour integral (j in your notations). Moreover, the half-circle integral will only converge if $t-\tau>0$, you only assume the difference is real. $\endgroup$ Commented Jul 28, 2024 at 15:46
  • 1
    $\begingroup$ In this case the correct result is (E^2 \[Pi])/2 + ( E^(-t \[Lambda]) (-1 + E^( 2 t \[Lambda])) \[Pi])/\[Lambda] /. {t -> -1, \[Lambda] -> 2, \[Omega]0 -> 1} ao we deal with a bug in ContourIntegrate for t < 0. $\endgroup$ Commented Jul 28, 2024 at 19:51
1
$\begingroup$

If my old math skills don't deceive me the contourintegration over the lower half plane of complex omega is evaluted using Residue theorem:

enter image description here

For real \[Lambda]>0,\[Omega]0 only one singularity \[Omega]0 - \[Lambda] I is enclosed by the contour covering the complex half plane

resi=Residue[Exp[-I (\[Omega] - \[Omega]0) t]/(\[Lambda]^2 + (\[Omega] - \ \[Omega]0)^2), {\[Omega], \[Omega]0 - \[Lambda] I}] (*(I E^(-t \[Lambda]))/(2 \[Lambda])*) 

Contourintegral follows to

2Pi I resi (*-((E^(-t \[Lambda]) \[Pi])/\[Lambda])*) 
$\endgroup$
15
  • $\begingroup$ Something to adjust. -((E^(-t \[Lambda]) \[Pi])/\[Lambda]/.-((E^(-t \[Lambda]) \[Pi])/\[Lambda] results in -(\[Pi]/(2 E^2)), where as $\endgroup$ Commented Jul 28, 2024 at 9:52
  • $\begingroup$ ConditionalExpression[-Piecewise[{{(2*Pi*Sinh[t*\[Lambda]])/\[Lambda], Arg[(-I)*\[Lambda] + \[Omega]0] < 0 && Arg[I*\[Lambda] + \[Omega]0] < 0}, {-(Pi/(E^(t*\[Lambda])*\[Lambda])), Arg[(-I)*\[Lambda] + \[Omega]0] < 0}, {(E^(t*\[Lambda])*Pi)/\[Lambda], Arg[I*\[Lambda] + \[Omega]0] < 0}}, 0], Arg[(-I)*\[Lambda] + \[Omega]0] != Pi && Arg[I*\[Lambda] + \[Omega]0] != 0 && Arg[I*\[Lambda] + \[Omega]0] != Pi] /. {t -> 1, \[Lambda] -> 2, \[Omega]0 -> Pi/4} and $\endgroup$ Commented Jul 28, 2024 at 9:52
  • $\begingroup$ (E^(t \[Lambda]) \[Pi] Sign[\[Lambda]] UnitStep[-t Sign[ Re[\[Lambda]]]])/\[Lambda] + (E^(-t \[Lambda]) \[Pi] Sign[\ \[Lambda]] UnitStep[t Sign[Re[\[Lambda]]]])/\[Lambda] /. {t -> 1, \[Lambda] -> 2} produce \[Pi]/(2 E^2). $\endgroup$ Commented Jul 28, 2024 at 9:54
  • $\begingroup$ What contour $\gamma$ do you mean in your answer? $\endgroup$ Commented Jul 28, 2024 at 9:59
  • $\begingroup$ contour γ is quite arbitrary, should only enclose the residuum \[Omega]0 - \[Lambda] I $\endgroup$ Commented Jul 28, 2024 at 13:42

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.