I need to evaluate the same integral $$ \int_{\gamma} \frac{dz}{-z^2+3z} $$ where $\gamma$ is a triangle with vertices at $-1-i$, $2-i$ and $-1+2i$ three ways.
By the definition of a complex integral (writing $z = z(t)$ and writing the function as $u + iv$.
Using the Newton-Leibniz formula.
Using the Cauchy integral formula.
I think I can do 2. by myself but I have some questions about 1. and 3. For 1. how do I write $z = z(t)$ when the line is a triangle? If the area would be a circle, I could just write $z = a + re^{it}$ but how to do it with a triangle?
For 3. I used the Cauchy formula $$ \int_{\gamma} \frac{f(\zeta)}{\zeta - z}d\zeta = 2\pi i \cdot f(z) $$ I got $f(\zeta) = -\frac{1}{\zeta}$ and $z = 3$ but I'm afraid I did something wrong because as far as I understand the point $z$ has to be inside the area contained by $\gamma$. Or is it enough that $f$ is complex-differentiable at $z$?
Concerning the first approach, consider that path$$\begin{array}{rcccl}\gamma_1\colon&[0,1]&\longrightarrow&\mathbb C\\&t&\mapsto&(1-t)\times(-1-i)+t\times(2-i)&=-1-i+3t.\end{array}$$This is a path joining $-1-i$ to $2-i$. So, compute$$\int_{\gamma_1}\frac1{-z^2+3z}\,\mathrm dz=\int_0^1-\frac{3}{9 t^2-(15+6 i) t+(3+5 i)}\,\mathrm dt.$$And do the same thing with a path $\gamma_2$ joining $2-i$ to $-1+2i$ and with a path $\gamma_3$ joining $-1+2i$ to $-1-i$. To tell the truth, it is not clear to me whether or not these computations can be done by hand.
On the other hand, it's easy to apply Cauchy's integral formula. Since$$\frac1{-z^2+3z}=\frac{\frac1{3-z}}z,$$you have$$\int_\gamma\frac1{-z^2+3z}\,\mathrm dz=2\pi i\frac1{3-0}=\frac{2\pi i}3.$$