Show that $$I= \int_{0}^{\infty} \frac{\ln x}{x^\frac{3}{4} (1+x)} dx = -\sqrt{2} \pi^2$$
I used a keyhole contour, with branch point at $z=0.$
Around $\Gamma$, $|zf(z)|$ tends to $0$ as $z$ tends to $\infty.$
Around $\gamma$, $|zf(z)|$ tends to $0$ as $z$ tends to $0.$
For $AB$, let $z=x$ and $$f(z) = \frac{\ln x}{x^\frac{3}{4} (1+x)}.$$
For $CD$, let $z=x \exp(2\pi i)$ and $$f(z) = \frac{\ln (x\exp(2\pi i))}{x\exp(2\pi i)^\frac{3}{4} (1+x\exp(2\pi i))}.$$
So I wish to calculate the residue at $x = \exp(-\pi i) = \exp(\pi i) = -1.$
But here's where I have a problem - if I calculate the residue using $\exp(-\pi i)$, I get the correct answer - but if I calculate the residue using $\exp(\pi i)$, I don't:
$\operatorname{Res}(f(z), \exp(\pi i)) = \frac{3\pi i}{\exp(5\pi i / 4)}$
$\operatorname{Res}(f(z), \exp(-\pi i)) = \frac{\pi i}{\exp(3\pi i / 4)}$
Skipping some steps of algebra, I get for the integral:
$I(1-i) + \displaystyle\int_{0}^{\infty} \frac{2\pi}{x^\frac{3}{4} (1+x)} dx = 2\pi i \operatorname{Res}(f(z), \exp(\pi i))$
Equating the imaginary parts gives me $-I = \sqrt2 \pi^2$, as needed. If I use $\operatorname{Res}(f(z), \exp(-\pi i))$, however, I get that $I = 3\sqrt2 \pi^2$.
I would have thought these two should give the same answer. Why do they give different answers, and how do I know (in general) which value of the residue to use? I would really appreciate any help!
By using a keyhole contour and defining the argument of $z$ along $CD$ be equal to $2 \pi$, the argument of the pole at $z=-1$ must be equal to $\pi$. No way can it be $-\pi$.
Let's look at what you have done - which largely looks good. Let $I_1$ be the integral you want; then by considering
$$\oint_C dz \frac{\log{z}}{z^{3/4} (1+z)} $$
over the keyhole contour, then, letting the outer radius $\to \infty$ and the inner radius $\to 0$, we get by the residue theorem,
$$I_1 - \int_0^{\infty} dx \frac{\log{x} + i 2 \pi}{e^{i 3 \pi/2} x^{3/4} (1+x)} = i 2 \pi R_1$$
where $$R_1 = \frac{\log{e^{i \pi}}}{e^{i 3 \pi/4}} = \pi \, e^{-i \pi/4}$$
is the residue of the integrand of the contour integral at the pole $z=e^{i \pi}$. Rewriting the above, we get
$$(1-i) I_1 + 2 \pi I_0 = i 2 \pi R_1$$
where
$$I_0 = \int_0^{\infty}\frac{dx}{x^{3/4} (1+x)} $$
We may evaluate $I_0$ using the same keyhole contour and by considering the integral
$$\oint_C \frac{dz}{z^{3/4} (1+z)}$$
about that contour. Thus,
$$(1-i) I_0 = i 2 \pi \, R_0 $$
where $R_0 = e^{-i 3 \pi/4}$ is the residue of the integrand of the latter integral at $z=e^{i \pi}$. Note that $1-i = \sqrt{2} e^{-i \pi/4}$, so that if we multiply the equation for $I_1$ by $1-i$ on both sides, we get
$$-i 2 I_1 + 2 \pi (i 2 \pi) e^{-i 3 \pi/4} = i 2 \pi (\pi) e^{-i \pi/4} \sqrt{2} e^{-i \pi/4}$$
Doing out the algebra, I indeed find that $I_1=-\sqrt{2} \pi^2$ as expected.
Again, if you use $e^{-i \pi}$ for the pole at $z=-1$, or some other odd multiple of $i \pi$, then you will indeed get a different answer - but such answers will be wrong. You committed to a branch of the log when you took the argument of $z$ along $CD$ to be $2 \pi$, that is $\arg{z} \in [0, 2 \pi]$. Thus, it is not possible for $z$ to take on any argument outside this interval by your definition of the keyhole contour, and the correct expression for the pole is $-1=e^{i \pi}$.