closed $1$-form that is exact Let $\alpha=\sum_{i=1}^n f_idx_i$ be a closed $1$-form defined on all of $\mathbb{R}^n$. Verify that the function $g(\textbf{x})=\sum_{i=1}^nx_i\int_0^1f_i(t\textbf{x})dt$ satisfies $dg=\alpha$.
Proof.
we must show that $\frac{\partial g}{\partial x_i}=f_i$. Then
\begin{align}
\frac{\partial g}{\partial x_j}(\textbf{x})&=\frac{\partial }{\partial x_j}\left(\sum_{i=1}^n x_i\int_0^1f_i(t\textbf{x})dt\right)\\
&=\sum_{i=1}^n \frac{\partial }{\partial x_j}\left( x_i\int_0^1f_i(t\textbf{x})dt\right)\\
&=\sum_{i=1}^n\left( \frac{\partial }{\partial x_j}x_i\int_0^1f_i(t\textbf{x})dt+x_i\frac{\partial }{\partial x_j}\int_0^1f_i(t\textbf{x})dt\right)\\
&=\sum_{i=1}^n\left(\frac{\partial }{\partial x_j}x_i\int_0^1f_i(t\textbf{x})dt\right)+\sum_{i=1}^nx_i\int_0^1\frac{\partial}{\partial x_j}f_i(t\textbf{x})dt\\
&=\int_0^1f_j(t\textbf{x})dt+\sum_{i=1}^nx_i\int_0^1\frac{\partial}{\partial x_j}f_i(t\textbf{x})dt
\end{align}
I don't know how to continue
 A: The important step is that since $\alpha$ is closed you have $d\alpha=0$, giving $\frac{\partial f_i}{\partial x_j} = \frac{\partial f_j}{\partial x_i}$.
Write $f_j(t {\bf x})= (\frac{\partial}{\partial t} t)\ f_j(t {\bf x})$,
then with partial integration you get
$$\int_0^1dt\ f_j(t {\bf x})= {\large[}tf_j(t \textbf{x}){\large]}_{t=0}^{t=1}-\int_0^1dt\ t\ \frac\partial{\partial t} f_j(tx_1,tx_2,...,tx_n)$$
Now you max expand $\frac{\partial}{\partial t}f_j(t\mathbf x)$ with the chain rule. What you get is (letting $Df_j$ denote the differential of $f_j$)
$$\frac{\partial}{\partial t}f_j(t\mathbf x)=\sum_i [Df_j]_i \cdot \frac\partial{\partial_t}(t\mathbf x)_i = \sum_i [\partial_i f_j](t\mathbf x)\  x_i.$$
Here $\partial_i f_j$ is the $i$-th component of the Jacobian of $f_j$, ie $\partial_i f_j (\mathbf x) = \frac{\partial}{\partial x_i}f_j(\mathbf x)$, this notation is adopted instead of using $\frac\partial{\partial x_i}f$ because the derivative $f$ is evaluated at the point $t\mathbf x$, writing $\frac{\partial}{\partial x_i}f(t\mathbf x)$ would give an extra factor of $t$.
Anyway in the last equation you may further use $\partial_i f_j = \partial_j f_i$ since $\alpha$ is closed. Plugging in the form for $\frac{\partial}{\partial t}f_j(t\mathbf x)$ into the integral then gives:
$$\int_0^1dt\ t\ \frac\partial{\partial t} f_j(tx_1,tx_2,...,tx_n)=\int_0^t dt\ t\sum_i x_i \partial_j f_i(tx_1,...,x_n)\\
=\int_0^1 dt\ t\sum_i x_i\ \frac1t \frac \partial{\partial x_j}\ f_i(t x_1,...,tx_n)$$
This final term is the same as the term on the right of OPs last equation. So if we plug in the expression for $\int_0^1 f_j(t\mathbf x)\ dt$ we have just derived into OPs expression we get:
$$\frac{\partial}{\partial x_j} g({\bf x})=f_j({\bf x})$$
giving $$dg=\sum_j f_j({\bf x}) dx_j.$$
