Compute the line integral $\int_\gamma g \cdot dx $ for an arbitrary piecewise smooth curve $\gamma$ traversing in the upper half plane from $(-a,0)$ to $(b,0)$ where $a > 0$ and $b>0$.
$g(x,y)$ and $f(x,y)$ are vector fields on $D=\mathbb R^2 \{(0,0)\}$ defined by
$$ g(x,y) = f(x,y)+\left( \frac{-y}{x^2+y^2 } , \frac{x}{x^2+y^2}\right)$$ and
$$ f (x,y)=\left(\frac{x}{x^2+y^2}+3x^2 y+y^2+2x , \frac{y}{x^2+y^2}+x^3+2xy \right)$$
I know the potential for f(x,y) is $\frac{1}{2}$ln($x^2$+$y^2$)+$x^3y+y^2x+x^2$+k
How do I combine the two parts of function g(x,y)to find its potential?
Hint:
Observe that
$$\frac{\partial}{\partial y}\left(\frac x{x^2+y^2}+3x^2y+y^2+2x\right)=\frac{\partial}{\partial x}\left(\frac y{x^2+y^2}+x^3+2xy\right)$$
and also
$$\frac{\partial}{\partial y}\left(\frac{-y}{x^2+y^2}\right)=\frac{\partial}{\partial x}\left(\frac x{x^2+y^2}\right)$$
so that $\;g\;$ is a conservative field in the given integration region (why?) and thus all you have to do is find its potential.
Added on request: The last equality follows from:
$$\begin{align}&\text{Left Side:}\;\;\;\frac{-x^2-y^2+2y^2}{(x^2+y^2)^2}=\frac{y^2-x^2}{(x^2+y^2)^2}\\{}\\ &\text{Right Side}:\;\;\;\frac{x^2+y^2-2x^2}{(x^2+y^2)^2}=\frac{y^2-x^2}{(x^2+y^2)^2}\end{align}$$