Closed form of $I = \int_{0}^{+\infty}{t^\kappa e^{-\ \frac{t}{\lambda}}\sin^2{\left(\frac{\pi t}{2\kappa\lambda}\right)}dt}$ I need help with this integral:
$$I = \int_{0}^{+\infty}{t^\kappa e^{-\ \frac{t}{\lambda}}\sin^2{\left(\frac{\pi t}{2\kappa\lambda}\right)}dt}$$
Where $κ,λ>0$.
Neither Mathematica nor Maple could find a closed form for this integral.
Let $G$ follow a $\Gamma\left(\kappa+1,\lambda\right)$ distribution, i.e. its density can be written as $f_G\left(x\right)=\mathbb{I}_{\mathbb{R}_+^\ast}\left(x\right)\ x^\kappa\ e^{-\ \frac{x}{\lambda}}\frac{1}{\Gamma\left(\kappa+1\right)\ \lambda^{\kappa+1}}$.
For fixed values of κ and λ, I can use Monte-Carlo to simulate : $$I=\Gamma\left(\kappa+1\right)\ \lambda^{\kappa+1}\int_{0}^{+\infty}{f_G\left(t\right)\sin^2{\left(\frac{\pi t}{2\kappa\lambda}\right)}dt}=\Gamma\left(\kappa+1\right)\ \lambda^{\kappa+1}\ \mathbb{E}\left(\sin^2{\left(\frac{G\pi}{2\kappa\lambda}\right)}\right)$$
But I would actually rather have a closed form. Any help or insight will be very much appreciated.
PS : although fluent in english, I mostly study math in french...
Edit : following another user's suggestion, I know have the following :
$$I=\int_{0}^{+\infty}{t^\kappa e^{-\ \frac{t}{\lambda}}\sin^2{\left(\frac{\pi t}{2\kappa\lambda}\right)}dt}$$
$$I=\int_{0}^{+\infty}{t^\kappa e^{-\ \frac{t}{\lambda}}\frac{1-\cos{\left(\frac{\pi t}{\kappa\lambda}\right)}}{2}dt}$$
$$I=\frac{1}{2}\left(\int_{0}^{+\infty}{t^\kappa e^{-\ \frac{t}{\lambda}}dt}-\int_{0}^{+\infty}{t^\kappa e^{-\ \frac{t}{\lambda}}\cos{\left(\frac{\pi t}{\kappa\lambda}\right)}dt}\right)$$
$$I=\frac{\Gamma\left(\kappa+1\right)\ \lambda^{\kappa+1}}{2}-\frac{1}{4}\int_{0}^{+\infty}{t^\kappa e^{-\ \frac{t}{\lambda}}\left(e^{i\frac{\pi t}{\kappa\lambda}}+e^{-i\frac{\pi t}{\kappa\lambda}}\right)dt}$$
$$I=\frac{\Gamma\left(\kappa+1\right)\ \lambda^{\kappa+1}}{2}-\frac{1}{4}\int_{0}^{+\infty}{t^\kappa e^{-\ \frac{t}{\lambda}+i\frac{\pi t}{\kappa\lambda}}\ dt}-\frac{1}{4}\int_{0}^{+\infty}{t^\kappa e^{-\ \frac{t}{\lambda}\ -\ i\frac{\pi t}{\kappa\lambda}}\ dt}$$
$$I=\frac{\Gamma\left(\kappa+1\right)\ \lambda^{\kappa+1}}{2}-\frac{1}{4}\int_{0}^{+\infty}{t^\kappa e^{-\ \frac{\left(\kappa-i\pi\right)t}{\kappa\lambda}\ }dt}-\frac{1}{4}\int_{0}^{+\infty}{t^\kappa e^{-\ \frac{\left(\kappa+i\pi\right)t}{\kappa\lambda}\ }dt}$$
$$I=\frac{\Gamma\left(\kappa+1\right)\ \lambda^{\kappa+1}}{2}-\frac{1}{4}\int_{0}^{+\infty}{\left(\frac{\kappa\lambda}{\kappa-i\pi}u\right)^\kappa e^{-u\ }\frac{\kappa\lambda}{\kappa-i\pi}du}-\frac{1}{4}\int_{0}^{+\infty}{\left(\frac{\kappa\lambda}{\kappa+i\pi}u\right)^\kappa e^{-u\ }\frac{\kappa\lambda}{\kappa-i\pi}du}$$
$$I=\frac{\Gamma\left(\kappa+1\right)\ \lambda^{\kappa+1}}{2}-\frac{1}{4}\left(\frac{\kappa\lambda}{\kappa-i\pi}\right)^{\kappa+1}\int_{0}^{+\infty}{u^\kappa e^{-u\ }du}-\frac{1}{4}\left(\frac{\kappa\lambda}{\kappa+i\pi}\right)^{\kappa+1}\int_{0}^{+\infty}{u^\kappa e^{-u\ }dt}$$
$$I=\frac{\Gamma\left(\kappa+1\right)\ \lambda^{\kappa+1}}{2}-\frac{1}{4}\left(\frac{\kappa\lambda}{\kappa+i\pi}\right)^{1+\kappa}\Gamma\left(1+\kappa\right)-\frac{1}{4}\left(\frac{\kappa\lambda}{\kappa-i\pi}\right)^{1+\kappa}\Gamma\left(1+\kappa\right)$$
$$I=\frac{\Gamma\left(\kappa+1\right)\ \lambda^{\kappa+1}}{4}\left(2-\left(\frac{\kappa}{\kappa+i\pi}\right)^{1+\kappa}-\left(\frac{\kappa}{\kappa-i\pi}\right)^{1+\kappa}\right)$$
Not sure what to do about the complex numbers I get in the end though...
 A: I can answer myself following the helpful answers from this post : How to simplify $\left(x+i\pi\right)^{1+x}+\left(x-i\pi\right)^{1+x}$ for $x>0$.
$$I=\frac{\Gamma\left(\kappa+1\right)\ \lambda^{\kappa+1}}{4}\left(2-\left(\frac{\kappa}{\kappa-i\pi}\right)^{1+\kappa}-\left(\frac{\kappa}{\kappa+i\pi}\right)^{1+\kappa}\right)$$
$$I=\frac{\Gamma\left(\kappa+1\right)\ \lambda^{\kappa+1}}{4}\left(2-\kappa^{1+\kappa}\left(\frac{1}{\left(\kappa-i\pi\right)^{1+\kappa}}+\frac{1}{\left(\kappa+i\pi\right)^{1+\kappa}}\right)\right)$$
$$I=\frac{\Gamma\left(\kappa+1\right)\ \lambda^{\kappa+1}}{4}\left(2-\left(\frac{\kappa}{\kappa^2+\pi^2}\right)^{\kappa+1}\left(\left(\kappa+i\pi\right)^{1+\kappa}+\left(\kappa-i\pi\right)^{1+\kappa}\right)\right)$$
$$I=\frac{\Gamma\left(\kappa+1\right)\ \lambda^{\kappa+1}}{2}\left(1-\left(\frac{\kappa}{\sqrt{\kappa^2+\pi^2}} \right)^{\kappa+1}\cos{\left(\left(1+\kappa\right)\arctan{\frac{\pi}{\kappa}}\right)}\right)$$
A: I do not agree with the statement "NeitherMathematica nor Maple could find a closed form for this integral"
Mathematica find a quite simple expression of the antiderivative in terms of the gamma function which can simplify to
$$f(t)=\frac{1}{4} t^{\kappa +1} \left(E_{-\kappa }\left(\frac{t (\kappa -i \pi )}{\kappa  \lambda
   }\right)+E_{-\kappa }\left(\frac{t (\kappa +i \pi )}{\kappa  \lambda
   }\right)-2 E_{-\kappa }\left(\frac{t}{\lambda
   }\right)\right)$$ where appear the exponential integral function. The same for the definite integral but here we face the problem of your other question.
Using the formulation in terms of the expoential integral,
there is no problem when $t\to \infty$ since the result is just $0$. Where the problem starts to be unpleasant is when I try to evaluate $f(0)$.
Now, all my congratulations for your work !
A: $\newcommand{\bbx}[1]{\,\bbox[15px,border:1px groove navy]{\displaystyle{#1}}\,}
 \newcommand{\braces}[1]{\left\lbrace\,{#1}\,\right\rbrace}
 \newcommand{\bracks}[1]{\left\lbrack\,{#1}\,\right\rbrack}
 \newcommand{\dd}{\mathrm{d}}
 \newcommand{\ds}[1]{\displaystyle{#1}}
 \newcommand{\expo}[1]{\,\mathrm{e}^{#1}\,}
 \newcommand{\ic}{\mathrm{i}}
 \newcommand{\mc}[1]{\mathcal{#1}}
 \newcommand{\mrm}[1]{\mathrm{#1}}
 \newcommand{\on}[1]{\operatorname{#1}}
 \newcommand{\pars}[1]{\left(\,{#1}\,\right)}
 \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}}
 \newcommand{\root}[2][]{\,\sqrt[#1]{\,{#2}\,}\,}
 \newcommand{\totald}[3][]{\frac{\mathrm{d}^{#1} #2}{\mathrm{d} #3^{#1}}}
 \newcommand{\verts}[1]{\left\vert\,{#1}\,\right\vert}$
$\ds{\bbox[5px,#ffd]{}}$

\begin{align}
I \equiv &\bbox[5px,#ffd]{\int_{0}^{\infty}t^{\kappa} \expo{-t/\lambda}\sin^{2}\pars{\pi t \over 2\kappa\lambda}\,\dd t}
\\[5mm] & =
\left.\lambda^{\kappa + 1}
\int_{0}^{\infty}t^{\kappa} \expo{-t}
\sin^{2}\pars{\alpha t \over 2}\,\dd t
\,\right\vert_{\ \color{red}{\alpha\ =\ \pi/\kappa}}
\\[5mm] & =
{1 \over 2}\,\lambda^{\kappa + 1}\
\overbrace{\int_{0}^{\infty}t^{\kappa}
\expo{-t}\dd t}
^{\ds{\Gamma\pars{\kappa + 1}}}
\\[2mm] &\
-{1 \over 2}\,\lambda^{\kappa + 1}
\underbrace{\int_{0}^{\infty}t^{\kappa}
\expo{-t}\cos\pars{\alpha t}\,\dd t}
_{\ds{\cal J}}\label{1}\tag{1}
\end{align}

$\ds{\large{\cal J}\ \mbox{Evaluation:}}$
\begin{align}
{\cal J} & \equiv
\int_{0}^{\infty}t^{\kappa} \expo{-t}
\cos\pars{\alpha t}\,\dd t =
\Re\int_{0}^{\infty}t^{\kappa} \expo{-\pars{1 + \ic\alpha}t}\,\dd t
\end{align}
Note that
$$
\expo{-\pars{1 + \ic\alpha}t} =
\sum_{n = 0}^{\infty}{\bracks{-\pars{1 + \ic\alpha}t}^{n} \over n!} =
\sum_{n = 0}^{\infty}\color{red}{\pars{1 + \ic\alpha}^{n}}\,{\pars{-t}^{n} \over n!}
$$
In order to evaluate $\ds{\cal J}$, I'll use Ramanujan's Master Theorem:
\begin{align}
{\cal J} & =
\Re\bracks{\Gamma\pars{\kappa + 1}\pars{1 + \ic\alpha}^{-\kappa - 1}\,}
\\[5mm] & =
\Gamma\pars{\kappa + 1}
\pars{1 + \alpha^{2}}^{-\kappa/2 - 1/2}\,\,\, =\
{\Gamma\pars{\kappa + 1} \over 
\pars{1 + \alpha^{2}}^{\kappa/2 + 1/2}}
\\[5mm] & =
\kappa^{\kappa + 1}\
{\Gamma\pars{\kappa + 1} \over 
\pars{\kappa^{2} + \pi^{2}}^{\kappa/2 + 1/2}}
\quad\mbox{with}\quad\alpha = {\pi \over \kappa}
\label{2}\tag{2}
\end{align}

With (\ref{1}) and (\ref{2}):
\begin{align}
I \equiv &\bbox[5px,#ffd]{\int_{0}^{\infty}t^{\kappa} \expo{-t/\lambda}\sin^{2}\pars{\pi t \over 2\kappa\lambda}\,\dd t}
\\[5mm] & =
\bbx{{1 \over 2}\,\lambda^{\kappa + 1}\
\Gamma\pars{\kappa + 1}
\bracks{%
1 -  {\kappa^{\kappa + 1} \over 
\pars{\kappa^{2} + \pi^{2}}^{\kappa/2 + 1/2}}}}
\\ &
\end{align}
