contour integral piecewise Evaluate $$\int \limits_\gamma \frac1{z-1}dz$$
along the path:
$$\gamma(t) = \begin{cases}(1+i)t, & 0\leq t\leq 1 \\\\ t+i(2-t), & 1\leq t \leq2\end{cases}$$
I know how to do simple questions of these but I am unsure about this one. This is what I tried. Let $f(z)$ represent the equation given in the integral.
$$\gamma'(t) = \begin{cases}t+i, & 0\leq t\leq 1 \\\\ 1-i, & 1\leq t \leq2\end{cases}$$
and
$$f(\gamma(t)) = \begin{cases}\frac1{(1+i)t-1}, & 0\leq t\leq 1 \\\\ \frac1{t+i(2-t)-1}, & 1\leq t \leq2\end{cases}$$
Then what do you do?

Actually $\gamma'(t) = 1 + i$ for $0 \le t < 1$ and $\gamma'(t) = 1 - i$ for $1 < t \le 2$. So your contour integral becomes
$$\int_0^1 f(\gamma(t))\gamma'(t)\, dt + \int_1^2 f(\gamma(t))\gamma'(t)\, dt = \int_0^1 \frac{1 + i}{(1 + i)t - 1}\, dt + \int_1^2 \frac{1 - i}{t - 1 + (2-t)i}\, dt.$$
To evaluate the last two integrals, express
$$\frac{1 + i}{(1 + i)t - 1} = \frac{(1 + i)[(1 - i)t - 1]}{|(1 + i)t - 1|^2} = \frac{2t - 1 - i}{(t - 1)^2 + t^2} = \frac{2t - 1 - i}{2t^2 - 2t + 1}$$
and
$$\frac{1 - i}{(t - 1) + (2 - t)i} = \frac{(1 - i)[(t - 1) - (2 - t)i}{|(t - 1) + (2 - t)i|^2} = \frac{2t - 3 - i}{(t - 1)^2 + (2-t)^2} = \frac{2t - 3 - i}{2t^2 - 6t + 5}.$$
We have
\begin{align}\int_0^1 \frac{2t - 1 - i}{2t^2 - 2t + 1} \, dt &= \frac{1}{2}\int_0^1 \frac{4t - 2}{2t^2 - 2t + 1}\, dt - \int_0^1 \frac{i}{2t^2 - 2t + 1}\, dt\\
&= \frac{1}{2}\log|2t^2 - 2t + 1|\bigg|_{t = 0}^1 - \frac{i}{2}\int_0^1 \frac{dt}{(t - \frac{1}{2})^2 + \frac{1}{4}}\\
&= -\frac{i}{2}\int_0^1 \frac{dt}{(t - \frac{1}{2})^2 + \frac{1}{4}}\\
&= -\frac{i}{2}\cdot 2\arctan\left[2\left(t - \frac{1}{2}\right)\right]\bigg|_{t = 0}^1\\
&= -\frac{\pi}{2}i.
\end{align}
A similar argument gives
$$\int_1^2 \frac{2t - 3 - i}{2t^2 - 6t + 5}\, dt = -\frac{\pi}{2}i.$$
Therefore
$$\int_\gamma \frac{dz}{z-1} = -\frac{\pi}{2}i - \frac{\pi}{2}i = -\pi i.$$
