Help understanding the complex integral of $f(z) = 1$ on the unit circle. I'm trying to understand doing complex integrals on the unit circle and I think I'm confusing myself. Here is what I'm doing:
Let $f(z) = 1$ be the constant function and I want to evaluate its integral on the unit circle.
Method 1: its just constant and the area under a constant is just the length of path which, in this case, is $2\pi$
Method 2: Let $z(t)=e^{it}$ for $t\in[0,2\pi)$ and so $z'(t)=ie^{it}$. So we can do
$\int_0^{2\pi}{f(z(t)) \cdot z'(t)\, dt} = \int_0^{2\pi}{1 \cdot ie^{it}\,dt} = e^{it}\Bigr|_0^{2\pi}=1-1=0$
These can't both be right. I know, with angles, we can say $2\pi=0$ but the area under a curve can't be both $2\pi$ and $0$. The answer in method 1 seems right to me if I imagine it geometrically but I can't figure what I'm doing wrong in method 2.
 A: That integral is equal to $0$. The idea “the integral is the area below the graph” is an intuitive approach for the value of integrals of functions from an interval  $[a,b]$ into $[0,\infty)$.
A: The definition of complex integral you're using involves adding up little bits $\mathrm dz=\mathrm dx+i\mathrm dy$ along the curve, analogous to $\mathrm d\mathbf r=\langle\mathrm dx,\mathrm dy\rangle$ in multivariable calculus. In a typical multivariable calculus class, you wouldn't normally evaluate integrals that output a vector, but it's perfectly valid to do a calculation like:
\begin{align}&\,\,\int_C 1\mathrm d\mathbf r
\\&=\int_C \langle\mathrm dx,\mathrm dy\rangle
\\&=\int_0^{2\pi} \langle x'(t)\mathrm dt,y'(t)\mathrm dt\rangle
\\&= \langle \int_0^{2\pi} \cos'(t)\mathrm dt, \int_0^{2\pi} \sin'(t)\mathrm dt\rangle
\\&= \langle \int_0^{2\pi} -\sin(t)\mathrm dt, \int_0^{2\pi} \cos(t)\mathrm dt\rangle
\\&= \langle 0, 0\rangle
\end{align}
And $\langle 0, 0\rangle$ is just like the complex $0$ you obtained.
In contrast, the "constant times the length of the path" idea is calculating:
\begin{align}&\,\,\int_C 1\mathrm d r
\\&=\int_C  \Vert\mathrm d\mathbf r\Vert
\\&=\int_C \Vert\langle\mathrm dx,\mathrm dy\rangle\Vert
\\&=\int_0^{2\pi} \sqrt{(x'(t))^2+(y'(t))^2}\mathrm dt
\\&=\int_0^{2\pi} \sqrt{(-\sin(t))^2+(\cos(t))^2}\mathrm dt
\\&=\int_0^{2\pi} 1\mathrm dt
\\&=2\pi
\end{align}

This wasn't what you asked, but here's a related thing to think about:
If you hadn't integrated a real-valued function, then you wouldn't have thought about $\int_C f(x,y)\mathrm d r$, but might have thought about $\int_C \mathbf F(x,y)\cdot\mathrm d \mathbf r$, which involves a dot product. In that case, the thing to keep in mind is that what complex multiplication does with two complex numbers looks very different than how the dot product of two 2D vectors looks. For one thing, the dot product always returns a real number, not a vector/complex number.
