How do I evaluate the mean end-to-end squared distance of a FENE ideal chain at fixed inverse temperature $\beta$ in the canonical ensemble?
This quantity is defined as the mean value $$\left<\left(\sum_{i=1}^{N-1} \vec r_i\right)\cdot\left(\sum_{j=1}^{N-1} \vec r_j\right)\right>$$
Under the canonical distribution $$ \exp\left(-\beta \sum_{i=1}^NH(\vec r_i)\right)\text{ where } H(\vec r_i) = - \ln\left(1 - \left(\frac{|\vec r_i| - r_0}{\Delta}\right)^2\right)\,. $$
Therefore, it would be $$ \frac{ \int \prod_{i=1}^{N-1}d\vec r_i\left(1 - \left(\frac{|\vec r_i| - r_0}{\Delta}\right)^2\right)^\beta \left(\sum_{i=1}^{N-1} \vec r_i\right)\cdot\left(\sum_{j=1}^{N-1} \vec r_j\right)} {\int \prod_{i=1}^{N-1}d\vec r_i\left(1 - \left(\frac{|\vec r_i| - r_0}{\Delta}\right)^2\right)^\beta} $$ where the integral is to be performed over all the values of $\vec r_i$ that give a positive argument of the logarithm. Edit: I realised that the integral that I wanted to solve was not the one written below, but the one written here above. The following is the question in its first (wrong) version, which is the one to which Yarchik responded.
How do I evaluate the quantity $\left.\frac{d}{d\alpha} \ln Z_\alpha\right|_{\alpha=0}$ for N=30 in Mathematica, when
$$ Z_\alpha = V\int e^{-\beta [H(\vec r_1)+H(\vec r_2-\vec r_1)+...+H(\vec r_{N-1}-\vec r_{N-2})]+\alpha|r_{N-1}|^2}d\vec r_1d\vec r_2\cdots d\vec r_{N-1} $$ and $$ H(\vec r) =- \ln\left(1-16(|\vec r|-1)^2\right) ? $$ The integration is extended to all the domain in which the integral is defined (that is, the argument of the function $H$ must be a vector with length in [3/4,5/4]).
I know how to declare the function H, but how can I nest 30 integrate functions without writing them explicitly? I don't want to rewrite my code from scratch if I change the value of N I wish to consider. So far I have the following (H is expressed in spherical coordinates, so that r is just the distance between the particles):
a = 1; d = 0.25; r0 = 1
H[r, r0, d] = -a*Log[1 - (r - r0)^2/d^2]
U = FullSimplify[-D[Log[Z[r0, d, b]], b]]
but I do not know how I can write Z.
For the record, I need this to compute the end to end distance distribution of an ideal chain of 30 atoms linked by FENE springs. $H$ is the hamiltonian associated with each of the 29 springs, and Z is the partition function of my system. The derivative I want to compute is a way of computing the mean of the parenthesis that multiplies $\alpha$.
Edit: thanks to Yarchik for noting that the domain of H was wrong. It should be right now, but in case there's an error I want to integrate over all the vectors for which H is defined.
Edit: I also realised that I was writing the end to end distance in a wrong way. As Yarchik pointed out, the way I was writing it I was computing the position of the center of mass, while now I'm actually computing the average end to end squared distance.