I am trying to integrate the following function:
$$ \int_{0}^{\infty} \Big(\frac{1}{x}\Big)^{a-1} \exp\Big(-\frac{b}{x}\Big)dx \tag{1} $$
The blog post I am reading claims the answer is
$$ \frac{\Gamma(a)}{b^a}. \tag{2} $$
The author suggests that we can solve $(1)$ by observing that it is a "gamma kernel" (second to last equation in the post). I assume he means the gamma function without the normalization. However, that doesn't look quite like either a gamma or inverse–gamma kernel. The form is slightly different. This is what I tried instead:
$$ \begin{align} \int_{0}^{\infty} \Big(\frac{1}{x}\Big)^{a-1} \exp\Big(-\frac{b}{x}\Big)dx &= \int_{0}^{\infty} x^2 \Big(\frac{1}{x}\Big)^{a+1} \exp\Big(-\frac{b}{x}\Big)dx \\ &= \mathbb{E}[X^2] \frac{\Gamma(a)}{b^a} \\ &= \frac{b^2}{(a-1)(a-2)} \frac{\Gamma(a)}{b^a}. \end{align} \tag{3} $$
In other words, I convert the desired integral into an unnormalized second moment, which I have a closed form solution for.
Who is correct? If I am wrong, where is my mistake and how can I correctly arrive at $(2)$ from $(1)$?
Making a change of variable $t=b/x$ and assuming that $b>0$ we have that $$ \int_{0}^{\infty }x^{1-a}e^{-b/x}\,\mathrm d x=\int_0^{\infty } (b/t)^{1-a}e^{-t}bt^{-2}\,\mathrm d t\\ =b^{2-a}\int_{0}^{\infty }t^{a-3}e^{-t}\,\mathrm d t=\frac{\Gamma (a-2)}{b^{a-2}},\quad \text{ when }a>2 $$
what coincides with your result.