Problem. Compute the following line integral:
$$\int_{\gamma} Re(z)dz,$$
where $\gamma$ is the line segment from 1 to $i$.
\begin{align*}
\gamma(t) &= (1-t)\cdot 1 + t \cdot i\\
&= (1-t)+it \tag*{where $t \in [0,1]$}\\
\gamma'(t) &= i-1
\end{align*}
Then, we compute the line integral:
\begin{align*}
\int_{\gamma}Re(z)dz &= \int_0^1 Re[(1-t)+it]\cdot(i-1) \,dt\\
&= \int_0^1 (1-t)(i-1) \,dt\\
&= (i-1) \int_0^1 (1-t) \,dt\\
&= (i-1)\left[t-\frac{1}{2}t^2\right]_{t=0}^{t=1}\\
&= (i-1)\left(1-\frac{1}{2}\right)\\
&= (i-1)\frac{1}{2}
\end{align*}
The line integral $\int_{\gamma} Re(z)dz$ where $\gamma$ is the line segment from 1 to $i$ is $(i-1)\frac{1}{2}$.