I'm computing the formula for the characteristic function of the random variable $X \sim \chi^2(n), $ $n\in\mathbb{N}$. After some substitutions in the integral and some messing around with certain terms, I got:
\begin{align*} \varphi_X(t) &= E\left[e^{itX}\right] \\ &= \frac{1}{2^{n/2}\Gamma (n/2)} \int_0^{\infty} \! e^{itx-\frac{x}{2}}x^{\frac{n}{2}-1} \, \mathrm{d}x \\ &= \left| u=x\left(it-\frac{1}{2}\right) \implies \mathrm{d}u = \left(it-\frac{1}{2}\right)\mathrm{d}x \right| \\ &= \frac{1}{2^{n/2}\Gamma (n/2)} \left( it-\frac{1}{2} \right)^{-n/2} \int_0^{\infty} \! e^u u^{\frac{n}{2}-1} \mathrm{d}u \\ &= \left| y=-u \implies \mathrm{d}y = - \mathrm{d}u \right| \\ &= \frac{1}{\Gamma (n/2)}(2it-1)^{-n/2} \int_0^{-\infty} \! e^{-y} (-y)^{\frac{n}{2}-1} (-\mathrm{d}y) \\ &= \frac{1}{\Gamma (n/2)} (1-2it)^{-n/2} \int_0^{-\infty} \! e^{-y} y^{\frac{n}{2}-1} \mathrm{d}y. \end{align*}
So I've skipped some steps (like how I obtained the $(1-2it)^{-n/2}$ etc.) but that's beside the point. Could someone point me to an error I may have made? Or, tell me how I could get the integration limits to be from $0$ to $\infty$? Because then the integral would be $\Gamma(n/2)$ and my solution would be correct. Thanks!