Solving $\int_{-\infty}^{\infty}{\frac{1}{(4+x^2)\sqrt{4+x^2}} \space dx}$ I'm trying to solve
$$\int_{-\infty}^{\infty}{\frac{1}{(4+x^2)\sqrt{4+x^2}} \space dx}$$
By substituting $x=2\tan{t}$. I get as far as:
$$\int_{x \space = -\infty}^{x \space = \infty}{\frac{1}{(4+(\underbrace{2\tan{t}}_{x})^2)\sqrt{4+(\underbrace{2\tan{t}}_{x})^2}} \cdot \underbrace{2(1+\tan^2t) \space dt}_{dx}} = \dots$$
$$\dots = \frac{1}{4} \cdot \int_{t \space = -\infty}^{t \space = \infty}{\frac{1}{\sqrt{1+\tan^2t}} \space dt}$$
Now what? Have I done anything wrong? I don't see how I could continue from now on.
 A: Your substitution is the way to go in this problem. To complete the substitution however, I recommend that you calculate the new limits for $t$. An alternate approach is to postpone this till the end, but this approach invariably ends up confusing if there's a string of substitutions. In this example, as $x \to -\infty$, $t = \arctan x \to -\frac{\pi}{2}$; similarly as $x \to \infty$, we have $t \to \frac{\pi}{2}$. Therefore, after substitution, the integral becomes
$$
\int_{-\frac{\pi}{2}}^{\frac{\pi}{2}} \frac{1}{\sqrt{1+\tan^2 t}} \, dt.
$$

To proceed further, you need to use the following cousin of the Pythagorean theorem:
$$
1 + \tan^2 t = \sec^2 t .
$$
This identity is extremely important and useful in practice -- not the least in manipulating integrals like this. One should be reminded of this identity whenever one comes across an expression like $\sqrt{1 + \tan^2 t}$ or $\sqrt{1+ x^2}$. By the way, the proof of this identity is based on the standard Pythagorean theorem: 
$$
1+ \tan^2 t = 1 + \frac{\sin^2 t}{\cos^2 t} = \frac{\cos^2 t + \sin^2 t}{\cos^2 t} = \frac{1}{\cos^2 t} = \sec^2 t.
$$
From this, it follows that
$$
\frac{1}{\sqrt{1 + \tan^2 t}} = |\cos t|.
$$
Thus the integral becomes
$$
\int_{-\frac{\pi}{2}}^{\frac{\pi}{2}} |\cos t| \, dt.
$$
Can you take it from here? 
