Let $$I=\int \frac{\sin x}{\cos x + \sin x}\ dx \tag{1}$$

Now let $$u=\frac{\pi}{2} - x \tag{2}$$ so $$I=\int \frac{\sin (\frac{\pi}{2} - u)}{\cos (\frac{\pi}{2} - u)+\sin (\frac{\pi}{2} - u)}\ du \tag{3}$$

$$=\int\frac{-\cos u}{\sin u + \cos u} \ du \tag{4}$$

$$= \int\frac{-\cos x}{\sin x + \cos x} \ dx \tag{5}$$

and hence $$2I=\int\frac{\sin x - \cos x}{\sin x + \cos x} \ dx \tag{6}$$

$$=-\ln\ |\sin x + \cos x| + c \tag{7}$$

$\implies I=-\frac{1}{2}\ln|\sin x + \cos x| + c \tag{8}$

But the actual answer is $$I= \frac{1}{2}x -\frac{1}{2}\ln|\sin x + \cos x| + c \tag{9}$$

according to Wolfram Alpha and supported by a different method.

Why does my method not yield the correct result?