<s>[INST] What is $\int\frac{dx}{x+\sqrt{1-x^2}}$? 
Possible Duplicate:
Compute $\int \frac{\sin(x)}{\sin(x)+\cos(x)}\mathrm dx$ 

$$\int\frac{dx}{x+\sqrt{1-x^2}}$$
I used $x = \sin(a),\ dx = \cos (a)\,da$.
However, I am getting suck after that. 
I can't seem to find what to do after $$ \int \frac{\cos(a)\,da}{\sin(a)+\cos(a)}$$
Help please. 
 [/INST] Hint or starting point:
Nothing immediate jumps out to me when I see the integral
$$\int \frac{\cos \theta}{\sin \theta + \cos\theta} d\theta$$
However, when integrating rational function of trig functions, we can always use the Weierstrass substitution.
So, let $t = \tan \left(\frac{\theta}{2}\right), dt = \frac{1}{2}\sec^2\left(\frac{\theta}{2}\right) \ dx.$
With the Weierstrass sub, we have that:
$$\sin \theta = \frac{2t}{1+t^2}, \cos\theta = \frac{1-t^2}{1+t^2}, d\theta = \frac{2 \ dt}{1+t^2}$$
This allows us to rewrite our integral as:
$$\int\frac{2(1-t^2) \ dt}{(t^2+1)^2 \left(\frac{2t}{t^2+1} + \frac{1-t^2}{t^2+1}\right) }$$
Clean up the denominator to get:
$$2\int\frac{(t^2-1) \ dt}{t^4 - 2t^3 - 2t - 1}$$
From here, looks like partial fractions will do it. Note the denominator factors as
$$(t^2+1)(t^2-2t-1)$$
Second thought
Write the original integral as 
$$\int \frac{1}{1+\cot \theta} d\theta$$
Let $u = \cot \theta, du = -(1+u^2) d\theta$. Then we have:
$$-\int\frac{1}{(1+u^2)(u^2+1)} \ du $$
This is a nicer partial fraction decomposition to work with and is less work in getting there compared to my original thinking.
</s>