Generalization of $\int_0^{\infty} e^{-x^2} \cosh x d x$

calculusdefinite integralsgaussian-integralhyperbolic-functionsimproper-integrals

Recently I had just met a solution on the integral using the power series of $\cosh x$. I wish to generalize it by the result the Gaussian Integral:

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

First of all, I, by definition, express the integrand in terms of $e^x$.

$$
\begin{aligned}
\int_0^{\infty} e^{-a x^2} \cosh (b x) d x
= & \frac{1}{4} \int_{-\infty}^{\infty}\left(e^{-a x^2+b x}+e^{-a x^2-b x}\right) d x \\
= & \frac{1}{4} \int_{-\infty}^{\infty}\left(e^{-a\left(x-\frac{b}{2 a}\right)^2+\frac{b^2}{4 a}}+e^{-a\left(x+\frac{b}{2 a}\right)^2+\frac{b^2}{4 a}}\right) d x \\
= & \left.\frac{e^{\frac{b^2}{4 a}}}{4} \int_{-\infty}^{\infty} e^{-a\left(x-\frac{b}{2 a}\right)^2} d x+\int_{-\infty}^{\infty} e^{-a\left(x+\frac{b}{2 a}\right)^2} d x\right] \\
= & \frac{e^{\frac{b^2}{4 a}}}{4}\left(\sqrt{\frac{\pi}{a}}+\sqrt{\frac{\pi}{a}}\right)\\=&\frac{e^{\frac{b^2}{4 a}}}{2} \sqrt{\frac{\pi}{a}}
\end{aligned}
$$

where $a>0$ and $b$ is real.


Am I correct? Is there any other method?

Your comments and alternative methods are highly appreciated.

Best Answer

We are given $$ \int_{-\infty}^{\infty} e^{-a(x+b)^2} d x=\sqrt{\frac{\pi}{a}},\quad a>0,b\in\mathbb R . \tag0$$ First, generalize this to $$ \int_{-\infty}^{\infty} e^{-a(x+b)^2} d x=\sqrt{\frac{\pi}{a}}, \quad a>0,b\in\mathbb C . \tag1$$ To prove it, note that the LHS is an analytic function of $b$ [by Morera], and constant on the real line, therefore constant on $\mathbb C$.

Next, if $\beta$ is real, we have \begin{align} \int_{-\infty}^{\infty}\exp\left(-ax^{2}\right)\cos\left(\beta x\right)dx &= \operatorname{Re} \int_{-\infty}^{\infty}\exp\left(-ax^{2}\right)\exp(i\beta x)\;dx \\ &= \operatorname{Re} \int_{-\infty}^\infty\exp\left(-a\left(x-\frac{i\beta}{2a}\right)^2\right)\exp\left(\frac{-\beta^2}{4a}\right)\;dx \\ &= \exp\left(\frac{-\beta^2}{4a}\right)\sqrt{\frac{\pi}{a}} . \end{align} Again, both sides are analytic in $\beta$, and we get $$ \int_{-\infty}^{\infty}\exp\left(-ax^{2}\right)\cos\left(\beta x\right)dx =\exp\left(\frac{-\beta^2}{4a}\right)\sqrt{\frac{\pi}{a}}, \quad a>0, \beta\in \mathbb C . \tag3$$ Therefore, for $a>0, b \in \mathbb C$, \begin{align} \int_{-\infty}^{\infty}\exp\left(-ax^{2}\right)\cosh\left(b x\right)dx & =\int_{-\infty}^{\infty}\exp\left(-ax^{2}\right)\cos\left(i b x\right)dx \\ &= \exp\left(\frac{-(ib)^2}{4a}\right)\sqrt{\frac{\pi}{a}} = \exp\left(\frac{b^2}{4a}\right)\sqrt{\frac{\pi}{a}} \end{align}