I just started studying complex analysis, and we just covered the basics of complex differentiable functions and the technical aspects of performing a contour integral. I thought the theory made really good sense. But suddenly while trying to perform a contour integral, I started questioning everything I learned and what we are doing. So I hope some of you can help me clarify what I'm allowed to do. I think it's best to go by an example:
Say I have a complex function:
$$
\begin{array}{l}
f: \mathbb{C} \rightarrow \mathbb{C} \\
f(z)=\frac{1}{(1-z)^{2}}
\end{array}
$$
And say I want to perform a integral along a straight line from $z_1$ to $z_2$:

Then I can parameterize the path by: $$ \begin{array}{l} \gamma:[0,1] \rightarrow \mathbb{C} \\ \gamma(t)=z_{1}+t\left(z_{2}-z_{1}\right) \end{array} $$
And calculate the integral by: $$ \int_{z_{1}}^{z_{2}} f(z) d z=\int_{0}^{1} f(\gamma(t)) \gamma^{\prime}(t) d t=\int_{0}^{1} \frac{1}{(1-\gamma(t))^{2}} \gamma^{\prime}(t) d t $$ First question: Can I just differentiate $\gamma(t)$ like a regular real function (so $\gamma^{\prime}(t)=z_2-z_1$) even though it maps to $\mathbb{C}$? Isn't t in some way indirectly dependent on a complex variable and thus a complex function?
Say, that I don't know the primitive/antiderivative to the function $f(\gamma(t)) \gamma^{\prime}(t)=\frac{1}{(1-\gamma(t))^{2}} \gamma^{\prime}(t)$.
Second: Am I then allowed to make a substitution?
Fx:$$u=1-\gamma(t), \frac{d u}{d t}=-\gamma^{\prime}(t) \Rightarrow d t=-\frac{1}{\gamma^{\prime}(t)} d u$$
$$=\int_{u(0)}^{u(1)}-\frac{1}{u^{2}} d u=\left[\frac{1}{u}\right]_{u(0)}^{u(1)}=\frac{1}{u(1)}-\frac{1}{u(0)}$$
But this would be the same as a substitution $u=1-z$ from the beginning. Is the problem that I'm not allowed to have complex numbers in the integration limits? Or why do I even need to parameterize a line to start with?
In this case no parametrization is required, because the function $z\mapsto\frac1{(1-z)^2}$ has a primitive: $z\mapsto\frac1{1-z}$. So, for any differentibale path $\gamma\colon[a,b]\longrightarrow\Bbb C\setminus\{1\}$, you have$$\int_\gamma\frac1{(1-z)^2}\,\mathrm dz=\frac1{1-u(b)}-\frac1{1-u(a)}.$$In general, if $f$ has a primitive $F$, then\begin{align}\int_\gamma f&=\int_a^bf\bigl(\gamma(t)\bigr)\gamma'(t)\,\mathrm dt\\&=\int_a^bF'\bigl(\gamma(t)\bigr)\gamma'(t)\,\mathrm dt\\&=\int_a^b(f\circ\gamma)'(t)\,\mathrm dt\\&=F\bigl(\gamma(b)\bigr)-F\bigl(\gamma(a)\bigr).\end{align}
And, yes, you can differentiate your $\gamma$ the way you did it.