$\displaystyle
\int\frac{dx}{4+x^2}\
$
I am supposed to use trig substitution here. I used a tangent sub but then everything seems to cancel itself out. Which sub would I need to use here?
You're correct, use $\displaystyle x=2tan{\theta}, \;\ dx=2sec^{2}{\theta}d{\theta}$
$\displaystyle \int\frac{2sec^{2}{\theta}}{4+4tan^{2}{\theta}}d{\ theta}$
$\displaystyle \int\frac{2sec^{2}{\theta}}{4(1+tan^{2}{\theta})}d {\theta}$
$\displaystyle \frac{1}{4}\int\frac{2sec^{2}{\theta}}{sec^{2}{\th eta}}d{\theta}$
Yes, the $\displaystyle sec^{2}{\theta}$ does cancel. Which makes it easy.
$\displaystyle \frac{1}{4}\int 2d{\theta}$
$\displaystyle \frac{1}{2}\int d{\theta}$
$\displaystyle \frac{\theta}{2}$
But, from our sub, $\displaystyle {\theta}=tan^{-1}(\frac{x}{2})$
So, we get:
$\displaystyle \frac{tan^{-1}(\frac{x}{2})}{2}$
there is a straight forward formula for this, but if you want to do the trig sub, that's fine. you have an expression of the form $\displaystyle x^2 + a^2$ thus your substitution must be $\displaystyle x = a \tan \theta$. that is, $\displaystyle x = 2 \tan \theta$
$\displaystyle x = 2\tan{t}$
$\displaystyle dx = 2\sec^2{t} \, dt$
$\displaystyle \int \frac{1}{4 + x^2} \, dx$
$\displaystyle \int \frac{1}{4(1 + \tan^2{t})} \, 2\sec^2{t} \, dt$
$\displaystyle \frac{1}{2}\int \, dt$
$\displaystyle \frac{1}{2} t + C$
$\displaystyle \frac{1}{2} \arctan\left(\frac{x}{2}\right) + C$