Struggling with an integral with trig substitution I've got another problem with my CalcII homework.  The problem deals with trig substitution in the integral for integrals following this pattern: $\sqrt{a^2 + x^2}$.  So, here's the problem:
$$\int_{-2}^2 \frac{\mathrm{d}x}{4 + x^2}$$
I graphed the function and because of symmetry, I'm using the integral: $2\int_0^2 \frac{\mathrm{d}x}{4 + x^2}$
Since the denominator is not of the form: $\sqrt{a^2 + x^2}$ but is basically what I want, I ultimately decided to take the square root of the numerator and denominator:
$$2 \int_0^2 \frac{\sqrt{1}}{\sqrt{4+x^2}}\mathrm{d}x = 2 \int_0^2 \frac{\mathrm{d}x}{\sqrt{4+x^2}}$$
From there, I now have, using the following: $\tan\theta = \frac{x}{2} => x = 2\tan\theta => dx = 2\sec^2\theta d\theta$
$$
\begin{array}{rcl}
2\int_{0}^{2}\frac{\mathrm{d}x}{4+x^2}\mathrm{d}x & = & \sqrt{2}\int_{0}^{2}\frac{\mathrm{d}x}{\sqrt{4+x^2}}\mathrm{d}x \\
& = & \sqrt{2}\int_{0}^{2}\frac{2\sec^2(\theta)}{\sqrt{4+4\tan^2(\theta)}}\mathrm{d}\theta \\
& = & \sqrt{2}\int_{0}^{2}\frac{2\sec^2(\theta)}{2\sqrt{1+\tan^2(\theta)}}\mathrm{d}\theta \\
& = & \sqrt{2}\int_{0}^{2}\frac{\sec^2(\theta)}{\sqrt{\sec^2(\theta)}}\mathrm{d}\theta \\
& = & \sqrt{2}\int_{0}^{2}\frac{\sec^2(\theta)}{\sec(\theta)}\mathrm{d}\theta \\
& = & \sqrt{2}\int_{0}^{2}\sec(\theta)\mathrm{d}\theta \\
& = & \sqrt{2}\left [\ln{\sec(\theta)+\tan(\theta)} \right|_{0}^{2}] \\
& = & \sqrt{2}\left [ \ln{\frac{\sqrt{4+x^2}}{2}+\frac{x}{2} } \right|_{0}^{2} ]
\end{array}
$$
I'm not sure if I've correctly made the integral look like the pattern it's supposed to have.  That is, trig substitutions are supposed to be for $\sqrt{a^2 + x^2}$ (in this case that is, there are others).  This particular problem is an odd numbered problem and the answer is supposed to be $\frac{\pi}{4}$.  I'm not getting that.  So, the obvious question is, what am I doing wrong?  Also note, I had trouble getting the absolute value bars to produce for the ln: don't know what I did wrong there either.
Thanks for any help,
Andy

Let $x=2\tan\theta$
and $dx=2 \sec^2\theta$
$2\tan\theta = -2, 2$
$\theta = \frac{-\pi}{4}, \frac{\pi}{4}$
$\int_{\frac{-\pi}{4}}^\frac{\pi}{4}\frac{2\sec^2\theta}{4+4\tan^2\theta}d\theta$
$\int_{\frac{-\pi}{4}}^\frac{\pi}{4}\frac{2\sec^2\theta}{4\sec^2\theta}d\theta$
$\int_{\frac{-\pi}{4}}^\frac{\pi}{4}\frac{1}{2} d\theta$
$\frac{\pi}{8}-\frac{-\pi}{8} = \frac{\pi}{4}$
Sorry about the formatting.  I'm just learning latex.
