Fabian's post seems fine, but to clear up your confusion about which trig sub to use, I'll mention three cases.
When you see integrals of the form $$\sqrt{a^2+x^2}$$
where $a \in \mathbb R$, the substitution $x = a \tan \theta$ usually cleans up the integral quite nicely and makes it easier to work with. Note that the new integral may require another common integration method (such as integration by parts.)
Similarly, if you see integrals of the form
$$\sqrt{a^2-x^2}$$
try the substitution $x = a \sin \theta$. For integrals of the form $$\sqrt{x^2-a^2}$$ try the substitution $x = a \sec \theta$.
Addendum
Based on Stewart's text, the problem is to find the length of the arc of the parabola $y^2 = x$ from $(0,0)$ to $(1,1)$.
Arc length is given by
$$L = \int_a^b \sqrt{1 + \left(\frac{dx}{dy}\right)^2} \ dy $$
We are given $$x = y^2 \implies \frac{dx}{dy} = 2y$$
$$L = \int_a^b \sqrt{1 + \left(\frac{dx}{dy}\right)^2} \ dy = \int_0^1 \sqrt{1 + (2y)^2} \ dy = \int_0^1 \sqrt{1 + 4y^2} \ dy$$
$$\int_0^1 \sqrt{1 + 4y^2} \ dy = \int_0^1 \sqrt{4\left(\frac{1}{4} + y^2\right)}\ dy = \int_0^1 2\sqrt{\left(\frac{1}{4} + y^2\right)} \ dy$$
The key to this is to note that the part involving $x^2$ cannot have a constant out front - so we need to factor and be clever to get in in a form that matches our three templates we know.
So, in general, if you see
$$\sqrt{a^2 + kx^2} \quad a,k \in \mathbb R$$
Factor out $k$ to be left with $\sqrt{k\left(\frac{a^2}{k} + x^2 \right)}.$ Most of the time in nice examples (I imagine most of those picked out by Stewart are), $k$ will be a perfect square, which means we can factor it out of the square root as I did in your example. This helps clean our integral up nicely!
Now since $\left(\frac{1}{2}\right)^2 = \frac{1}4$, it should make sense that this follows the $a^2 + u^2$ template above. Carry out the substitution of $y = \frac{ \tan \theta}{2} \implies dy = \frac{\sec^2 \theta}{2} \ d \theta$. You end up needing to deal with
$$\frac{1}{2}\int_{y = 0}^{y=1} \sec^3 \theta \ d\theta$$
This is a common integration by parts example done in a Calc 2 course, in which many proofs of it can be found online. I've answered a question involving this integral here.