Let $\omega = a_1\cdot dx_1 + a_2 \cdot dx_2 \in \Omega^1 \mathbb{R}^2$. Show that if $d\omega = 0$, then $$f(x) = f(x_1,x_2) := x_1 \cdot \int_0^1 a_1(tx)dt + x_2 \cdot \int_0^1 a_2(tx)dt$$ $x \in \mathbb{R}^2$ defines a function $f \in \Omega^0 \mathbb{R}^2 = C^{\infty} (\mathbb{R}^2,\mathbb{R})$ with $df = \omega$.
I tried to derive this f, but I have some problems with dealing with the map h. We defined the derivative of f like this: For a chart (U,h,V) around p with coordinates $(x_1,..,x_n)$ in V we get: $$df(p) = \sum_{i=1}^n \frac{\partial (f\circ h^{-1})}{\partial x_i} (h(p)) \cdot dx_i(p)$$
I did this so far: Using this definition we get for our f: $$df(x) = \frac{(f\circ h^{-1})}{\partial x_1} (h(x)) \cdot dx_1(p) + \frac{(f\circ h^{-1})}{\partial x_2} (h(x)) \cdot dx_2(x)$$ Using the chain rule we get $$= (\frac{\partial f}{\partial x_1}\circ h^{-1}) (h(x)) \cdot \frac{\partial h^{-1}}{\partial x_1}(h(x)) \cdot dx_1(x) + (\frac{\partial f}{\partial x_2}\circ h^{-1}) (h(x)) \cdot \frac{\partial h^{-1}}{\partial x_2}(h(x)) \cdot dx_2(x)$$ $$= (\frac{\partial f}{\partial x_1} (x)) \cdot \frac{\partial h^{-1}}{\partial x_1}(h(x)) \cdot dx_1(x) + (\frac{\partial f}{\partial x_2}(x) \cdot \frac{\partial h^{-1}}{\partial x_2}(h(x)) \cdot dx_2(x)$$ $$= ((\int_0^1 a_1(tx)dt) \cdot \frac{\partial h^{-1}}{\partial x_1}(h(x)) \cdot dx_1(x) + ((\int_0^1 a_2(tx)d) \cdot \frac{\partial h^{-1}}{\partial x_2}(h(x)) \cdot dx_2(x)$$ but I am a bit lost at this point, since I would have to use the indefinite integral of the $a_i$ and I don't see how I could end up with $\omega$ in the end. Also, I am confused by the $\frac{\partial h^{-1}}{\partial x_i}(h(x))$. How could I do anything with them? It is just some map I don't know anything particular about.
You are complicating the issue by considering an arbitrary chart $h$. You are in $\mathbb{R}^2$, you don't need to choose a chart. (Or rather, you simply use the identity if you'd like to face it that way. Furthermore, the data is already being given in terms of the identity chart.)
You can do the computation as follows. \begin{align*} df&=dx_1(\int_0^1a_1(tx)dt)+x_1((\int_0^1\partial_1a_1(tx)tdt)dx_1+(\int_0^1\partial_2a_1(tx)tdt)dx_2) \\ &+dx_2(\int_0^1a_2(tx)dt)+x_2((\int_0^1\partial_1a_2(tx)tdt)dx_1+(\int_0^1\partial_2a_2(tx)tdt)dx_2) \\ &=\left(\int_0^1a_1(tx)dt+\int_0^1\partial_1a_1(tx)tx_1dt+\int_0^1\partial_1a_2(tx)tx_2dt\right)dx_1 \\ &+\left(\int_0^1a_2(tx)dt+\int_0^1\partial_2 a_1(tx)tx_1dt+\int_0^1\partial_2a_2(tx)tx_2dt\right)dx_2 \\ &=\left(\int_0^1a_1(tx)dt+\int_0^1t\partial_1a_1(tx)x_1dt+\int_0^1t\partial_2a_1(tx)x_2dt\right)dx_1 \\ &+\left(\int_0^1a_2(tx)dt+\int_0^1t\partial_1 a_2(tx)x_1dt+\int_0^1t\partial_2a_2(tx)x_2dt\right)dx_2 \\ &=\left(\int_0^1(t \cdot a_1(tx))'dt\right)dx_1 +\left(\int_0^1(t \cdot a_2(tx))'dt\right)dx_2 \\ &=a_1(x)dx_1+a_2(x)dx_2. \end{align*} The fact that $d\omega=0$ is used when we use that $\partial_2a_1=\partial_1a_2$.
Some things are worth noting.