Exercise
I've been tasked with deriving the probability density function for a chi-squared random variable
$$f(x;q) = \begin{cases} \hfill 0 \hfill & x\leq 0 \\ \hfill \tfrac{1}{\Gamma\big(\tfrac{q}{2}\big)}\big(\frac{1}{2}\big)^{q/2}x^{q/2-1}e^{-\tfrac{x}{2}} \hfill & x> 0 \\ \end{cases} $$
Useful Information
We've determined the following through previous exercises:
For $X\sim N(0,1)$, the PDF for $X^2$ is $$ f_{X^2}(x) = \begin{cases} \hfill 0 \hfill & x\leq 0 \\ \hfill \tfrac{1}{\sqrt{2\pi x}}e^{-\tfrac{x}{2}} \hfill & x> 0. \\ \end{cases} $$
For two independent continuous random variables with respective PDFs $f_X$ and $f_Y$, the PDF for $Z=X+Y$ is $$ f_Z(z)=\int_{-\infty}^{+\infty}f_X(z-x)f_Y(x)dx. $$
Attempt
We've been guided to show this by induction. (1) shows the base case. Set $Q=\sum_{k=1}^{q-1}X^2_k$. For $Z=Q+X^2_q$, (2) shows $$ f_Z(z)=\int_{-\infty}^{+\infty}f_Q(z-x)f_{X^2_q}(x)dx. $$ Since $z-x>0$ iff $z>x$ we see that this can be rewritten as (by plugging in what the distributions are) \begin{align*} f_Z(z)&=\int_{0}^{z}\left(\tfrac{1}{\Gamma\big(\tfrac{q}{2}\big)}\big(\tfrac{1}{2}\big)^{q/2}(z-x)^{q/2-1}e^{-\tfrac{z-x}{2}}\right)\left(\tfrac{1}{\sqrt{2\pi x}}e^{-\tfrac{x}{2}}\right)dx.\\ &=\frac{\big(\frac{1}{2}\big)^{\frac{q+1}{2}}}{\Gamma\left(\frac{q}{2}\right)\Gamma\left(\frac{1}{2}\right)}\int_{0}^{z}(z-x)^{\frac{q}{2}-1}e^{x-\frac{z}{2}}dx\\ \end{align*} From here I am stuck.
Issues
I am stuck since this integral is disgusting to compute. Would it be easier using MATLAB? I can possibly use integration by parts, but I feel like this is pushing me in the wrong direction. Any help is greatly appreciated. Thanks in advance.