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. 
 A: Try this:
$$
I=\int \frac{\cos x dx}{\cos x+ \sin x}\\
J=\int \frac{\sin x dx}{\cos x+ \sin x}
$$
Then,
$$
I+J=x+C_1\\
I-J=\int \frac{(\cos x - \sin x )dx}{\cos x+ \sin x}=\int d \log(\cos x + \sin x)\\
=\log(\cos x + \sin x) +C_2
$$
Hence you have two unknowns in two equations, from which you can easily find $I$
A: 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.
A: If you don't see the trick, you can try using the formula for $A \cos(t) + B \sin(t)$, namely
$\sin(a) + \cos(a) = \sqrt{2}(\sin(a + {\pi \over 4}))$. So you seek 
$${1 \over \sqrt2}\int \frac{\cos(a)}{\sin(a + {\pi \over 4})}\,da$$
$$= {1 \over \sqrt2}\int \frac{\cos(a + {\pi \over 4} - {\pi \over 4})}{\sin(a + {\pi \over 4})}\,da$$
Using the cosine subtraction formula, this is
$${1 \over 2}\int\frac{\cos(a + {\pi \over 4}) + \sin(a + {\pi \over 4})}{\sin(a + {\pi \over 4})}\,da$$
$${1 \over 2}\int (\cot(a + {\pi \over 4}) + 1) \,da$$
$$= {1 \over 2}\ln|\sin(a + {\pi \over 4})| + {a \over 2} + C$$
A: Put $\cos a=A(\sin a+\cos a)+B\frac{d(\sin a+\cos a)}{da}$ where $A,B$ are constants
Now,  $\cos a=A(\sin a+\cos a)+B(\cos a-\sin a)$
Equating the coefficients of $\sin a,A-B=0$ or $A=B$ 
Equating the coefficients of $\cos a,A+B=1$ or $A=B=\frac 1 2$ 
So, $\int \frac{\cos a da}{\sin a+\cos a}$
$$=\frac 1 2\int da+\frac 1 2\int\frac{d(\sin a+\cos a)}{\sin a+\cos a}=\frac a 2+\frac 1 2\log(\sin a+\cos a)+C$$ where $C$ is the indeterminate constant of indefinite integral. 
A: The substitution $x=2t/(1+t^2)$ will reduce the original integrand to a rational (though perhaps messy) function of $t$. 
