Show that $h$ is a smooth function with $dh = \omega$ I don't understand a few parts of Professor Nelson's proof of problem 9.3(b) (link). I'll provide the proof, then ask questions at the end.
Lemma and Proof.

Lemma. Let $\omega \in \Omega^1(\mathbb{R}^2)$ (a 1-form over $\mathbb{R}^2$) and $d \omega = 0$. Fix $p \in \mathbb{R}^2$. Define $\varphi_q(t) := (1-t)p + tq$ and $h(q) := \int_{\varphi_q} \omega$. Show that $h$ is a smooth
function with $dh = \omega$.

Since $\omega \in \Omega^1(\mathbb{R}^2)$, we have $\omega = fdx + gdy$ for smooth functions $f,g : \mathbb{R}^2 \rightarrow \mathbb{R}$.
Now compute
\begin{align} 
h(q) 
    &= \int _{\varphi_q} \omega \nonumber \\
    &= \int _{\varphi_q} fdx + gdy \nonumber \\
    \tag{1} &= \int_0^1 f \circ \varphi_q(t)(q_1 - p_1) + g \circ \varphi_q(t)(q_2-p_2)~dt.
\end{align}
We observe from (1) that h is smooth: $f$ and $g$ being smooth functions implies all orders of partial derivatives of $h$ exist.
Lastly, we compute $dh$:
\begin{align}
    \frac {\partial h} {\partial q_1}
    &= \left(\int_0^1 
        \frac {\partial} {\partial q_1} 
            [f \circ \varphi_q(t)(q_1 - p_1)] 
        + \frac {\partial} {\partial q_2} 
            [g \circ \varphi_q(t)(q_2 - p_2)]~dt \right)~dq_2 \tag{2} \\
    &= \int_0^1 \frac {\partial f(\varphi_q(t))} {\partial x} t (q_1 - p_1) + f \circ \varphi_q(t)
    + \frac {\partial g(\varphi_q(t))} {\partial x} t (q_2 - p_2)~dt \tag{3}
\end{align}
From $d \omega = 0$, we have
$$ \frac {\partial g} {\partial x} = \frac {\partial f} {\partial y}. \tag{3.1}$$
Thus we continue the above computation with
\begin{align}
    \frac {\partial h} {\partial q_1}
    &= \int_0^1 (Df)_{\varphi_q(t)}(q-p)t + f \circ \varphi_q(t)~dt \tag{4} \\
    &= \int_0^1 \frac {d} {dt} [f \circ \varphi_q(t)t]~dt \nonumber \\
    &= f \circ \varphi_q(1) - 0 = f(q) \tag{5}
\end{align}
where we invoked the Fundamental Theorem of Calculus in (5). A similar computation yields $\frac {\partial h} {\partial q_2} = g(q)$. It follows that $dh = \omega$. $\square$
Things I don't understand.

*

*(possibly solved, see update below) See (2). I don't understand how to compute the partial derivative of an integral in general.
--> 1.1. I don't understand why the first term in the integrand is with respect to $q_1$, the second with respect to $q_2$.
--> 1.2. I don't understand why the integral is multiplied by $d q_2$.


*I don't understand the move from partial derivatives in the integrand of (3) to the directional derivative in the integrand of (4). I'm realizing that I don't know how to evaluate $ (D f)_{\varphi_q(t)}(q-p)t$ in terms of partial derivatives of $f$.


*(Possibly solved, see last sentence) I don't follow why $ \frac{\partial h} {\partial q_1} = f(q)$ and $ \frac{\partial h} {\partial q_2} = g(q)$ imply that $d h = \omega$. Based on my understanding of the exterior derivative, I had thought this implies $d h = f(q) d {q_1} + g(q) d {q_2}$. And upon further reflection, I think that is equal to $\omega$ with appropriate relabeling of the dependent variables.
Update
Here's what I believe I corrected version of (2) should be, and this would fully answer my question in Things I don't understand #1 (1.1 and 1.2). Note that this appears to be a typo in Professor Nelson's homework solution.
$$
\frac {\partial h} {\partial q_1} = \int_0^1 \frac {\partial} {\partial q_1} [ f \circ \varphi_q(t)(q_1-p_1) ] + \frac {\partial} {\partial q_1} [ g \circ \varphi_q(t)(q_2 - p_2)]~dt \tag {2*}
$$
Lastly, I fixed my own typo in the equation immediately below (3), which had originally read $\frac {\partial g} {\partial x} = \frac {\partial f} {\partial x}$.
Assuming this is correct, my only remaining question is #2 -- not bad solving 2/3 of my issues!
 A: Ted Shifrin was certainly correct that this was a confusing exposition -- I left out 2 important details in the lemma, and committed a typo in the proof. Apologies to the community! I believe the typos and omissions are fixed, so here's my attempt at an answer to my own "thing's I don't understand" 1-3.
Issue 1
Yes, (2*) (in the Update section at the bottom) has the correct method for calculating $\partial_{q_1} h$.
Issue 2
\begin{align}
\frac {\partial f(\varphi_q(t))} {\partial x} t (q_1 - p_1) + \frac {\partial g(\varphi_q(t))} {\partial x} t (q_2 - p_2)
& = \frac {\partial f(\varphi_q(t))} {\partial x} t (q_1 - p_1) + \frac {\partial f(\varphi_q(t))} {\partial y} t (q_2 - p_2) \tag{6} \\
& = 
\begin{bmatrix}
\partial_x f(\varphi_q(t)) & \partial_y f(\varphi_q(t))
\end{bmatrix}
\begin{bmatrix}
q_1 - p_1 \\ 
q_2 - p_2
\end{bmatrix} t \\
&= (D f)_{\varphi_q(t)}(q-p)t \tag{7}
\end{align}
where (6) uses (3.1), and (7) follows immediately from the definition of a directional derivative.
Issue 3
Yes, the explanation in 3 is correct. We have
$$
d h = f(q) d {q_1} + g(q) d {q_2} = \omega
$$
and this observation completes the proof.
