Trying to integrate $\int_0^{+\infty} \frac{x^{1/3}\ln x}{x^2+4}\; dx$ This is a problem from a previous complex analysis qualifying exam that I'm working through to study for my own upcoming exam. I'm struggling with this combination of a fractional exponent and logarithm. Below is my attempt, but I need help with how to finish it or if there's a better method for this type of problem.
Problem:
Evaluate the improper integral:
$$
I = \int_0^{+\infty} \frac{x^{1/3}\ln x}{x^2+4}\; dx
$$
Explain all steps carefully (show contours, introduce branches, etc.).
Attempted Solution:
Let $f(z) = \frac{z^{1/3}\ln z}{z^2+4}$ and consider the following contour with a branch cut along the positive real axis, where $\Gamma$ is the entire closed curve, $C_R$ is the outside circle of radius $R$, $C_r$ is the inside circle of radius $r$, $A$ is the line from $r$ to $R$, $B$ is the line from $R$ back to $r$, and $0\leq \arg z \leq 2\pi$.

Using the Residue Theorem, we have
$$
\begin{split}
\oint_\Gamma f(z) dz
 &= 2\pi i \Big(\text{Res}(f,2i)+\text{Res}(f,-2i)\Big) \\
 &= \int_{C_R} f(z)dz + \int_{C_r} f(z)dz
  + \int_r^R f(z)dz + \int_R^r f(z)dz,
\end{split}
$$
where $\int_r^R f(z)dz$ uses $\arg z = 0$ and $\int_R^r f(z)dz$ uses $\arg z = 2\pi$.
Note that $z^{1/3} = e^{\frac{1}{3}(\ln z)} = e^{\frac{1}{3}(\ln |z|+i\arg z)}$, thus we can write
$$
f(z) = \frac{e^{\frac{1}{3}(\ln |z|+i\arg z)}\Big(\ln|z|+i\arg z\Big)}{z^2+4}.
$$
Using the ML estimation lemma, we find that $\int_{C_r} f(z)dz$ goes to zero as $r\to 0$ and $\int_{C_R}$ goes to zero as $R\to\infty$. (Work omitted here but can be shown if needed.) We're left with
$$
\begin{align*}
2\pi i \Big(&\text{Res}(f,2i)+\text{Res}(f,-2i)\Big) \\
&= \int_r^R f(z)dz + \int_R^r f(z)dz\\
&= \int_r^R \frac{e^{\frac{1}{3}(\ln |z|)}\ln|z|}{z^2+4}dz + \int_R^r \frac{e^{\frac{1}{3}(\ln |z|+2\pi i)}\Big(\ln|z|+2\pi i\Big)}{z^2+4}dz\\
&= \int_r^R \frac{x^{1/3}\ln x}{x^2+4}dx - e^{\frac{2\pi}{3}i} \int_r^R \frac{x^{1/3}(\ln x+2\pi i)}{x^2+4} dx 
\end{align*}
$$
Now from here, I know how to evaluate the residues and I see that we can isolate the term we're looking for as
$$
\lim_{r\to 0}\lim_{R\to\infty} \int_r^R \frac{x^{1/3}\ln x}{x^2+4}dx,
$$
but I don't know what to do with the remaining integral term on the righthand side. How do I complete this? Or should I have used a different contour or branch cut?
 A: $$I=\int_0^\infty \frac{x^a}{x^2+4}dx$$ Let $x=2\sqrt{t}$
$$I=2^{a-2}\int_0^\infty \frac{t^{\frac{a-1}{2}}}{t+1}dt=2^{a-2}\text{B}(\frac{a+1}{2},\frac{1-a}{2})=2^{a-2}\frac{\pi}{\sin(\pi\frac{a+1}{2})}=2^{a-2}\frac{\pi}{\cos(\pi\frac{a}{2})}$$
Your integral is the following.
$$\left(\frac{d}{da}I\right)_{a=\frac{1}3}$$
A: Your choice of branch cut is fine.  Note that for $0<\alpha<2$, we have
$$\frac{d}{d\alpha}\int_0^\infty \frac{x^\alpha}{x^2+4}\,dx=\int_0^\infty \frac{x^\alpha \log(x)}{x^2+4}\,dx$$
So, all we need to do is evaluate the integral $\int_0^\infty \frac{x^\alpha}{x^2+4}\,dx$, differentiate with respect to $\alpha$, and set $\alpha=1/3$.
Proceeding, we use the same methodology, which after letting $r\to 0$ and $R\to \infty$ reveals
$$\begin{align}
\lim_{r\to 0^+}\lim_{R\to \infty}\oint_C \frac{z^\alpha}{z^2+4}\,dz&=(1-e^{i2\pi\alpha})\int_{0}^\infty \frac{x^\alpha}{x^2+4}\,dx\\\\
&=2\pi i \left(\frac{2^\alpha e^{i\pi \alpha/2}}{4i}+\frac{2^\alpha e^{i3\pi \alpha/2}}{-4i}\right)\\\\
&=-\pi i 2^\alpha e^{i\pi \alpha}\sin(\pi\alpha/2)
\end{align}$$
Therefore we find that
$$\int_{0}^\infty \frac{x^\alpha}{x^2+4}\,dx=\pi 2^{\alpha-2}\sec{\pi \alpha/2} $$
Differentiating and setting $\alpha =1/3$ yields
$$\int_{0}^\infty \frac{x^{1/3} \log(x)}{x^2+4}\,dx=2^{-2/3}\left(\frac{\pi^2}{6}+\frac{\pi \log(2)}{\sqrt 3}\right)$$
A: Your method will certainly work, though some of the other posted methods are likely cleaner. Continuing (roughly) from where you left off, we have
$$
2\pi i \left[\operatorname{Res}(f,2i)+\operatorname{Res}(f,-2i)\right] = \int_0^\infty \frac{x^{1/3}\ln x}{x^2+4}dx - e^{\frac{2\pi}{3}i} \int_0^\infty \frac{x^{1/3}(\ln x+2\pi i)}{x^2+4} dx.
$$
First, the RHS. We can then refactor the integrals to get the rather simpler
$$
\sqrt{3}e^{-i\pi/6}\int_0^\infty \frac{x^{1/3}\ln x}{x^2+4}dx + 2\pi e^{i\pi/6}\int_{0}^\infty \frac{x^{1/3}}{x^2 + 4}dx.
$$
Next, the LHS. We know that $\operatorname{Res}(f, a) = a^{1/3}\ln a / (2a)$. However, there's a subtle point: when evaluating the numerator, we must remember the branch of $\ln$ that we've chosen. $2i = 2e^{i\pi/2}$ as usual, but here we must use $-2i = 2e^{3\pi i/2}$, not $-2i = 2 e^{-i\pi/2}$. Doing the (somewhat messy) calculation then gives
$$
2\pi i \left[\frac{2^{1/3}e^{i\pi/6}(\ln 2 + i\pi/2)}{4e^{i\pi/2}}+\frac{2^{1/3}e^{i\pi/2}(\ln 2 + 3i\pi/2)}{4e^{3i\pi/2}}\right] =\frac{\pi}{2^{2/3}}\left[e^{-i\pi/6}\left(\ln 2 + \frac{\pi}{2\sqrt{3}}\right) + e^{i\pi/6}\frac{2\pi}{\sqrt{3}}\right].
$$
Finally, since $e^{-i\pi/6}$ and $e^{i\pi/6}$ are linearly independent over the reals, we can just equate their coefficients to get
$$
\int_0^\infty \frac{\sqrt{3}x^{1/3}\ln x}{x^2+4}dx = \frac{\pi}{2^{2/3}\sqrt{3}}\left(\ln 2 + \frac{\pi}{2\sqrt{3}}\right) = \frac{\pi}{2^{2/3}}\left(\frac{\pi}{6} + \frac{\ln2}{\sqrt{3}}\right).
$$
And, as a bonus,
$$
\int_0^\infty \frac{x^{1/3}}{x^2+4}dx = \frac{\pi}{2^{2/3}\sqrt{3}}.
$$
