Evaluating a complex line integral Suppose $f(z) = y $. I want to find $\int_{\gamma} y $ where $\gamma$ is the curve joining the line segments $0$ to $i$ and then to $i+2$.
Try:
Let $\gamma_1(t) = it $ there $ 0 \leq t \leq 1 $ and $\gamma_2 = t + i $ where $0 \leq t \leq 2 $. So,
$$ \int_{\gamma} y = \int_{\gamma_1} y dz + \int_{\gamma_2} y dz = \int_0^1 it i dt + \int_0^2 i dt = \int_0^1 - t dt  + i 2 = -\frac{1}{2} + 2i  $$
IS this correct?

We have $f(z)=y$ on $\gamma$.
On $\gamma_1$, $z=it$ and $dz=idt$.  Thus, $y=t$ and 
$$\int_{\gamma_1}f(z)\,dz=\int_0^1t(idt)=\frac{i}{2}$$
On $\gamma_2$, $z=t+i$ and $dz=dt$.  Thus, $y=1$
$$\int_{\gamma_2}f(z)\,dz=\int_0^21(dt)=2$$
