simple properties of branches of complex square root and integrating a function with a branch of square root 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).
 A: If you make the branch cut along $(-\infty,0]$, then we obtain two branches for the complex square root. They are both functions that can be defined on all of $\mathbb C$, but not as a continuous function when you move in $\mathbb C$ across the ray $(-\infty,0]$. Lets call them for $z=r e^{i\theta}$, $\theta \in [-\pi,\pi)$,
$$\sqrt[(1)]{re^{i\theta}}:= \sqrt r e^{i\theta/2},\\
\sqrt[(2)]{re^{i\theta}}:= \sqrt r e^{i\theta/2+\pi i}=-\sqrt[(1)]{re^{i\theta}}. $$
I'm not sure that the sentence

choose  $\sqrt{\ }$ to denote the branch defined on $(-\pi, \pi)$

chooses a branch, but I think you meant to say that you wanted to choose what I called $\sqrt[(1)]{\,}.$ What "went wrong" is that you "went across" the branch cut. If $\sqrt[(1)]{\,}$ was continuous on all of $\mathbb C$, then there would be no need for cutting out branches. If you want to go past a branch cut without an abrupt change in values, what you should do is switch to the other branch. This is your "without the fix" result-
$$\sqrt[(2)]{a^2b} =a\sqrt[(1)]{b}.$$
This is exactly what happens when you analytically continue along a path as in reuns's comment, i.e. if $f(t) = \sqrt[(1)]{e^{it}}$ is defined for  $t\in (-\pi,\pi)$, then its analytic continuation (also called $f$) has $$ f(\arg b) = \sqrt[(1)]{b} \text{ but}\\ f(2\arg a + \arg b) = \sqrt[(2)]{a^2b} =a\sqrt[(1)]{b}.$$ 
(strictly speaking you analytically continue to larger and larger open subsets of $\mathbb C$, so instead of $t\in (-\pi,\pi)$ take a small open set containing this interval.)
In the integral, you are asked to use $\sqrt[(2)]{\,}$. What is presumably happening (I haven't checked) when you multiply by $w^2$ inside $\sqrt[(2)]{\,}$ is that it always pushes you to the other branch, regardless of the value of $w$.
The sketch of reuns's comment - define
$$f:(-\pi,-\pi/2)\to \mathbb C, \quad f(t) = \sqrt[(2)]{25e^{i2t} + 11}$$
we find that applying this formula blindly in a neighbourhood of $-\pi/2$ leads to a discontinuity at $t=-\pi/2$.
Analytically continuing instead, we end up with
$$ f:\mathbb R \to \mathbb C,\\ \quad f(t) = \begin{cases} \phantom{\Big(}\!\!\!-\sqrt[(2)]{25e^{i2t} + 11} & t \in (-\pi/2,\pi/2) + 2k\pi\\ \sqrt[(2)]{25e^{i2t} + 11} & t \in (-\pi/2,\pi/2) + 2(k+1)\pi \end{cases} $$
And you should be able to integrate
$$ \int_{-\pi}^\pi f(t)5ie^{it} dt. $$
A: Regarding the first question, consider what happens for the principal branch. By definition,
$$a \sqrt b = |a| \, \sqrt {\smash [b] {|b|}} \, e^{i (2 \arg a + \arg b)/2}, \\
\sqrt {a^2 b} = |a| \, \sqrt {\smash [b] {|b|}} \, e^{i \arg(a^2 b)/2}.$$
Now, $\arg(a^2 b) = 2 \arg a + \arg b + 2 \pi k$ for some $k \in \{-1, 0, 1\}$. If $k \neq 0$, dividing by $2$ will introduce a factor of $-1$. Thus
$$a \sqrt b = \sqrt {a^2 b} \cases {
 1 & $-\pi < 2 \arg a + \arg b \leq \pi$ \\
 -1 & otherwise}.$$
The second question implicitly assumes that you need to choose a branch which is continuous on $|z| = 5$, otherwise the result is not unique. A simple way to construct such a branch is
$$f(z) = -\frac 1 {z \sqrt {1 + \frac {11} {z^2}}},$$
where $\sqrt z$ again denotes the principal branch (as requested, $f(5) = -1/6$). The square root in the denominator is regular at infinity and tends to $1$, therefore $\operatorname{Res}_{z = \infty} f(z) = 1$ and the value of the integral, assuming ccw direction, is $-2 \pi i$ (since the solution that you refer to takes the residue at zero, therefore also assumes ccw direction of integration, $2 \pi i$ is not correct).
