Closed form of $I=\int_{0}^{c}{t^\kappa\ e^{-t}\cos{\left(t\right)} dt}$ Let $c,\kappa\in\mathbb{R}_+^\ast$. I'm trying to simplify the following integral in order to compute it fast (so Monte-Carlo is out of the question) : $$I=\int_{0}^{c}{t^\kappa\ e^{-t}\cos{\left(t\right)} dt}$$
If I try using complex numbers, I end up with the following :
$$I=\frac{1}{2}\int_{0}^{c}{t^\kappa e^{-t}\left(e^{it}+e^{-it}\right)dt}=\frac{1}{2}\left(\int_{0}^{c}{t^\kappa e^{-t\left(1+i\right)}dt}+\int_{0}^{c}{t^\kappa e^{-t\left(1-i\right)}dt}\right)$$
My major mostly focuses on probability & stats so I'm not sure and/or confortable with what to do next.
A u-substitution would replace the upper bound $c$ with a complex number (that's not allowed, right ?).
If the gamma cumulative distribution function were expanded to complexe parameters, I could have computed it this way on R (with help from the pgamma function) :
$$I=\frac{\Gamma\left(\kappa+1\right)}{2}\left(\left(\frac{1-i}{2}\right)^{\kappa+1}F_{\Gamma\left(\kappa+1,\frac{1-i}{2}\ \right)}\left(c\right)+\left(\frac{1+i}{2}\right)^{\kappa+1}F_{\Gamma\left(\kappa+1,\frac{1+i}{2}\ \right)}\left(c\right)\right)$$
But unfortunately that's not the case. Any insight or suggestions on what to do next would be very much appreciated...
 A: To see how the expression given by @DavidG.Stork is derived, we first write the exponential as a series to get \begin{align}\int t^\kappa e^{-t(1\pm i)}\,dt&=\int t^\kappa\sum_{n=0}^\infty\frac{(-t(1\pm i))^n}{n!}\,dt\\&=C+\sum_{n=0}^\infty\frac{(-1\mp i)^nt^{n+\kappa+1}}{n!(n+\kappa+1)}\\&=C+t^{\kappa+1}\sum_{n=0}^\infty\frac{((-1\mp i)t)^n}{n!(n+\kappa+1)}\\&=C-\frac{\Gamma(\kappa+1,(1\pm i)t)}{(1\pm i)^{\kappa+1}}\end{align} where $$\Gamma(a,z)=-\sum\limits_{n=0}^\infty\frac{(-1)^nz^{n+a}}{n!(n+a)}=z^aE_{1-a}(z)$$ is the incomplete gamma function. Thus\begin{align}2I&=\int_0^ct^\kappa e^{-t(1+i)}\,dt+\int_0^ct^\kappa e^{-t(1-i)}\,dt\\&=\left(-\frac{\Gamma(\kappa+1,(1+i)c)-\Gamma(\kappa+1)}{(1+i)^{\kappa+1}}\right)+\left(-\frac{\Gamma(\kappa+1,(1-i)c)-\Gamma(\kappa+1)}{(1-i)^{\kappa+1}}\right)\\&=\Gamma(\kappa+1)\left((1+i)^{-(\kappa+1)}+(1-i)^{-(\kappa+1)}\right)-c^{\kappa+1}(E_{-k}((1+i)c)+E_{-k}((1-i)c))\end{align} and since $(1+i)^{-(\kappa+1)}+(1-i)^{-(\kappa+1)}=2^{-(\kappa+1)/2}\cos(-(\kappa+1)\pi/4)$ the result follows.
