I have this excercise. The hint is that it's solved by the substitution method, but I'm not able to find the right one, or even get close to something.
$$\int\frac{\sec(x)}{\sin(x)+\cos(x)}dx$$
Using identities, I have arrived to things like this:
$$-\int\frac{\tan(x)-1}{\cos(2x)}dx$$
But, well, the thing above doesn't help too much. I'd appreciate any help on this subject.
Here's a solution using a substitution.
In particular, observe that $$\frac{\sec x}{\sin x+\cos x}\cdot\frac{\sec x}{\sec x}=\frac{\sec^2 x}{\tan x+1}.$$ This is useful because $\frac{d}{dx}\tan x=\sec^2x$, so substituting $u=\tan x$ tells us that $$\int\frac{\sec x}{\sin x+\cos x}dx=\int\frac{1}{u+1}du=\ln(|u+1|)=\ln(|\tan x+1|).$$
Since $\tan x=\frac{\sin x}{\cos x}$, we find that this is simply equal to $$\ln\left(\frac{\sin x+\cos x}{\cos x}\right)=\ln\left(|\sin x+\cos x|\right)-\ln\left(|\cos x|\right).$$