# The $q$'th moment of gamma distribution?

Let $$X \sim \Gamma(\beta,\lambda)$$ where $$\beta>0$$ is the rate paramter and $$\lambda>0$$ is the shape parameter. When I want to compute the $$q$$'th moment I get that \begin{align*} \mathbb{E}[X^q] &= \int_{0}^\infty x^q P_X(dx) \\ &= \int_0^\infty x^q \frac{\lambda^\beta x^{\beta-1}\exp(-\lambda x)}{\Gamma(\beta)} \ dx \\ &= \frac{\lambda^{-q+1}}{\Gamma(\beta) }\int_0^\infty \lambda^{q+\beta-1} x^{q+\beta-1}\exp(-\lambda x) \ dx \\ &= \frac{\lambda^{-q+1}}{\Gamma(\beta) }\Gamma(q+\beta). \end{align*} which is different ($$\lambda^{-q}$$ instead of $$\lambda^{-q+1}$$) from what my textbook says as well as https://en.wikipedia.org/wiki/Gamma_distribution#Higher_Moments.

Did I make a mistake somewhere? Or is there something I haven't thought of?

Yes, you forgot to set $$d(\lambda x)$$ inside your integral. In other words "one" lambda has to be shifted in the differential
$$\Gamma(\beta+q)=\int_0^{\infty}(\lambda x)^{\beta+q-1}\cdot e^{-\lambda x} d(\lambda x)=\int_0^{\infty} \theta^{\beta+q-1}\cdot e^{-\theta}d\theta$$