Prove that $\int_0^\infty \frac{e^{\cos(ax)}\cos\left(\sin (ax)+bx\right)}{c^2+x^2}dx =\frac{\pi}{2c}\exp\left(e^{-ac}-bc\right)$

$$\begin{aligned} \int_0^{\infty} \frac{e^{\cos(ax)}\cos(\sin(ax)+bx)}{x^2+c^2}\,dx &=\Re\left(\int_0^{\infty} \frac{e^{e^{iax}}e^{ibx}}{x^2+c^2}\right) \\ &=\Re\left(\sum_{k=0}^{\infty} \frac{1}{k!}\int_0^{\infty} \frac{e^{i(ak+b)x}}{x^2+c^2}\,dx\right)\\ &=\sum_{k=0}^{\infty} \frac{1}{k!}\int_0^{\infty}\frac{\cos((ak+b)x)}{x^2+c^2}\,dx \\ &=\frac{\pi}{2c}\sum_{k=0}^{\infty} \frac{1}{k!}e^{-c(ak+b)}\\ &=\frac{\pi}{2c}e^{-bc}\sum_{k=0}^{\infty} \frac{e^{-kac}}{k!}\\ &=\frac{\pi}{2c}e^{-bc}e^{e^{-ac}}=\boxed{\dfrac{\pi}{2c}\exp\left(e^{-ac}-bc\right)} \\ \end{aligned}$$


I used the following result: $$\int_0^{\infty} \frac{\cos(mx)}{x^2+a^2}=\frac{\pi}{2a}e^{-am}$$


As a generalization of Pranav's answer, let us assume that $f(z)$ has a Maclaurin series expansion with real coefficients that converges absolutely on the unit circle on the complex plane.

Then for $a, b, c >0$,

$$ \begin{align} \text{Re} \int_{0}^{\infty} \frac{e^{ibx} f(e^{i a x}) }{c^{2}+x^{2}} \ dx &= \text{Re} \int_{0}^{\infty} \frac{e^{ibx}}{c^{2}+x^{2}} \sum_{n=0}^{\infty} \frac{f^{(n)}(0)}{n!} e^{ianx}\ dx \\ &= \text{Re} \sum_{n=0}^{\infty} \frac{f^{(n)}(0)}{n!} \int_{0}^{\infty} \frac{e^{i(an+b)x}}{c^{2}+x^{2}} \ dx \tag{1} \\ &= \sum_{n=0}^{\infty} \frac{f^{(n)}(0)}{n!} \int_{0}^{\infty} \frac{\cos[(an+b)x]}{c^{2}+x^{2}} \ dx \\ &= \sum_{n=0}^{\infty} \frac{f^{(n)}(0)}{n!} \frac{\pi}{2c} e^{-c(an+b)} \\ &= \frac{\pi}{2c} e^{-bc} \sum_{n=0}^{\infty} \frac{f^{(n)}(0)}{n!} e^{-acn} \\ &= \frac{\pi}{2c} e^{-bc} f(e^{-ac}). \end{align} $$

Your integral is the case $f(z) = e^{z}$.

$ $

$(1)$ When can a sum and integral be interchanged?