Derivation of the density function of student t-distribution from this big integral. My lecturer posed a question where we derive the density function of the student t-distribution from the Chi-square and Standard normal distribution.
I worked on this question for days, and I am pretty sure the below integral is correct (Verified by others)

$$f_T(t)=\int_{-\infty}^\infty|x|2nx\times \frac{\frac{1}{2}^{\frac{n}{2}}}{\Gamma\left(\frac{n}{2}\right)}(x^2n)^{\frac{n}{2}-1}e^{-\frac{1}{2}x^2n}\frac{1}{\sqrt{2\pi}}e^{-\frac{(xt)^2}{2}}dx$$
where n is the degree of freedom of the t-distribution and $\Gamma$ is the gamma function from the Gamma distribution.
My goal is $$f_T(t)=\frac{\Gamma[(n+1)/2]}{\sqrt{n\pi}\Gamma(n/2)}\left(1+\frac{t^2}{n}\right)^{-(n+1)/2}$$

I was given 2 hints. To proceed, I need to do integration by parts first, then I should use the fact that the Gamma d.f integrates to 1.
From this point on, I am unsure, but I shall show you my steps.

We know that the d.f of the Gamma density with parameters $\alpha=\frac{n+1}{2} \lambda=\frac{1}{2}$ integrates to $1$, that is $\int_{0}^{\infty}g(t)dt= \int_{0}^{\infty}\frac{\frac{1}{2}^{\frac{n+1}{2}}}{\Gamma\left(\frac{n+1}{2}\right)}t^{\frac{n+1}{2}-1}e^{-\frac{1}{2}t}dt=1$
Let $t=x^2n$.  Therefore,      $dt=2xn\,dx$
We have $\int_{0}^{\infty}g(t)dt=\int_{0}^{\infty}g(x^2n)2xn\,dx=\int_{0}^{\infty}\frac{\frac{1}{2}^{\frac{n+1}{2}}}{\Gamma\left(\frac{n+1}{2}\right)}(x^2n)^{\frac{n+1}{2}-1}e^{-\frac{1}{2}(x^2n)}2xn\,dx=1$
This should be useful because I noticed the $\Gamma[(n+1)/2]$ in the end result.

Working on the big integral now...
$f_T(t)=\int_{-\infty}^\infty|x|2nx\times \frac{\frac{1}{2}^{\frac{n}{2}}}{\Gamma\left(\frac{n}{2}\right)}(x^2n)^{\frac{n}{2}-1}e^{-\frac{1}{2}x^2n}\frac{1}{\sqrt{2\pi}}e^{-\frac{(xt)^2}{2}}$
$=\frac{\Gamma[(n+1]/2)]}{\sqrt{n\pi}\Gamma(n/2)}\int_{-\infty}^\infty \frac{\sqrt{n\pi}\Gamma(n/2)}{\Gamma[(n+1]/2)]}|x|2nx\times \frac{\frac{1}{2}^{\frac{n}{2}}}{\Gamma\left(\frac{n}{2}\right)}(x^2n)^{\frac{n}{2}-1}e^{-\frac{1}{2}x^2n}\frac{1}{\sqrt{2\pi}}e^{-\frac{(xt)^2}{2}}dx$
After a load of manipulation,
$=\frac{\Gamma[(n+1]/2)]}{\sqrt{n\pi}\Gamma(n/2)}\int_{-\infty}^\infty 2nx \frac{(\frac{1}{2})^{\frac{n+1}{2}}}{\Gamma [(n+1)/2)] }(x^2n)^{\frac{n-1}{2}}e^{-\frac{1}{2}(x^2n)}\times2n|x|e^{-\frac{(xt)^2}{2}}dx$
Note that the first half is integrate to 1. Hence I do by parts.

But I still cannot get to my goal.
I had tried this question for at least 6 times already now. Can I get some help? I tried to type these out as neatly as I knew how.

 A: Given your current integral state, the first thing I would have done is to do a substitution to get rid of the dependence of $t$ in the exponent, so $u = \frac{1}{2} x^2 (n+t^2)$. The result will be a Gamma integral and the $t$ dependent parts match with your desired solution. 
Oh, and before the substitution, also make the integral from $0$ to $\infty$ and double the value (pesky $|x|$). Let me know where this takes you.

PS your integral needs a slight adjustment.
Let $Z$ be standard normal and $V$ be the square root of the chi-squared distribution with $n$ degrees of freedom.
Then in the joint distribution, to figure out the density at $t$, when you integrate over possible values of $Z=x$, note that as the chi-squared distribution is positive, this is only possible when $x \cdot t > 0$ (same sign), in which case you would plug in the density of $V$ at $n(x/t)^2$, as your desired student t distribution $Y$ is $Y = Z / \sqrt{(V/n)}$.
So for $t > 0$ (it's symmetric, so let's ignore the other case for now)
$f_T(t) = \int_0^\infty \frac{ (nx^2/t^2)^{k/2-1} e^{-\frac{nx^2}{2t^2}} }{ 2^{n/2} \Gamma(n/2) }  \frac{e^{-x^2/2}}{\sqrt{2\pi}} dx$. 
If $t>0$, the only contribution comes from when $Z=x>0$ and $V = n(x/t)^2$.
The first thing from here to do is to isolate the exponent, use the substitution $u = x^2 \frac{1+n/t^2}{2}$ and you should get a gamma function integral.
