Baby Rudin Exercise 10.24:
Let $\omega = \sum a_i(\mathbf x) \, dx_i$ be a $1$-form of class $\mathscr{C}''$ in a convex open set $E \subset \mathbb{R}^n$. Assume $d \omega = 0$ and show that $\omega$ is exact in $E$, by completing the following outline:
Fix $p \in E$, Define $$f(\mathbf{x}) = \int_{\bf [p,x]} \omega $$ and apply Stokes' theorem to affine-oriented 2-simplexes $\bf[p, x, y]$ in E. Deduce that
\begin{equation} f(\mathbf y) - f(\mathbf x) = \sum_{i=1}^n (y_i - x_i) \int_0^1 a_i((1-t) \mathbf x + t \mathbf y)\,dt \end{equation}
for $\mathbf x \in E, \mathbf y \in E$. Hence $(D_i f)(\mathbf x) = a_i(\mathbf x)$.
The boundary of $\bf[p, x, y]$ is $\bf [x, y] - [p, y] + [p, x]$, from which
$$f(\mathbf y) - f(\mathbf x) = \int_{\bf [x,y]} \omega= \int_{\bf [x,y]} \sum_{i=1}^n a_i(\mathbf x) \, dx_i$$
follows. Next take $\gamma(t) = (1-t) \mathbf x + t \mathbf y$ for $0 \leq t \leq 1$. This is a $1$-surface. By differentiation of $1$-forms, we have
$$\int_\gamma \omega = \int_{\bf [x, y]} \omega = \int_0^1 \sum_{i=1}^n a_i((1-t) \mathbf x + t \mathbf y)(y_i - x_i) \, dt$$
which is the same as what Rudin gives. At this point I'm not sure what to do. I suppose I should partially differentiate both sides with respect to one of the basis vectors of $\mathbb{R}^n$, but I'm not sure how to go forth with that.
Edit. I have followed JohnMa's advice and here is the rest of the solution (for verification and archival purposes):
Fix any $\mathbf x$ and and take $\mathbf y = \mathbf x + v \mathbf e_k$. Then $$ f(\mathbf x + v \mathbf e_k) - f(\mathbf x) = v \int_0^1 a_k ((1-t) \mathbf x + t (\mathbf x + v \mathbf e_k))\, dt = v \int_0^1 a_k(\mathbf x + tv \mathbf e_k) \, dt $$ Dividing by $v$ and taking $v \to 0$ gives $$ (D_k f)(\mathbf x) = a_k (\mathbf x) $$ since $a_k$ is continuous. Since $\mathbf{x}$ was arbitrary, we have $D_k f = a_k$ for $1 \leq k \leq n$, hence $$\omega = \sum_{i=1}^n (D_i f)(\mathbf x) \, dx_i = d f$$
Since $f$ is a $0$-form.