# How to integral $\int_{\sqrt{a}}^{\infty}{ e^{-t^2+\beta t} \sin(\beta t)}~\mathrm{d}t$?

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!

• 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. – Denis Düsseldorf Nov 25 '15 at 20:44
• @DenisDüsseldorf : Thanks I just edited. – Wita Nov 25 '15 at 20:46

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.

• 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)$. – David G. Stork Nov 25 '15 at 21:42
• 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.. – Turing Nov 25 '15 at 21:48
• 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. – David G. Stork Nov 25 '15 at 21:52
• I wil check it later, thanks for the note!! >.< Hope the guy will check these comments too! – Turing Nov 25 '15 at 22:03
• @2che That is a very interesting question. I'll think about it!! – Turing Nov 27 '15 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$.

• Whoa this is ways better than mine!! :D Congratulations! – Turing Nov 26 '15 at 0:19
• @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! – user293511 Nov 26 '15 at 0:40
• Thank you guys! Sorry for late answer, and Happy thanksgiving! – Wita Nov 26 '15 at 7:59
• @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! – Wita Nov 26 '15 at 9:48
• @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! – user293511 Nov 26 '15 at 19:32