I want to evaluate $$\int\limits_{\Gamma}|z|^2 dz$$ where $\Gamma$ is the boundary of a square with vertices at $0,1,1+i,i$, traversed anti-clockwise starting at $0$.
I realize the square is a closed contour but $|z|^2$ is not differentiable so I can't use the fundamental theorem of calculus. Is there a way of defining $|z|^2$ so that it has an antiderivative or another neat way?
This problem is crying for a direct parameterization of the integral. For example,
$$\int_{[0, 1]} |z|^2 \, dz = \int_0^1 t^2 \, dt = \frac 1 3.$$
The right hand side is given by
$$\int_{[1, 1 + i]} |z|^2 \, dz = \int_0^1 |1 + it|^2 \, d(1 + it) = i \int_0^1 1 + t^2 \, dt$$
and so on.