# Prove an integral equality by divergence theorem

I was reading a text regarding to PDE, and I encountered a step which I didn't understand.

Let $$U$$ be an open and bounded set in $$\mathbb R^n$$ with smooth boundary. Let $$u\in W^{2,2}_0(U).$$

Now it says that by the divergence theorem, $$\int_U|D^2u|^2dx=\int_U\sum_{i,j=1}^n u_{x_i x_j}u_{x_i x_j}dx=\int_U\sum_{i,j=1}^n u_{x_i x_i}u_{x_j x_j}dx=\int_U |\Delta u|^2dx.$$

I don't really understand why do we have $$\int_U\sum_{i,j=1}^n u_{x_i x_j}u_{x_i x_j}dx=\int_U\sum_{i,j=1}^n u_{x_i x_i}u_{x_j x_j}dx.$$

The integrands look very different from each other and they have many terms which the other one doesn't have. Can any one help me with this?

Thanks for help.

Integration by parts (a corollary of the divergence theorem) yields $$$$\int_U u_{x_ix_j} u_{x_ix_j}\,dx = \int_{\partial U} u_{x_i} u_{x_ix_j}\nu^j \,dS(y) -\int_U u_{x_i} u_{x_ix_jx_j}\,dx,$$$$ where $$\nu(y) = (\nu^1(y),\nu^2(y),\cdots,\nu^n(y))$$ is the unit outward normal of $$\partial U$$ at $$y\in\partial U$$ and $$dS(y)$$ is the surface element of $$\partial U$$. Notice that the boundary term vanishes since $$u\in W^{2,2}_0(U)$$. Integrating by parts again, we have \begin{align} \int_U u_{x_ix_j} u_{x_ix_j}\,dx =& - \int_U u_{x_i} u_{x_ix_jx_j}\,dx \\ =& - \int_U u_{x_i} u_{x_jx_jx_i}\,dx \\ =& - \int_{\partial U}u_{x_i}u_{x_jx_j}\nu^i \,dS(y)+\int_{U}u_{x_ix_i}u_{x_jx_j}\,dx \\ =&\int_{U}u_{x_ix_i}u_{x_jx_j}\,dx, \end{align} which implies $$$$\int_U \sum\limits_{i,j=1}^n u_{x_ix_j} u_{x_ix_j}\,dx= \int_U \sum\limits_{i,j=1}^n u_{x_ix_i}u_{x_jx_j}\,dx.$$$$