I'm trying to grasp the difference between branches for the complex square root and I'm having difficulty with some very basic examples.
First example, if I choose $\sqrt{\,}$ to denote the branch defined on $(-\pi,\pi)$:
$a = e^{\frac{2}{5}\pi i}$ and $b = e^{\frac{2}{3}\pi i}$
I get that $a\sqrt{b} \ne \sqrt{a^2b}$, because:
$$a\sqrt{b} = e^{\frac{2}{5}\pi i} \cdot e^{\frac{1}{3}\pi i} = e^{\frac{11}{15}\pi i}$$
$$\sqrt{a^2b} = \sqrt{e^{\frac{4}{5}\pi i}\cdot e^{\frac{2}{3}\pi i}} = \sqrt{e^{\frac{22}{15}\pi i}} = \sqrt{e^{\frac{-8}{15}\pi i}} = e^{\frac{-4}{15}\pi i}$$
notice the step in the end of the last line where I need to fix the exponent by subtracting $2\pi$ so that the exponent will be between $-\pi$ and $\pi$. If I didn't "fix" it, I would've got the result I wanted.
Well this obviously didn't work. so my question is what failed and for which branches the common rules for powers work like for real-valued roots and powers?
Second example, which is related but a bit more complicated:
Calculate: $$ \int_{|z|=5} \frac{1}{\sqrt{z^2+11}} dz$$
where $\sqrt{\,}$ denotes the branch for which $\sqrt{36}=-6$.
Firstly, it is not obvious to me if $\sqrt{z^2+11}$ is even meromorphic, because $z^2+11$ has roots in the interior of the contour, so why is this integral defined correctly?
Secondly, the solution I saw was as follows:
$$ \int_{|z|=5} \frac{1}{\sqrt{z^2+11}} dz \overset{w=\frac{1}{z}}{=} \int_{|w|=\frac{1}{5}} \frac{1}{w^2\sqrt{\frac{1}{w^2}+11}} dw = \int_{|w|=\frac{1}{5}} \frac{1}{-w\sqrt{1+11w^2}} dw $$
Now I'm supposed to understand that $\sqrt{1+11w^2}$ is analytic in the interior of the contour, which is reasonable because $w$ is close to $0$, so $1+11w^2$ is close to 1 and we can remove a ray from the origin. Is this the right explanation?
After agreeing with the last claim, the integrand only has a simple pole at 0 and from the residue theorem the answer will be:
$$ 2\pi i \cdot Res_0\left(\frac{1}{-w\sqrt{1+11w^2}}\right) = 2\pi i \cdot\frac{1}{-\sqrt{1+11\cdot0}} = 2\pi i \frac{1}{-\sqrt{1}} = 2\pi i$$
Another question about this example arises from the first example. why is it correct to move the $w$ inside the root like so (and multiplying by $-1$) and is it correct that if $\sqrt{a^2}=-a$ for a single real $a>0$, then the same rule applies to all complex numbers?
I'm missing a lot of formality in this subject and I'd like to understand the reasoning behind those certain steps and also how in general I could understand those definition or maybe translate them to a problem with branches of log, which I'm more comfortable with (although not so much).