ok thanks, I've never done much math with the gamma function but according to this article, the recursion relationship with the gamma function is:
\( \Gamma\big(n+\frac{1}{2}\big) = \big(n-\frac{1}{2}\big)\Gamma\big(n-\frac{1}{2}\big)\)
Therefore, from your second to last step you would get:
\(... = \frac{2}{(v-1)}\sqrt{\frac{\nu}{\pi}}\frac{\Gamma\big(\frac{\nu+1}{2}\big)}{\Gamma\big(\frac{\nu}{2}\big)}\)
\(= \frac{2}{(v-1)}\frac{(v-1)}{2}\sqrt{\frac{\nu}{\pi}}\frac{\Gamma\big(\frac{\nu-1}{2}\big)}{\Gamma\big(\frac{\nu}{2}\big)}\)
\(= \sqrt{\frac{\nu}{\pi}}\frac{\Gamma\big(\frac{\nu-1}{2}\big)}{\Gamma\big(\frac{\nu}{2}\big)}\)
The standardised t distribution I posted has a factor of \(\frac{1}{\sqrt{(\nu-2)\pi}}\) instead of \(\frac{1}{\sqrt{\pi\nu}}\) at the front and \(\sqrt{\nu-2}\) instead of \(\nu\) inside the integral...
I think from looking at it the \(\nu\) that popped out half way through when you did a change of variables will instead pop out as \(\nu-2\) and give the following:
\(... = \frac{2}{(v-1)}\frac{1}{\sqrt{\pi(\nu-2)}}\frac{\Gamma\big(\frac{\nu+1}{2}\big)}{\Gamma\big(\frac{\nu}{2}\big)}\)
\(= \sqrt{\frac{(\nu-2)}{\pi}}\frac{\Gamma\big(\frac{\nu-1}{2}\big)}{\Gamma\big(\frac{\nu}{2}\big)}\)
which equals the equation given by the Matlab lot!
Thanks for the heads up on the folding of the p.d.f.!