When is a path integrals just "ordinary integration"? I was wondering about this:
If you have the function $f(x)=x$ in the complex plane, then the path integral $\int_{\gamma}x dx $ for any path $\gamma$ connecting 0 and $z$ by a straight-line can be easily evaluated by using just proper integration. So the result will be $\int_{\gamma} x dx = \frac{z^2}{2} = \int_0^{z} x dx$(the last one considered to be an integral over $\mathbb{R}$). So, in that case it does not matter if you calculate the actual path integral or pretend that you are dealing with function $f: \mathbb{R} \rightarrow \mathbb{R}$ that you integrate over $[0,z]$. My question is: When it this handwavy-calculating possible? Just for polynomials? I.e. what is the requirement on the domain of $f$?
 A: It works if your function $f$ has an anti-derivative $F$ on a domain (open connected set) containing your curve. Note that by definition, $F$ is (complex-)differentiable or holomorphic. Derivatives of holomorphic functions are also holomorphic, so the  procedure will only work for holomorphic functions $f$. 
More precisely, if $F$ is an anti-derivative of $f$ (on a neighborhood of $\gamma$) and $\gamma$ is a curve from $z_0$ to $z_1$, then
$$
\int_\gamma f(z)\,dz = F(z_1)-F(z_0).
$$
In fact, the full story is a little more complicated. Not every holomorphic function  has an anti-derivative. For example, your procedure doesn't work for
$$
\int_{|z|=1} \frac{dz}{z}. 
$$
A computation of the integral gives $2\pi i$ as a result, whereas the value would have been $0$ if we were able to find an anti-derivative of $1/z$. (Since the curve is closed.) However, every holomorphic function on a simply connected domain has an anti-derivative. This result appears as a fairly central theorem in any decent textbook on complex analysis.
