Using the student t-distribution with $k > 0$ degrees of freedom, location parameter $l$ and scale parameter $s$ having density

$$\frac{\Gamma \left(\frac{k+1}{2}\right)}{\Gamma\left(\frac{k}{2}\sqrt{k \pi s^2}\right)} \left\{ 1 + k^{-1}\left( \frac{x-l}{s}\right)\right\}^{-(k+1)/2},$$

how to show that the Student $t$-distribution can be written as a mixture of Gaussian distributions by letting $X\sim N(\mu,\sigma^2)$, $\tau = 1/\sigma^2\sim\Gamma(\alpha,\beta)$, and integrating the joint density $f(x,\tau|\mu)$ to get the marginal density $f(x|\mu)$?
What are the parameters of the resulting $t$-distribution, as functions of $\mu,\alpha,\beta$?

I got lost in calculus by integrating the joint conditional density with the Gamma distribution.

The PDF of a Normal distribution is

$$f_{\mu, \sigma}(x) = \frac{1}{\sqrt{2 \pi} \sigma} e^{-\frac{(x-\mu )^2}{2 \sigma ^2}}dx$$

but in terms of $\tau = 1/\sigma^2$ it is

$$g_{\mu, \tau}(x) = \frac{\sqrt{\tau}}{\sqrt{2 \pi}} e^{-\frac{\tau(x-\mu )^2}{2 }}dx.$$

The PDF of a Gamma distribution is 

$$h_{\alpha, \beta}(\tau) = \frac{1}{\Gamma(\alpha)}e^{-\frac{\tau}{\beta }} \tau^{-1+\alpha } \beta ^{-\alpha }d\tau.$$

Their product, slightly simplified with easy algebra, is therefore

$$f_{\mu, \alpha, \beta}(x,\tau) =\frac{1}{\beta^\alpha\Gamma(\alpha)\sqrt{2 \pi}} e^{-\tau\left(\frac{(x-\mu )^2}{2 } + \frac{1}{\beta}\right)}  \tau^{-1/2+\alpha}d\tau dx.$$

Its inner part evidently has the form $\exp(-\text{constant}_1 \times \tau) \times \tau^{\text{constant}_2}d\tau$, making it a multiple of a Gamma function when integrated over the full range $\tau=0$ to $\tau=\infty$.  That integral therefore is immediate (obtained by knowing the integral of a Gamma distribution is unity), giving the marginal distribution

$$f_{\mu, \alpha, \beta}(x) = \frac{\sqrt{\beta } \Gamma \left(\alpha +\frac{1}{2}\right) }{\sqrt{2\pi } \Gamma (\alpha )}\frac{1}{\left(\frac{\beta}{2}  (x-\mu )^2+1\right)^{\alpha +\frac{1}{2}}}.$$

Trying to match the pattern provided for the $t$ distribution shows there is an error in the question: the PDF for the Student t distribution actually is proportional to

$$\frac{1}{\sqrt{k} s }\left(\frac{1}{1+k^{-1}\left(\frac{x-l}{s}\right)^2}\right)^{\frac{k+1}{2}}$$

(the power of $(x-l)/s$ is $2$, not $1$).  Matching the terms indicates $k = 2 \alpha$, $l=\mu$, and $s = 1/\sqrt{\alpha\beta}$.



Notice that no Calculus was needed for this derivation: everything was a matter of looking up the formulas of the Normal and Gamma PDFs,  carrying out some trivial algebraic manipulations involving products and powers, and matching patterns in algebraic expressions (in that order).
