Antiderivative to $\int\frac{1}{(\cos x+\sin x)^2} \ dx$ I have tried the following:
$\int\frac{1}{(\cos x+\sin x)^2} \ dx \ = \int \frac{\sec^2x}{(\tan x+1)^2}\ dx \ $.
After using the substitution $t=\tan x$, I got the solution: $- \frac{1}{\tan x+1} + C$.
Wolfram alpha gives the solution: $\frac{\sin x}{\sin x+\cos x}$.
At the same time $\frac{\sin x}{\sin x+\cos x} \neq - \frac{1}{\tan x+1}$.
So I'm a bit confused.

$$
\begin{aligned}
\int \frac{1}{(\cos x+\sin x)^{2}} d x &=\int \frac{\sec ^{2} x}{(1+\tan x)^{2}} d x \\
&=\int \frac{d(\tan x)}{(1+\tan x)^{2}} \\
&=-\frac{1}{1+\tan x}+C \\
&=-\frac{\cos x}{\cos x+\sin x}+C\\
&=-\frac{\cos x+\sin x-\sin x}{\cos x+\sin x}+C\\
&=-1+\frac{\sin x}{\cos x+\sin x}+C\\
&=\frac{\sin x}{\cos x+\sin x}+C^{\prime}
\end{aligned}
$$
$\therefore$ the answers differ by only a constant.
