$\int{\frac{1}{\sin(x)+\cos(x)}}dx$
First, I divided by $\cos(x)$, obtaining:
$\int{\frac{\sec(x)}{\tan(x)+1}}dx$
Then using the substitution $u-1 = \tan(x)$, I got:
$\int{\frac{1}{u\sec(x)}}du$ = $\int\frac{1}{u \sqrt{(u-1)^2+1}}du$
Now I need help with moving on from here as I am stuck, thank you. Any idea is appreciated.
Best Answer
Two hints:
Hint 1 (following your track): Instead use the substitution $\tan x = \sinh t$ which gives the integrand
$$\int \frac{dt}{\sinh t + 1} = \int\frac{2\:d(e^t+1)}{(e^t+1)^2-2}$$
which integrates to an artanh.
Hint 2: $\sin x + \cos x = A\cos(x + \phi)$ which turns the integrand into something of the form
$$\int \frac{1}{A}\sec(x+\phi)\:dx$$
Solve for $A$ and $\phi$ and you're done.