Disclaimer: I'm not a native English speaker and I'm not familiar with the English terms for mathematical objects. I will gladly edit my post based on suggestions concerning grammar mistakes and the correct use of words.
I was trying to solve an integral which proved to be harder than it looks:
\begin{equation} \oint_\gamma dz \frac{1}{z-3\sqrt{z}+2} \end{equation}
where $z\in\mathbb{C}$ and $\gamma(t)=10+7e^{2\pi i t^2}$ for $t\in [0,1]$. The integral can be solved in various ways, but that's not the point. I'm not looking for a solution to this specific integral, I'd like to understand what is the best approach to problems involving square roots and similar polydromic functions, using this exercise as an example. My research led me to many interesting posts, such as this and this, but I feel these articles are either too specific or too general. I always get lost.
Back to the exercise, the square root at the denominator generates two branches, so that we basically have to consider two different functions, one for each foil of the corresponding Riemann surface. Now, obviously:
\begin{equation} z-3\sqrt{z}+2=(\sqrt{z}-2)(\sqrt{z}-1) \end{equation}
which implies that the integrand function has two isolated singularities in $z_1=1$ and $z_2=4$. Only the second singularity is inside $\gamma$. Hence, by the Residue Theorem, I'd say that the integral is equal to the residue of the function in $z_2$:
\begin{equation} \oint_\gamma dz \frac{1}{z-3\sqrt{z}+2} = \lim_{z\to 4} \;(z-4) \frac{1}{z-3\sqrt{z}+2} = \lim_{z\to 4} \frac{\sqrt{z}+2}{\sqrt{z}-1} = 4 \end{equation}
However, checking my professor's follow-along solution, I found out you somehow have to consider the two branches of the square root, for which you have $z_1$ and $z_2$ as singularities in one branch and no singularities for the other one!
I tried to consider $-\sqrt{z}$ as the other branch for the square root, as one would do in $\mathbb{R}$, but the denominator would become $z+3\sqrt{z}+2=(\sqrt{z}+2)(\sqrt{z}+1)$, but this doesn't make things clearer.
To make things worse, the professor's note state that "the other branch gives the values $12$ and $6$ for the same denominator", without specifying anything about those values or how he got them.
Of course, neither WolframAlpha nor ChatGPT give satisfying solutions. WolframAlpha only spits out the result, since I'm not a premium user, and ChatGPT just uses substitution with $w=\sqrt{z}$ without computing the determinator of the Jacobian nor changing $\gamma$ accordingly.