We have $N$ oscillators and each of them is described by the Hamiltonian:
$$H = \frac{p^2}{2m} + \frac{Kq^4}{4} $$
I have to compute the average total energy $\langle E\rangle$ of the $N$ oscillators. But to do so, first I have to compute the one particle partition function and to do so I have to solve the following integral:
$$Z_1 (V,T) = \iint_{\mathbb{R}^2} e ^{-\beta \,H_1(p,q)}\,dp\,dq.$$
So in this case:
$$ Z_1 = \int_{-\infty}^{\infty} e^{-\beta\frac{p^2}{2m}}\,dp \int_{-\infty}^{\infty} e^{-\beta \frac{Kq^4}{4}}\,dq. $$
I know this integral can be solved by the Gauss method, knowing that:
$$\int_{-\infty}^{\infty} e^{-x^2} dx = \sqrt{\pi}.$$
For the first integral I got:
$$\int_{-\infty}^{\infty} e^{-\beta\frac{p^2}{2m}}\,dp = \sqrt{\frac{2m\pi}{\beta}}$$
I am having difficulties solving the second one:
$$\int_{-\infty}^{\infty} e^{-\beta \frac{Kq^4}{4}}\,dq.$$
I have tried to make a the change of variables: $q^4 = a^2,$ but this does not simplify the calculation. What method should I use?
Once you get $Z_1$:
$$Z_N = (Z_1)^N.$$
Then you just have to apply:
$$\langle E \rangle = -\frac{ \partial \log(Z_N)}{\partial \beta}.$$
ANSWER
$$\langle E \rangle = \frac{3N}{4\beta}.$$
So, we have \begin{align*} Z_1&=\int_{-\infty}^{\infty} e^{-\beta\frac{p^2}{2m}}\,dp \int_{-\infty}^{\infty} e^{-\beta \frac{Kq^4}{4}}\,dq \\ &=\sqrt{\dfrac{2\pi m}{\beta}} \cdot \frac{\Gamma(1/4)}{\sqrt{2}\sqrt[4]{\beta K}} \\ &=\sqrt{\dfrac{\pi m}{\beta}} \cdot \frac{\Gamma(1/4)}{\sqrt[4]{\beta K}} \\ &=\frac{\sqrt{\pi m}\,\Gamma(1/4)}{\beta^{3/4}\,K^{1/4}} \\ &=\beta^{-3/4}\,\frac{\sqrt{\pi m}\,\Gamma(1/4)}{K^{1/4}}. \end{align*} Next, following your procedure, we do \begin{align*} Z_N&=\left(Z_1\right)^{\,N} \\ &=\left(\beta^{-3/4}\,\frac{\sqrt{\pi m}\,\Gamma(1/4)}{K^{1/4}}\right)^{\!N}, \\ \langle E\rangle&=-\frac{\partial}{\partial\beta} \, \ln\left[\left(\beta^{-3/4}\,\frac{\sqrt{\pi m}\,\Gamma(1/4)}{K^{1/4}}\right)^{\!N}\,\right] \\ &=-N\frac{\partial}{\partial\beta} \, \ln\left[\beta^{-3/4}\,\frac{\sqrt{\pi m}\,\Gamma(1/4)}{K^{1/4}}\right] \\ &=-N\frac{\partial}{\partial\beta} \left[-\frac34\ln(\beta)+\ln\left(\frac{\sqrt{\pi m}\,\Gamma(1/4)}{K^{1/4}}\right) \right] \\ &=\frac{3N}{4\beta}. \end{align*} Here you can see that the $\Gamma(1/4)$ just goes away because of the logarithm.
Lesson for you: Trust the intermediate results (at least temporarily), and keep going!