You missed some terms : for example we have $\displaystyle \displaystyle\int_{a_2}^{x_2}\dfrac{\partial f(x_1,t,a_3,\ldots,a_n)}{\partial x_2}\mathrm{d}t= f(x_1,x_2,a_3,\ldots,a_n)-f(x_1,a_2,a_3,\ldots,a_n)$.
Indeed it doesn't appear in the first term, but it appear in the others because it's not the same differentiation (here it is differentiation under the symbol $\displaystyle \int$).