Writing an exact differential form as the differential of a scalar function Problem:
Is $\omega = (x^2 + y^2)\mathrm{d}x + 2xy \mathrm{d}y$ an exact differential form? If so, write it as the differential of a scalar.
Integrating over a closed curve (the unit circle in this case)
$$\int_\gamma \omega = \int_\gamma (x^2 + y^2)\mathrm{d}x + 2xy \mathrm{d}y = \int_0^{2\pi} (-\sin(\theta) +2\cos^2(\theta) \sin(\theta))\mathrm{d}\theta = 0$$
An exact differential form can be written as (in this case, for 2 dimensions)
$$\mathrm{d}z = \frac{\partial z}{\partial x}\mathrm{d}x+ \frac{\partial z}{\partial y}\mathrm{d}y$$ where $z = f(x,y)$.
How can I find such a function? I feel this is a really basic thing that I am missing but I can't find it.
 A: I think I solved it. Is this a procedure I can exploit for future questions or is this a method that works only with polynomial functions?
$$\mathrm{d}f = \frac{\partial f}{\partial x} \mathrm{d}x + \frac{\partial f}{\partial y}\mathrm{d}y = (x^2 + y^2) \mathrm{d}x + 2xy\mathrm{d}y$$
$$\int \mathrm{d} f = \int (x^2 + y^2 )\mathrm{d}y \therefore f(x,y) = \frac{x^3}{3} + y^2x + g(y)$$
$$\frac{\partial f}{\partial y} = 2xy + \frac{\mathrm{d}g(y)}{\mathrm{d}y} = 2xy \therefore \frac{\mathrm{d}g(y)}{\mathrm{d}y} = 0\therefore g(y) = k \in \mathbb{R}$$
Putting everything together
$$f(x,y) = \frac{x^3}{3} + y^2x+k$$
This scalar function fulfills the requirements since
$$\frac{\partial f}{\partial x} = x^2 + y^2$$
$$\frac{\partial f}{\partial y} = 2xy$$
A: Suppose you have a differential form of the kind
$$\alpha:=\sum_{k=1}^n a_kdx^k$$
Then $\alpha$ is defined as a closed differential 1-form if and only if $\partial_j a_k=\partial_ka_j$ for all $j\neq k$.
If $\alpha$ is closed and it domain is simply connected then it have an antiderivative (however it is possible for some closed forms to have an antiderivative in a non-simply connected domain). This is a kind of generalized Poincaré lemma.
In our case we have that $\partial_y(x^2+y^2)=\partial_x(2xy)$ so $\omega$ is closed. Moreover: $\Bbb R^2$ is convex, hence simply connected, so $\omega$ have an antiderivative in $\Bbb R^2$. This imply that
$$\int_{\Gamma(z_0,z)}\omega=\Omega(z)-\Omega(z_0)$$
for some antiderivative $\Omega$, with $z:=(x,y)$ and $\Gamma(z_0,z)$ an arbitrary path (contained in the domain of $\omega$) that starts at the point $z_0$ and end at any point $z\in\Bbb R^2$.
Then in our case we can define an antiderivative of $\omega$ using the straight paths $[\![(0,0),(x,y)]\!]$ described by $\gamma_{(x,y)}:[0,1]\to\Bbb R^2,\, t\mapsto t(x,y)$, for any arbitrary $(x,y)\in\Bbb R^2$, thus
$$\Omega(x,y):=\int_{\gamma_{(x,y)}}\omega=\int_0^1 \langle(\omega\circ \gamma_{(x,y)})(t),\dot\gamma_{(x,y)}(t)\rangle dt\\
=(x^2+y^2)x\int_0^1 t^2 dt+2 xy^2\int_0^1 t^2 dt=\frac{x^3}3+xy^2$$
is an antiderivative of $\omega$. 
Observe that this is analogous to the way we define primitives of functions on the real line, but here we can choose any path freely to define antiderivatives, that is, any (enough regular) path that connect the points $(0,0)$ and $(x,y)$ will define the same antiderivative $\Omega$. That is, if instead of the straight paths $\gamma_{(x,y)}$ we choose the paths defined by any piecewise continuous $C^1$ differentiable $f:[0,1]\to\Bbb R$ with $f(1)\neq 0$
$$\delta_{f,(x,y)}:[0,1]\to\Bbb R^2,\quad t\mapsto t \frac{f(t)}{f(1)}(x,y)$$
we will find that
$$\int_{\gamma_{(x,y)}}\omega=\int_{\delta_{f,(x,y)}}\omega=\Omega(x,y)-\Omega(0,0)$$
A: Your form will be exact, on some domain D, if (and only if) $\partial_{y}(x^2+y^2)=\partial_{y}(2xy)$. 
If your form is exact than there exista a differentialble function $f=f(x,y)$ on domain D such that $df=(x^2+y^2)dx+(2xy)dy$. 
Maybe you will now be able to find such function? 
