This is how I would work the problem:
We are given to evaluate:
$$I=\int_{\frac{\pi}{3}}^{\pi}\sqrt{1+\left(\frac{2}{x}\right)^2}\,dx$$
Make the substitution:
$$\frac{2}{x}=\tan(\theta)\implies x=2\cot(\theta)\,\therefore\,dx=-2\csc^2(\theta)\,d\theta$$
To change our limits, consider:
$$\theta=\tan^{-1}\left(\frac{2}{x}\right)$$
And so we now have:
$$I=2\int_{\tan^{-1}\left(\frac{2}{\pi}\right)}^{\tan^{-1}\left(\frac{6}{\pi}\right)} \sec(\theta)\csc^2(\theta)\,d\theta$$
Using the Pythagorean identity:
$$\csc^2(\theta)=1+\cot^2(\theta)$$
We may now write:
$$I=2\int_{\tan^{-1}\left(\frac{2}{\pi}\right)}^{\tan^{-1}\left(\frac{6}{\pi}\right)} \sec(\theta)+\cot(\theta)\csc(\theta)\,d\theta$$
Applying the FTOC, we obtain:
$$I=2\left[\ln\left|\sec(\theta)+\tan(\theta)\right|-\csc(\theta)\right]_{\tan^{-1}\left(\frac{2}{\pi}\right)}^{\tan^{-1}\left(\frac{6}{\pi}\right)}=2\left(\left(\ln\left(\frac{6+\sqrt{\pi^2+36}}{\pi}\right)-\frac{\sqrt{\pi^2+36}}{6}\right)-\left(\ln\left(\frac{2+\sqrt{\pi^2+4}}{\pi}\right)-\frac{\sqrt{\pi^2+4}}{2}\right)\right)$$
Simplifying, we get:
$$I=2\left(\ln\left(\frac{6+\sqrt{\pi^2+36}}{2+\sqrt{\pi^2+4}}\right)+\frac{3\sqrt{\pi^2+4}-\sqrt{\pi^2+36}}{6}\right)$$