Line Integral:Find $\int_{\mathbf{C}}^{} (1+2z+3z^{2}+4z^{3}) \text{d}z$ $C=\left\{e^{i\theta}:0 \leq\theta\leq\pi\right\}$, Find $$\int_{\mathbf{C}} (1+2z+3z^2+4z^3) \, \text{d}z$$
I'm a little bit confused about $z$. The problem does not give a specific $z$. How can I solve it?
 A: $f\left(z\right) = 1 + 2z + 3z^2 + 4z^3$ is a polynomial, so it's analytic, and we can integrate along any path. So, just integrate along the real axis from $x = \exp\left(i \times 0\right) = 1$ to $x = \exp\left(i \times \pi\right) = -1$, where $x$ is the real part of $z$:
$$
\int_1^{-1} dx \left(1+2x+3x^2+4x^3\right) = \int_1^{-1} dx \left(1+3x^2\right) = -4
$$
EDIT: The first expression on the right hand side follows from the left hand side because $x$ and $x^3$ are odd functions. That is, if $g\left(x\right) = -g\left(-x\right)$, then
$$
\begin{eqnarray}
\int_{-a}^a dx \ g\left(x\right) &=& \int_{-a}^0 dx \ g\left(x\right) + \int_{0}^a dx \  g\left(x\right) \\
&=& \int_{-a}^0 dx \ g\left(x\right) - \int_{0}^a dx \ g\left(-x\right) \\
&=& \int_{-a}^0 dx \ g\left(x\right) + \int_{0}^{-a} du \ g\left(u\right) \\
&=& \int_{-a}^0 dx \ g\left(x\right) - \int_{-a}^{0} du \ g\left(u\right) \\
&=& 0
\end{eqnarray}
$$
A: $z$ is along the contour $C$, where $C = \{e^{i t}: t \in (0, \pi)\}$ i.e. $z^n = e^{int}$ and hence $dz = i e^{it} dt$.
A: The function is a polynomial, and polynomials are differentiable everywhere in the plane.  Therefore its integral along any path that returns to its starting point is $0$.  That is Cauchy's integral theorem.  In order that an integral of a function along a closed path in the plane be something other than $0$, the function must fail to be differentiable at some point that the path surrounds.
Update: So the arc does not return to its starting point.  BUT we can still use the fact that the function is differentiable everywhere in the plane.  When that happens, all you have to do is find an antiderivative, plug in the endpoints, and subtract, just as if you were doing calculus with real numbers.  In this case the endpoints are $e^{i0}=1$ and $e^{i\pi}=-1$.
The reason it's not always the same as in first-year calculus is that you have functions like $z\mapsto1/z$ that fail to be differentiable somewhere---in this example at $0$.  One path goes from $1$ to $-1$ in the upper half-plane and the other in the lower.  In a neighborhood of one path there is an antiderivative; the neighborhood of the other path another antiderivatives.  The two antiderivatives are the same in a neighborhood of $1$ and differ by a constant in a neighborhood of $-1$.  The integrals along the two paths differ.  No such problem happens with everywhere-differentiable functions like the one in the question.
A: A hint: 
There is a complex version of the calculus theorem $\int_a^b f(x)\ dx=F(b)-F(a)$, which reads as follows: If $C$ is a curve from $a$ to $b$ in a domain $\Omega$ where the function $z\mapsto f(z)$ is analytic, then
$$\int\nolimits_C f(z)\ dz=F(b)-F(a)\ ,$$
where $F$ is any primitive of $f$ in $\Omega$. Whence, if you can "guess" a primitive of the given $f$, you can obtain the value of the integral more or less for free.
The letter $z$ here is the "integration variable". The integral $\int_C f(z)\ dz$ can be considered as a limit of Riemann sums $\sum_{k=1}^N f(z_k)\ (z_k-z_{k-1})$, where the points $a=z_0$, $z_1$, $z_2$, $\ldots$, $z_N=b$ constitute a "piecewise linear approximation" of $C$.
