Solution.

a) It is not difficult to understand that the integrand is a complete differential of the function $u=-y \cos 2 x$, i.e.

$$
\begin{gathered}
\int_{L} 2 y \sin 2 x d x-\cos 2 x d y=\int_{L} d u=u(B)-u(A)= \\
=-\cos \frac{\pi}{3}+2 \cos \pi=-2-\frac{1}{2}=-\frac{5}{2}
\end{gathered}
$$

b) In this problem, the function $u$ can be taken as the function $u=y(x-1) e^{x}: d u=y x e^{x} d x-(x-1) e^{x} d y$. Therefore,

$$
\int_{L} y x e^{x} d x-(x-1) e^{x} d y=\int_{L} d u=u(B)-u(A)=0 .
$$
2.5. Compute the specified line integrals of the second kind:

a) $\int_{L} 2 y \sin 2 x d x - \cos 2 x d y$, where $L$ is any piecewise-smooth curve connecting the points $A\left(\frac{\pi}{2}, 2\right)$ and $B\left(\frac{\pi}{6}, 1\right)$.

b) $\int_{L} y x e^{x} d x - (x-1) e^{x} d y$, where $L$ is any piecewise-smooth curve connecting the points $A(0,2)$ and $B(1,2)$.