I'm given this $\int\frac{1}{\sin x+\cos x}dx$.
My attempt,
$\sin x+\cos x=R\cos (x-\alpha)$
$R\cos \alpha=1$ and $R\sin \alpha=1$
$R=\sqrt{1^2+1^2}=\sqrt{2}$,
$\tan\alpha=1$ $\alpha=\frac{\pi}{4}$
So, $\sin x+\cos x=\sqrt{2}\cos (x-\frac{\pi}{4})$
$\int\frac{1}{\sin x+\cos x}dx=\int \frac{1}{\sqrt{2}\cos (x-\frac{\pi}{4})}dx$
$=\frac{1}{\sqrt{2}}\int \sec (x-\frac{\pi}{4})dx$
$=\frac{1}{\sqrt{2}} \ln \left | \sec (x-\frac{\pi}{4})+\tan (x-\frac{\pi}{4}) \right |+c$
Am I correct? Is there another way to solve this integral? Thanks in advance.