I'm trying to find the integral $\int \frac{1}{\sin(x) + \cos(x)} dx$. This is my solution:
$\int \frac{1}{\sin(x) + \cos(x)} dx = \int \frac{1}{\sqrt{2} \sin(x + \frac{\pi}{4})} = \frac{1}{\sqrt{2}} \int \csc(x+\frac{\pi}{4}) dx = -\frac{1}{\sqrt{2}} \ln(\csc(x+\frac{\pi}{4}) + \cot(x+\frac{\pi}{4})) $.
I used WolframAlpha to differentiate this result to check if I get the integrand and I got it.
However, when I query WolframAlpha to integrate $\int \frac{1}{\sin(x) + \cos(x)} dx$ itself, the result looks (is?) very different (involves complex numbers too), which makes me doubt the correctness of my solution. Is there something wrong about my method?
Your answer is correct. The one provided by Wolfram Alpha is correct, but I think that your answer is better, since it provides an answer which uses only real numbers to a question which uses only real numbers too.