Contour Integration of Line Segments I am trying to use contour integration to find the integral of:
$$ \int_\gamma ydz $$
where we have the union of line segments from $0$ to $i$ and then to $i+2$.
I simply do not understand how to do this. I missed the lecture on the introduction to this due to being sick.
I attempted to do:
$$ \int_0^i ydz + \int_i^{i+2} ydz $$ but did not get the right answer, which is $2+\frac{i}{2}$.I believe we are supposed to use Parameterization but I don't understand how to Parameterize a curve.
 A: Let $\gamma_1$ be the line segment from $0$ to $i$, and let $\gamma_2$ be the line segment from $i$ to $i+2$. Then $\gamma = \gamma_1 + \gamma_2$, and so $$\int_\gamma y\, dz = \int_{\gamma_1} y\, dz + \int_{\gamma_2} y\, dz.$$ Parametrize $\gamma_1$ by setting $z = it$, $0 \le t \le 1$. Then $$\int_{\gamma_1} y\, dz = \int_0^1 t (i\, dt) = i \int_0^1 t\, dt = \frac{i}{2}.$$ Parametrize $\gamma_2$ by setting $z = t + i$, $0 \le t \le 2$. Then 
$$\int_{\gamma_2} y\, dz = \int_0^2 1\, dt = 2.$$
Thus 
$$\int_{\gamma} y\, dz = 2 + \frac{i}{2}.$$
A: Let, $z=x+iy$. Then , $dz=dx+idy$.

Remember that any complex number of the form $x+iy$ represents the order pair $(x,y)$.

So, $0$ to $i$ means from the point $(0,0)$ to the point $(0,1)$. That means when $x=0$ then take limit of $y$ as $0$ to $1$. Now, $x=0\implies dx=0.$ 
Similarly, $i$ to $i+2$ means from the point $(0,1)$ to the point $(2,1)$. That means when $y=1$ then take the limit of $x$ as $0$ to $2$. Now, $y=1\implies dy=0$.
See the following figure for the line integral.

Then, $$\int_{\gamma}ydz=\int_{y=0}^{1}y(idy)+\int_{x=0}^{2}1.dx=\frac{i}{2}+2$$
A: $$\int_\gamma ydz=\int_{\gamma_1}ydz+\int_{\gamma_2}ydz$$
then
$$\begin{align}
\int_{\gamma_1}ydz\\
z&=it,0\le t\le 1\\
dz&=idt\\
y&=t\\
\int_{\gamma_1}ydz&=\int_0^1(t)(idt)\\
&=i\int_0^1tdt\\
&=i\left.\frac{t^2}{2}\right|_0^1\\
&=\frac{i}{2}\end{align}$$
and
$$\begin{align}
\int_{\gamma_2}ydz\\
z&=t+i,0\le t\le 2\\
dz&=dt\\
y&=1\\
\int_{\gamma_2}ydz&=\int_0^2(1)(dt)\\
&=\int_0^2dt\\
&=2\end{align}$$
wich gives
$$\begin{align}
\int_\gamma ydz&=\int_{\gamma_1}ydz+\int_{\gamma_2}ydz\\
&=2+\frac{i}{2}
\end{align}$$
