Poincaré lemma for star shaped domain

Because the lost link of the accepted answer, I will post a proof here.

Lemma: Let be $E\subset{\Bbb R}^n$ star-shaped respect to $0$ and ${\bf F}:E\longrightarrow{\Bbb R}^n$ a $C^1$ vector field. We define: $$ h:{\Bbb R}^n\longrightarrow{\Bbb R}^n,\qquad h(x) = tx,\qquad t\in{\Bbb R}; $$ $$ g:[0,1]\longrightarrow{\Bbb R}^n,\qquad g(t) = t{\bf F}(tx),\qquad x\in{\Bbb R}^n; $$ $$ \phi:E\longrightarrow{\Bbb R},\qquad \phi(x) = {\bf F}(tx)\cdot x = \sum_{i=1}^n F_i(tx) x_i,\qquad t\in{\Bbb R}. $$ Then, we have the following equalities ($D =$ differential, superscript $t =$ transpose): $$Dh(x) = tI;$$ $$g'(t) = {\bf F}(tx) + t D{\bf F}(tx)x;$$ $$D\phi(x) = t x^t D{\bf F}(tx) + {\bf F}(tx)^t.$$

Proof: The first two are obvious and $D\phi(x)$ is a row vector with components: $$ \partial_j \phi(x) = \sum_{i=1}^n\partial_j(F_i\circ h)(x) + F_j(tx) = $$ $$ \sum_{i=1}^n x_i\sum_{k=1}^n(\partial_k F_i)(tx)\partial_j h(x)+ F_j(tx) = $$ $$\sum_{i=1}^n x_i(\partial_j F_i)(tx) t+ F_j(tx),$$ so $$D\phi(x) = (\partial_1\phi(x),\cdots,\partial_n\phi(x)) =$$ $$ t(x_1,\cdots,x_n) \begin{pmatrix} \partial_1 F_1(tx)&\dots&\partial_n F_1(tx)\\\ \vdots&\ddots&\vdots\\\ \partial_1 F_n(tx)&\dots&\partial_n F_n(tx) \end{pmatrix} + (F_1(tx),\cdots,F_n(tx)) = t x^t D{\bf F}(tx) + {\bf F}(tx)^t.\Box $$

Theorem (Poincaré Lemma): Let be $E\subset{\Bbb R}^n$ star-shaped and ${\bf F}:E\longrightarrow{\Bbb R}^n$ a $C^1$ vector field s.t. for $i,j = 1,\cdots,n: \partial_i F_j = \partial_j F_i$. Then, exists a scalar field (potential of ${\bf F}$) $f:E\longrightarrow{\Bbb R}$ with ${\bf F} = \nabla f$.

Proof: WLOG, we can suppose $E$ star-shaped respect to $0$. Let be $$f(x)=\int_0^1 {\bf F}(tx)\cdot x\,dt.$$ By derivation under the integral sign an the previous lemma, $$ D f(x) = \int_0^1 D\phi(x)\,dt = \int_0^1(t x^t D{\bf F}(tx) + {\bf F}(tx)^t)\,dt. $$ Gradient is simply the transpose of differential and by hypothesis $D{\bf F}(tx)$ is symmetric: $$ \nabla f(x) = D f(x)^t = \int_0^1(t D{\bf F}(tx)^t x + {\bf F}(tx))\,dt = \int_0^1(t D{\bf F}(tx) x + {\bf F}(tx))\,dt.$$ By the previous lemma again: $$ \nabla f(x) = \int_0^1 g'(t)\, dt = g(1) - g(0) = 1{\bf F}(1x) - 0{\bf F}(0x) = {\bf F}(x).\Box $$


B. Dacorogna has a proof that at least does not invoke the Stokes theorem explicitly.