I would like to plot the following integral but it gives undefined. Please kindly help me about solving the following integral to plot :

$$ I(t)=\int_{\sqrt{a}}^{\infty}{ e^{-t^2+\beta t} \sin(\beta t)}~\mathrm{d}t $$

where $a>0$, $\beta>0$. Thanks!

  • $\begingroup$ What are the parameters? What is a and $\beta$? If it's undefined in your task, then the integral does not converge. There is nothing you can do in that case. $\endgroup$ Nov 25, 2015 at 20:44
  • $\begingroup$ @DenisDüsseldorf : Thanks I just edited. $\endgroup$
    – Wita
    Nov 25, 2015 at 20:46

2 Answers 2


Possible solution:

Start by completing the square in the exponential part:

$$-t^2 + \beta t = -\left(t - \frac{\beta}{2}\right)^2 + \frac{\beta^2}{4}$$

So you have for the moment:

$$I(t) = \int_{\sqrt{\alpha}}^{+\infty} e^{-\left(t - \frac{\beta}{2}\right)^2 + \frac{\beta}{4}} \sin(\beta t)\ \text{d}t$$

Now operate the shift

$$t - \frac{\beta}{2} = y$$ so that $\text{d}y = \text{d}t$ and check the extrema of the integral. Taking out the exponential that does not depends upon $t$ and for the moment you got:

$$I(t) = e^{\frac{\beta^2}{4}}\ \int_{\sqrt{\alpha} - \frac{\beta}{2}}^{+\infty} e^{-y^2}\sin\left(\beta y - \frac{\beta^2}{2}\right)\ \text{d}y$$

At this point for the integration in $\text{d}y$ just use the exponential Sine form:

$$\sin\left(\beta y - \frac{\beta^2}{2}\right) \equiv \frac{e^{i\left(\beta y - \frac{\beta^2}{2}\right)} - e^{i\left(\beta y - \frac{\beta^2}{2}\right)}}{2i}$$

You obtain then:

$$I(t) = e^{\frac{\beta^2}{4}}\int_{\sqrt{\alpha}-\frac{\beta}{2}}^{+\infty} e^{-y^2}\left(\dfrac{e^{i\beta y - i\frac{\beta^2}{2}} - e^{-i\beta y + i\frac{\beta^2}{2}}}{2i}\right) \text{d} y$$

Now just take off to the integral those exponential in $\beta$ without any dependence upon $y$ and re-arrange the remaining terms. You will obtain:

(Split the two integrals)

$$I(t) = \dfrac{1}{2i}e^{\frac{\beta^2}{4}}e^{-i\frac{\beta^2}{2}}\int_{\sqrt{\alpha}-\frac{\beta}{2}}^{+\infty} e^{-y(y - i\beta)}\text{d} y - \dfrac{1}{2i}e^{\frac{\beta^2}{4}}e^{i\frac{\beta^2}{2}}\int_{\sqrt{\alpha}-\frac{\beta}{2}}^{+\infty} e^{-y(y + i\beta)}\text{d}y $$

To calculate them, we have another time to use the trick of the square completing: In the first integral we have:

$$-y^2 + i\beta y \equiv -\left(y - \frac{i\beta}{2}\right)^2 - \frac{\beta^2}{4}$$

and in the second one we have:

$$-y^2 - i\beta y \equiv -\left(y + \frac{i\beta}{2}\right)^2 - \frac{\beta^2}{4}$$

Use them, substitute and take out the independent part of the exponential and you will get:

$$I(t) = \dfrac{1}{2i}e^{\frac{\beta^2}{4}}e^{-\frac{\beta^2}{4}}\left[e^{-\frac{i\beta^2}{2}}\int_{\sqrt{\alpha}-\frac{\beta}{2}}^{+\infty}e^{-\left(y - \frac{i\beta}{2}\right)^2}\text{d}y - e^{\frac{i\beta^2}{2}}\int_{\sqrt{\alpha}-\frac{\beta}{2}}^{+\infty}e^{-\left(y + \frac{i\beta}{2}\right)^2}\text{d}y \right]$$

Now, if you are familiar with Special Functions you may know this fundamental special integral function:

$$\int_{a}^{+\infty} e^{-(x\pm b)^2}\text{d}x = \frac{\sqrt{\pi}}{2}\text{Erfc}[a \pm b]$$

Using this relation and you will easily integrate the two terms above, obtaining in the end:

$$ \boxed{I(t) = \dfrac{1}{2i}\left[e^{-\frac{i\beta^2}{2}} \dfrac{\sqrt{\pi}}{2}\text{Erfc}\left(\sqrt{\alpha} - \dfrac{\beta}{2} + i\dfrac{\beta}{2}\right) - e^{\frac{i\beta^2}{2}} \dfrac{\sqrt{\pi}}{2}\text{Erfc}\left(\sqrt{\alpha} - \dfrac{\beta}{2} - i\dfrac{\beta}{2}\right)\right]} $$

Honestly, this result is clearly correct, modulo some signs errors or constants missed. Check the whole procedure please, because it is the way to come to the result, but in the very last passages there could be some missing constants.

  • 2
    $\begingroup$ I get $\frac{1}{4} i \sqrt{\pi } e^{-\frac{i \beta ^2}{2}} \left(\text{erfc}\left(\sqrt{a}-\left(\frac{1}{2}-\frac{i}{2}\right) \beta \right)-e^{i \beta ^2} \text{erfc}\left(\sqrt{a}-\left(\frac{1}{2}+\frac{i}{2}\right) \beta \right)\right)$. $\endgroup$ Nov 25, 2015 at 21:42
  • $\begingroup$ Yes, I tried with Mathematica and the result is the same of what you got. However, I don't see any mistake in my reasoning. For the moment at least.. $\endgroup$
    – Laplacian
    Nov 25, 2015 at 21:48
  • 2
    $\begingroup$ Your error must be between the integral and your final solution because Mathematica integrates your intermediate solution (integral over $y$) and yields the answer we both obtained. Try showing some intermediate steps in the Feynman trick and perhaps the error will be revealed. $\endgroup$ Nov 25, 2015 at 21:52
  • $\begingroup$ I wil check it later, thanks for the note!! >.< Hope the guy will check these comments too! $\endgroup$
    – Laplacian
    Nov 25, 2015 at 22:03
  • 1
    $\begingroup$ @2che That is a very interesting question. I'll think about it!! $\endgroup$
    – Laplacian
    Nov 27, 2015 at 18:27

Explaining David G. Stork's result, $$ \begin{aligned} I &=\int_{\sqrt a}^\infty e^{-t^2+\beta t} \sin(\beta t) \, dt \\ &= \Im \, \int_{\sqrt a}^\infty e^{-t^2+\beta t + i\beta t} \, dt \\ &= \Im \left[ e^{(\beta + i\beta)^2/4} \int_{\sqrt a - \beta(1+i)/2}^\infty e^{-u^2} \, du \right] \\ &= \Im \left[ \frac{\sqrt\pi}{2} \, e^{i\beta^2/2} \, \mathrm{erfc}\left(\sqrt a - \frac{\beta(1+i)}{2}\right) \right] \\ &= \frac{\sqrt\pi}{4i} \left[ e^{i\beta^2/2} \, \mathrm{erfc}\left(\sqrt a - \frac{\beta(1+i)}{2}\right) - e^{-i\beta^2/2} \, \mathrm{erfc}\left(\sqrt a - \frac{\beta(1-i)}{2}\right) \right]. \end{aligned} $$

Edit. It appears to be hard to get rid of the complex numbers. Practically, we make a series expansion: $$ \mathrm{erfc}(x + yi) =\mathrm{erfc}(x) +\sum_{k = 1}^\infty \frac{2(-i)^k y^k}{\sqrt\pi k!} H_{k-1}(x) e^{-x^2}, $$ where $H_{k-1}(x)$ is the physicists' Hermite polynomial. The series expansion, with only real numbers is $$ \begin{aligned} I &=\frac{\sqrt\pi}{2}\mathrm{erfc}(x)\sin\frac{\beta^2}{2}+e^{-x^2} \sum_{k = 1}^\infty (-)^k \left[ \frac{\beta^{2k} H_{2k-1}(x)}{2^{2k} (2k)!} \sin\frac{\beta^2}{2} - \frac{\beta^{2k-1} H_{2k-2}(x)}{2^{2k-1} (2k-1)!} \cos\frac{\beta^2}{2}, \right] \end{aligned} $$ where $x = \sqrt{a} -\beta/2$.

  • $\begingroup$ Whoa this is ways better than mine!! :D Congratulations! $\endgroup$
    – Laplacian
    Nov 26, 2015 at 0:19
  • $\begingroup$ @Henry. The solution has to use imaginary number. Maybe you can get rid of that. Besides the credit goes to David G. Stork. Happy thanksgiving! $\endgroup$
    – user293511
    Nov 26, 2015 at 0:40
  • $\begingroup$ Thank you guys! Sorry for late answer, and Happy thanksgiving! $\endgroup$
    – Wita
    Nov 26, 2015 at 7:59
  • $\begingroup$ @user293511: Thank you for your answer, in your comment you said we can get rid of imaginary number. How? Because for plotting I do not want to have problem and I know it will be a bit silly question but I could not understand how you reached from Im[] part to last equation. If we had Cosine instead of Sine, how we can reach last equation from Re[]? Sorry for this stupid question again! $\endgroup$
    – Wita
    Nov 26, 2015 at 9:48
  • 1
    $\begingroup$ @2che. I like the nice question, but unfortunately I was unable to get rid of the imaginary numbers. So I was hoping Henry can do something about it. Besides, Henry's answer is more detailed. Could you please rechoose his answer as the best? Thank you! The imaginary part is removed by $\Im z = (z-z^*)/(2i)$. The complex argument is indeed inconvenient, but I am not smart enough to get rid of it. The only dumb solution that I can think of is to do a series expansion, using Hermite polynomials, but this is a bit clumsy. Thank you again for the nice question, and have a nice thanksgiving! $\endgroup$
    – user293511
    Nov 26, 2015 at 19:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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