How to compute $\int^{\infty}_{0} t^{(\frac1n-1)}\cos t \,\mathrm{d}t$? How to calculate the below integral?
$$
\int^{\infty}_{0} \frac{\cos t}{t^{1-\frac{1}{n}}} \textrm{d}t = \frac{\pi}{2\sin(\frac{\pi}{2n})\Gamma(1-\frac{1}{n})}
$$ 
where $n\in \mathbb{N}$.
 A: Write $t^{n^{-1}-1}\cos t$ as 
$$\frac12t^{n^{-1}-1}e^{it}+\frac12t^{n^{-1}-1}e^{-it}.$$
Consider the integral as complex contour integral and


*

*Turn the contour of integration for $\frac12t^{n^{-1}-1}e^{it}$ by $\frac{\pi}{2}$ counterclockwise (so that it becomes $t=is$, $s\in\mathbb{R}_{>0}$), then
$$\int_0^{\infty}\frac12t^{n^{-1}-1}e^{it}dt=\frac{e^{\frac{i\pi}{2}n^{-1}}}{2}\int_0^{\infty}s^{n^{-1}-1}e^{-s}ds=\frac{e^{\frac{i\pi}{2}n^{-1}}}{2}\Gamma(n^{-1}).$$

*Similarly, turn the contour of integration for $\frac12t^{n^{-1}-1}e^{it}$ by $\frac{\pi}{2}$ clockwise, then
$$\int_0^{\infty}\frac12t^{n^{-1}-1}e^{-it}dt=\frac{e^{-\frac{i\pi}{2}n^{-1}}}{2}\int_0^{\infty}s^{n^{-1}-1}e^{-s}ds=\frac{e^{-\frac{i\pi}{2}n^{-1}}}{2}\Gamma(n^{-1}).$$
The sum of two integrals is equal to $\Gamma(n^{-1})\cos\frac{\pi}{2n}$ and it is an easy exercise (using Euler reflection formula $\Gamma(z)\Gamma(1-z)=\frac{\pi}{\sin\pi z}$) to show that this equals to the right side of your identity.
A: It is well-known (and relatively easy to prove) that

Lemma. If $f$ is improperly integrable on $(0, \infty)$, then $F(s) = \int_{0}^{\infty} f(x) e^{-sx} \, dx$ defines an analytic function for $\Re s > 0$ and
  $$ \lim_{s\to0^{+}} \int_{0}^{\infty} f(x) e^{-sx} \, dx = \int_{0}^{\infty} f(x) \, dx. $$

Then for $0 < \alpha < 1$,
\begin{align*}
\int_{0}^{\infty} \frac{\cos x}{x^{1-\alpha}} \, dx
&= \lim_{s\to0^{+}} \int_{0}^{\infty} \frac{\cos x}{x^{1-\alpha}} e^{-sx} \, dx \\
&= \lim_{s\to0^{+}} \frac{1}{\Gamma(1-\alpha)} \int_{0}^{\infty} \frac{\Gamma(1-\alpha)}{x^{1-\alpha}} e^{-sx} \cos x \, dx \\
&= \lim_{s\to0^{+}} \frac{1}{\Gamma(1-\alpha)} \int_{0}^{\infty} \left( \int_{0}^{\infty} u^{-\alpha} e^{-xu} \, du \right) e^{-sx} \cos x \, dx \\
&= \lim_{s\to0^{+}} \frac{1}{\Gamma(1-\alpha)} \int_{0}^{\infty} \left( \int_{0}^{\infty} e^{-(u+s)x} \cos x \, du \right) u^{-\alpha} \, du \\
&= \lim_{s\to0^{+}} \frac{1}{\Gamma(1-\alpha)} \int_{0}^{\infty} \frac{(u+s) u^{-\alpha}}{(u+s)^{2} + 1} \, du \\
&= \frac{1}{\Gamma(1-\alpha)} \int_{0}^{\infty} \frac{u^{1-\alpha}}{u^{2} + 1} \, du.
\end{align*}
Here, the interchange of two integrals is justified by the Fubini's theorem. Then by plugging $u = \tan \theta$, the beta function identity gives us
\begin{align*}
\int_{0}^{\infty} \frac{\cos x}{x^{1-\alpha}} \, dx
&= \frac{1}{\Gamma(1-\alpha)} \int_{0}^{\frac{\pi}{2}} \tan^{1-\alpha}\theta \, d\theta \\
&= \frac{1}{2\Gamma(1-\alpha)} \beta\left( 1-\frac{\alpha}{2}, \frac{\alpha}{2} \right) \\
&= \frac{1}{2\Gamma(1-\alpha)} \Gamma \left( 1-\frac{\alpha}{2} \right) \Gamma \left( \frac{\alpha}{2} \right) \\
&= \frac{\pi}{2\Gamma(1-\alpha)} \csc \left( \frac{\pi \alpha}{2} \right)
\end{align*}
as desired.
A: A short cut is the Mellin transform technique (using the tables)
$$ F(s)=\int_{0}^{\infty} x^{s-1}f(x) dx .$$
Now, the Mellin transform of $\cos(t)$ is $$ \Gamma  \left( s \right) \cos \left( \frac{\pi}{2} \,s \right) .$$ 
Then subs $s=\frac{1}{n}$, since $s-1=\frac{1}{n}-1$, gives 
$$ I =  \Gamma  \left( \frac{1}{n} \right) \cos \left( \frac{\pi}{2n}  \right) . $$ 
A: This is just the definition of the Incomplete gamma function. The actual value can be found using the recurrence relation gotten by integration by parts as well as the definition of the Gamma function.
