<s>[INST] Help with $\int \frac{1}{(\sin x + \cos x)}$ Kindly solve this question
$$\int \frac{1}{(\sin x + \cos x)} dx$$
I reached up to 
$$\frac{(1+\tan^2x)}{1-\tan^2x + 2\tan x}$$
 [/INST] HINT:
$$\sin x+\cos x=\sqrt2\sin\left(x+\frac\pi4\right)$$ or $$\sin x+\cos x=\sqrt2\cos\left(x-\frac\pi4\right)$$
More generally, set $a=r\cos\phi,b=r\sin\phi$ to find
$a\sin x+b\cos x=\sqrt{a^2+b^2}\sin\left(x+\arctan2(b,a)\right)$
Similarly,  set $a=r\sin\psi,b=r\cos\psi$ to find
$a\sin x+b\cos x=\sqrt{a^2+b^2}\cos\left(x-\arctan2(a,b)\right)$
arctan2 has been defined here
</s>