Evaluate $\int_{\gamma}xdz$, where $\gamma$ is the circumference of the unit square.
The answer in the textbook constructed four subcurves $\gamma_{1},...,\gamma_{4}$ on intervals $[0,1],[1,2],[2,3],[3,4]$ so that $\gamma:[0,4]\to \mathbb{C}$ is then the sum of these curves. The answer they got was then $i$.
I wanted to see whether I could just define four line segments all on the interval $[0,1]$ that each connect to the appropriate endpoints $(1,-i), (1,i), (-1,i), (-1,-i)$. However I got the answer $4i$. Is my approach wrong though? Do I have to make sure $t$ varies in different intervals for each curve?
For example, I set one of my curves to be $\gamma_{1}:[0,1]\to \mathbb{C}$ by $\gamma_{1}=(1+i)t+(1-t)(1-i)$. This is the right vertical line segment on the unit square in counterclockwise direction. Then $Re(\gamma_{1})=1$ and $\gamma_{1}'=2i$. Then $\int_{\gamma_{1}}xdz=\int_{0}^{1}Re(\gamma_{1})\gamma_{1}'dt=2i$.
You have taken a certain square with side length $2$, hence the different result.
If you take the unit square in the first quadrant, with the origin as one vertex, then the integral breaks into four parts. You should get $i$, because the top and bottom integrals cancel, whereas the vertical one on the $y$-axis is $0$.