Trigonometric and Hyperbolic substitutions

So confused at this. I was sick when the class went through it and now I'm just looking at the questions with a blank face. :(

Right, so here's what they give us:

If for some constant a the integrand contains:

$\displaystyle a^{2} - x^{2}$, let $\displaystyle x = a \sin{\theta}$ with $\displaystyle dx = a \cos{\theta}d\theta$

$\displaystyle a^{2} + x^{2}$, let $\displaystyle x = a \tan{\theta}$ with $\displaystyle dx = a \sec^2{\theta}d\theta$

$\displaystyle x^{2} - a^{2}$, let $\displaystyle x = a \sec{\theta}$ with $\displaystyle dx = a \sec{\theta}\tan{\theta}d\theta$

$\displaystyle \sqrt{x^{2} + a^{2}}$, let $\displaystyle x = a \sinh{t}$ with $\displaystyle dx = a \cosh{t}dt$

$\displaystyle \sqrt{x^{2} - a^{2}}$, let $\displaystyle x = a \cosh{t}$ with $\displaystyle dx = a \sinh{t}dt$

They have a sample solution that I can't even follow. :(

$\displaystyle \int{\sqrt{4 - x^{2}},dx}$

I get that 4 is 2^2, so 2 is a.

= $\displaystyle \int{\sqrt{4(1 - \sin^2{\theta})}2\cos{\theta}\,d\theta}$

Starting to lose track here. AFAIK, x should be 2 sin theta, though that doesn't explain why the 4 has been taken out.

= $\displaystyle \int{4\sqrt{\cos^2{\theta}}\cos{\theta}\,d\theta}$

Confused by this stage. =|

= $\displaystyle \int{4\cos^2{\theta},d\theta}$

Confused.

= $\displaystyle \int{2(1 + cos{\theta},d\theta}$

I'm pretty sure that's 2 times 2cos^2(theta), so I 'kinda' get this step. Still not sure how it got to this stage.

= $\displaystyle 2\theta + \sin{\theta} + C$

Because $\displaystyle x = 2\sin{\theta}$, $\displaystyle \theta = \arcsin{\frac{x}{2}}$

$\displaystyle \sin{2\theta} = 2 \sin{\theta}\cos{\theta}$

= $\displaystyle 2 \sin{\theta} \sqrt{1 - \sin^2{\theta}}$

= $\displaystyle x\sqrt{1 - (\frac{x}{2})^2}$

Therefore $\displaystyle \int{\sqrt{4 - x^{2}},dx} = 2 \arcsin{\frac{x}{2}} + x\sqrt{1 - (\frac{x}{2})^2}$

So yes, I essentially have no clue about how they got there. :( Anybody feel up to trying to explain this to me?