I'm trying to do an integral which arises from another integral that is simple in polar coordinates (so I can work out the answer that way). However I am using cartesian coordinates and trying to see if I get the same answer. The integral (with $G>0$) is,
$$I(G)=4\sqrt{1+G^2}\int_{0}^{G}\text{d} x\,\frac{x \tan^{-1}(x)}{\sqrt{G^2-x^2}(1+x^2)}\,.$$
From using polar coordinates on the double integral from which this integral arises I find the result,
$$I(G)=\pi \ln\left(1+G^2\right)\,.$$
Are there any substitutions or tricks I can use to evaluate the integral over $x$ above? I noticed that,
$$I(G)=-2\sqrt{1+G^2}\int_{0}^{G}\text{d} x\,\left(\sqrt{G^2-x^2}\right)'\left(\tan^{-1}(x)\right)'\tan^{-1}(x)\,,$$
where prime denotes differentiation with respect to $x$. I'm not sure if this is useful however -- even integrating by parts I end up with another integral I cannot see a way to solve.
Any hints or tips would be appreciated!
Define the function $\mathcal{I}:\mathbb{R}_{>0}\rightarrow\mathbb{R}$ via the definite integral
$$\mathcal{I}{\left(a\right)}:=4\sqrt{1+a^{2}}\int_{0}^{a}\mathrm{d}x\,\frac{x\arctan{\left(x\right)}}{\left(1+x^{2}\right)\sqrt{a^{2}-x^{2}}},$$
where the arctangent function may be given by the usual integral representation
$$\arctan{\left(z\right)}:=\int_{0}^{z}\mathrm{d}y\,\frac{1}{1+y^{2}}=\int_{0}^{1}\mathrm{d}t\,\frac{z}{1+z^{2}t^{2}};~~~\small{z\in\mathbb{R}}.$$
We will independently verify the closed form expression for $\mathcal{I}$ asserted in the OP.
Given $a\in\mathbb{R}_{>0}\land r\in\mathbb{R}$, we can derive the following integration formula:
$$\begin{align} \int_{0}^{a}\mathrm{d}x\,\frac{1}{\left(1+r^{2}x^{2}\right)\sqrt{a^{2}-x^{2}}} &=\int_{0}^{1}\mathrm{d}y\,\frac{1}{\left(1+a^{2}r^{2}y^{2}\right)\sqrt{1-y^{2}}};~~~\small{\left[x=ay\right]}\\ &=\int_{0}^{1}\mathrm{d}t\,\frac{1}{2\left(1+a^{2}r^{2}t\right)\sqrt{t}\sqrt{1-t}};~~~\small{\left[y=\sqrt{t}\right]}\\ &=\int_{0}^{1}\mathrm{d}t\,\frac{1}{2\left(1+a^{2}r^{2}t\right)\left(1-t\right)\sqrt{\frac{t}{1-t}}}\\ &=\int_{0}^{\infty}\mathrm{d}u\,\frac{1}{\left(1+u\right)^{2}}\cdot\frac{1}{2\left[1+a^{2}r^{2}\left(\frac{u}{1+u}\right)\right]\left(\frac{1}{1+u}\right)\sqrt{u}};~~~\small{\left[t=\frac{u}{1+u}\right]}\\ &=\int_{0}^{\infty}\mathrm{d}u\,\frac{1}{2\left[\left(1+u\right)+a^{2}r^{2}u\right]\sqrt{u}}\\ &=\int_{0}^{\infty}\mathrm{d}u\,\frac{1}{2\left[1+\left(1+a^{2}r^{2}\right)u\right]\sqrt{u}}\\ &=\frac{1}{\sqrt{1+a^{2}r^{2}}}\int_{0}^{\infty}\mathrm{d}v\,\frac{1}{2\left(1+v\right)\sqrt{v}};~~~\small{\left[u=\frac{v}{1+a^{2}r^{2}}\right]}\\ &=\frac{1}{\sqrt{1+a^{2}r^{2}}}\int_{0}^{\infty}\mathrm{d}w\,\frac{1}{1+w^{2}};~~~\small{\left[\sqrt{v}=w\right]}\\ &=\frac{\pi}{2\sqrt{1+a^{2}r^{2}}}.\\ \end{align}$$
Now, suppose $a\in\mathbb{R}_{>0}$. Expressing the arctangent as an integral, we can rewrite $\mathcal{I}$ as a double integral and change the order of integration to find
$$\begin{align} \mathcal{I}{\left(a\right)} &=4\sqrt{1+a^{2}}\int_{0}^{a}\mathrm{d}x\,\frac{x\arctan{\left(x\right)}}{\left(1+x^{2}\right)\sqrt{a^{2}-x^{2}}}\\ &=4\sqrt{1+a^{2}}\int_{0}^{a}\mathrm{d}x\,\frac{x}{\left(1+x^{2}\right)\sqrt{a^{2}-x^{2}}}\int_{0}^{1}\mathrm{d}t\,\frac{x}{1+x^{2}t^{2}}\\ &=4\sqrt{1+a^{2}}\int_{0}^{a}\mathrm{d}x\int_{0}^{1}\mathrm{d}t\,\frac{x^{2}}{\left(1+x^{2}t^{2}\right)\left(1+x^{2}\right)\sqrt{a^{2}-x^{2}}}\\ &=4\sqrt{1+a^{2}}\int_{0}^{1}\mathrm{d}t\int_{0}^{a}\mathrm{d}x\,\frac{x^{2}}{\left(1+x^{2}t^{2}\right)\left(1+x^{2}\right)\sqrt{a^{2}-x^{2}}}\\ &=4\sqrt{1+a^{2}}\int_{0}^{1}\mathrm{d}t\,\frac{1}{\left(1-t^{2}\right)}\int_{0}^{a}\mathrm{d}x\,\frac{\left(1-t^{2}\right)x^{2}}{\left(1+x^{2}t^{2}\right)\left(1+x^{2}\right)}\cdot\frac{1}{\sqrt{a^{2}-x^{2}}}\\ &=4\sqrt{1+a^{2}}\int_{0}^{1}\mathrm{d}t\,\frac{1}{\left(1-t^{2}\right)}\int_{0}^{a}\mathrm{d}x\,\left[\frac{1}{\left(1+x^{2}t^{2}\right)}-\frac{1}{\left(1+x^{2}\right)}\right]\frac{1}{\sqrt{a^{2}-x^{2}}}\\ &=4\sqrt{1+a^{2}}\int_{0}^{1}\mathrm{d}t\,\frac{1}{\left(1-t^{2}\right)}\bigg{[}\int_{0}^{a}\mathrm{d}x\,\frac{1}{\left(1+t^{2}x^{2}\right)\sqrt{a^{2}-x^{2}}}\\ &~~~~~-\int_{0}^{a}\mathrm{d}x\,\frac{1}{\left(1+x^{2}\right)\sqrt{a^{2}-x^{2}}}\bigg{]}\\ &=4\sqrt{1+a^{2}}\int_{0}^{1}\mathrm{d}t\,\frac{1}{\left(1-t^{2}\right)}\left[\frac{\pi}{2\sqrt{1+a^{2}t^{2}}}-\frac{\pi}{2\sqrt{1+a^{2}}}\right]\\ &=2\pi\int_{0}^{1}\mathrm{d}t\,\frac{\sqrt{1+a^{2}}-\sqrt{1+a^{2}t^{2}}}{\left(1-t^{2}\right)\sqrt{1+a^{2}t^{2}}}.\\ \end{align}$$
This is an elementary integral that can be transformed into an integral of a rational function with the appropriate Euler substitution:
$$\begin{align} \mathcal{I}{\left(a\right)} &=2\pi\int_{0}^{1}\mathrm{d}t\,\frac{\sqrt{1+a^{2}}-\sqrt{1+a^{2}t^{2}}}{\left(1-t^{2}\right)\sqrt{1+a^{2}t^{2}}}\\ &=2\pi\int_{0}^{1}\mathrm{d}t\,\frac{a^{2}\left[\sqrt{1+a^{2}}-\sqrt{1+a^{2}t^{2}}\right]}{\left(a^{2}-a^{2}t^{2}\right)\sqrt{1+a^{2}t^{2}}}\\ &=2\pi\int_{0}^{a}\mathrm{d}u\,\frac{a\left[\sqrt{1+a^{2}}-\sqrt{1+u^{2}}\right]}{\left(a^{2}-u^{2}\right)\sqrt{1+u^{2}}};~~~\small{\left[t=a^{-1}u\right]}\\ &=2\pi\int_{0}^{a}\mathrm{d}u\,\frac{a\left[\sqrt{1+a^{2}}-\sqrt{1+u^{2}}\right]\left[\sqrt{1+a^{2}}+\sqrt{1+u^{2}}\right]}{\left(a^{2}-u^{2}\right)\left[\sqrt{1+a^{2}}+\sqrt{1+u^{2}}\right]\sqrt{1+u^{2}}}\\ &=2\pi\int_{0}^{a}\mathrm{d}u\,\frac{a}{\left[\sqrt{1+a^{2}}+\sqrt{1+u^{2}}\right]\sqrt{1+u^{2}}}\\ &=2\pi\int_{1}^{\sqrt{1+a^{2}}-a}\mathrm{d}v\,\frac{(-1)\left(1+v^{2}\right)}{2v^{2}}\cdot\frac{a}{\left[\sqrt{1+a^{2}}+\left(\frac{1+v^{2}}{2v}\right)\right]\left(\frac{1+v^{2}}{2v}\right)};~~~\small{\left[\sqrt{1+u^{2}}-u=v\right]}\\ &=\pi\int_{\sqrt{1+a^{2}}-a}^{1}\mathrm{d}v\,\frac{4a}{v^{2}+2v\sqrt{1+a^{2}}+1}\\ &=\pi\int_{\sqrt{1+a^{2}}-a}^{1}\mathrm{d}v\,\frac{4a}{\left(v+\sqrt{1+a^{2}}\right)^{2}-a^{2}}\\ &=\pi\int_{\sqrt{1+a^{2}}-a}^{1}\mathrm{d}v\,\frac{4a}{\left(v+\sqrt{1+a^{2}}-a\right)\left(v+\sqrt{1+a^{2}}+a\right)}.\\ \end{align}$$
Note: for $0<a$, we have $0<\sqrt{1+a^{2}}-a<1<\sqrt{1+a^{2}}+a=\frac{1}{\sqrt{1+a^{2}}-a}$.
Setting $c:=\sqrt{1+a^{2}}-a\in(0,1)$, we have $a=\frac{1-c^{2}}{2c}\land\sqrt{1+a^{2}}=\frac{1+c^{2}}{2c}$, and we obtain
$$\begin{align} \mathcal{I}{\left(a\right)} &=\pi\int_{\sqrt{1+a^{2}}-a}^{1}\mathrm{d}v\,\frac{4a}{\left(v+\sqrt{1+a^{2}}-a\right)\left(v+\sqrt{1+a^{2}}+a\right)}\\ &=\pi\int_{\sqrt{1+a^{2}}-a}^{1}\mathrm{d}v\,\frac{4a}{\left(v+\sqrt{1+a^{2}}-a\right)\left(v+\frac{1}{\sqrt{1+a^{2}}-a}\right)}\\ &=\pi\int_{c}^{1}\mathrm{d}v\,\frac{4\left(\frac{1-c^{2}}{2c}\right)}{\left(v+c\right)\left(v+c^{-1}\right)}\\ &=\pi\int_{c}^{1}\mathrm{d}v\,\frac{2\left(1-c^{2}\right)}{\left(v+c\right)\left(1+cv\right)}\\ &=2\pi\int_{c}^{1}\mathrm{d}v\,\left[\frac{1}{\left(v+c\right)}-\frac{c}{\left(1+cv\right)}\right]\\ &=2\pi\int_{c}^{1}\mathrm{d}v\,\frac{d}{dv}\left[\ln{\left(v+c\right)}-\ln{\left(1+cv\right)}\right]\\ &=2\pi\int_{c}^{1}\mathrm{d}v\,\frac{d}{dv}\ln{\left(\frac{v+c}{1+cv}\right)}\\ &=2\pi\left[\ln{\left(1\right)}-\ln{\left(\frac{2c}{1+c^{2}}\right)}\right]\\ &=2\pi\left[-\ln{\left(\frac{1}{\sqrt{1+a^{2}}}\right)}\right]\\ &=\pi\ln{\left(1+a^{2}\right)}.\blacksquare\\ \end{align}$$
Just as you anticipated!