If ${\bf F} = \langle P, Q \rangle$ is conservative, by definition there is some function $f$ such that
$${\bf F} = \nabla f = (f_x, f_y).$$ (At least under the modest assumption that $f$ is $C^2$,) by Clairaut's Theorem the mixed partial derivatives of $f$ commute, and so
$$P_y = f_{xy} = f_{yx} = Q_x.$$
On the other hand, one can show that the resulting equality $$P_y = Q_x$$ is a sufficient condition, provided that the domain of $\bf F$ is simply connected (informally, has no holes).
Since $\bf F$ is conservative, one has at least two choices for evaluating the integral:
- Apply the Fundamental Theorem of Calculus for Line Integrals, which gives for $\bf F = \nabla f$ and a (say, piecewise $C^1$) curve $\gamma$ from $a$ to $b$ that $$\int_{\gamma} {\bf F} \cdot d{\bf s} = f(b) - f(a).$$ In our case, solving the p.d.e. system $$\left\{\begin{array}{rcl} f_x & = & (1 + xy) e^{xy} \\ f_y & = & x^2 e^{xy} \end{array}\right.$$ gives (e.g.) the potential $$f(x, y) = x e^{xy},$$ and so by the F.T.C., $$\int_C {\bf F} \cdot d{\bf s} = f(1, 0) - f(-1, 0) = (1) e^{(1)(0)} - (-1) e^{(-1)(0)} = 2.$$
- In particular, the F.T.C. implies that the value of the line integral is independent of the path connecting the endpoints of the given curve $C$, so we also evaluate it by finding a curve with the same endpoints and on which the form of $\bf F$ is particularly simple. In our case, it's convenient to choose the line segment $C'$ from $(-1, 0)$ to $(1, 0)$ oriented to the right, which we can parameterize by ${\bf r}(t) := (t, 0)$, $t \in [-1, 1].$ Then, evaluating directly gives
\begin{align}
\int_C {\bf F} \cdot d{\bf s}
&= \int_{C'} {\bf F} \cdot d{\bf s} \\
&= \int_{-1}^1 {\bf F}({\bf r}(t)) \cdot {\bf r}'(t) \,dt \\
&= \int_{-1}^1 ([1 + (t)(0)]e^{(t)(0)}, t^2 e^{(t)(0)}) \cdot (1, 0) \,dt \\
&= \int_{-1}^1 dt \\
&= 2.
\end{align}
Notice that the second method is easier in the sense that it does not require solving a system of p.d.e.s, and instead only requires computing a (very easy) integral.