Show that $\int_C y\,dz=-S$ 
Let $C$ be a simple closed contour bounding an area $S$. Prove that 
  $$\displaystyle{\int_{C}y\,dz}=-S.$$

Let $u(x,y)=0,\,v(x,y)=y$, which leads to $v_y=1$ and $u_x=u_y=v_x=0$, so that
$$\displaystyle{\int_{C}y\,dz}=\displaystyle{\iint_S\left(-v_x-u_y\right)dA}+{i\mkern1mu}\displaystyle{\iint_S\left(u_x-v_y\right)dA}=-{i\mkern1mu}\displaystyle{\iint_SdA}=-{i\mkern1mu}S.$$
The following approach, however, gives the correct result
$$\displaystyle{\int_{C}y\,dz}=\displaystyle{\int_{C}y\,d(x+{i\mkern1mu}y)}=\displaystyle{\int_{C}\left(y\,dx+iy\,dy\right)}=-\iint_S\,dA=-S.$$
Why is the first one wrong? The fact that $\Im(z)$ is not analytic in C?
 A: If $\gamma:[0,1]\longrightarrow \Bbb C$ is a parametrization of $C$ with $\gamma(t) = x(t) + i y(t)$, where $x$ and $y$ are real,  and $f(z) = \Im(z)$ then we have
\begin{align}
\int_C\,y\,dz
&=
\int_0^1\,f\big(\gamma(t)\big)\,\gamma'(t)\,dt
\\&=
\int_0^1 y(t)\,\big(x'(t)+iy'(t)\big)\,dt
\\&=
\int_0^1 y(t)x'(t)\,dt + i\cdot \int_0^1\,y(t)\,y'(t)\,dt
\\&=
\int_0^1 y(t)x'(t)\,dt + i\cdot \underbrace{\int_0^1\,{\left(\frac{{y(t)}^2}2\right)}'\,dt}_{(*)}
\,\,\,,\end{align}
and $(*)$ is $0$ because the contour is closed, ie, $\gamma(0)=\gamma(1) \implies y(0) = y(1)$.
Hence:
$$\int_C\,y\,dz
=
\int_0^1 y(t)x'(t)\,dt. \tag{1}$$
Finally, apply Green's Theorem to the area $S$ with $P(x,y) = y$ and $Q(x,y)=0$ to obtain that
$$S = -\int_0^1\,y(t)x'(t)\,dt,$$
so that with $(1)$ we conclude $\int_C\,y\,dz = -S$.

In general, if $z=x+iy$ with $x,y\in\Bbb R$ and $f(z) = u(x,y) + iv(x,y)$ with $u,v:\Bbb R^2\longrightarrow \Bbb R$ then
\begin{align}
\int_C\,f\,dz
&=
\int_0^1\,f\big(\gamma(t)\big)\,\gamma'(t)\,dt
\\&=
\int_0^1\,\Big(u\big(x(t),y(t)\big) + iv\big(x(t),y(t)\big)\Big) \,\big(x'(t)+iy'(t)\big)\,dt
\\&=
\int_0^1\,\Big[u\big(x(t),y(t)\big)\cdot x'(t) - v\big(x(t),y(t)\big)\cdot y'(t)\Big]\,dt
+i\int_0^1\,\Big[u\big(x(t),y(t)\big)\cdot y'(t) + v\big(x(t),y(t)\big)\cdot x'(t)\Big]\,dt
\\&=
\int_C\,u\,dx-v\,dy + i\int_C\,v\,dx+u\,dy
\\&=
\iint_D\,(-v_x-u_y)\,dx\,dy + i\iint_D\,(u_x-v_y)\,dx\,dy
,\end{align}
where in the last equality we invoked Green's Theorem.
Notice that all previous steps follow from the definition of complex integration and do not depend on analyticity or Cauchy-Riemann equations.
